*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #fff7fb;
  --bg-soft: #ffeaf2;
  --card: rgba(255,255,255,0.90);
  --card-strong: #fff8fb;
  --line: rgba(240,128,170,0.26);
  --text: #583247;
  --muted: #9b6d82;
  --primary: #e94f8f;
  --primary-soft: #ffd3e3;
  --ok: #2fa96b;
  --warn: #d8941e;
  --bad: #df4f70;
  --shadow: 0 16px 42px rgba(238,91,147,0.16);
}
html[data-theme="dark-blue"] {
  --bg: #071528;
  --bg-soft: #0c2340;
  --card: rgba(12,31,56,0.92);
  --card-strong: #102845;
  --line: rgba(116,169,225,0.28);
  --text: #e8f2ff;
  --muted: #8fb0d2;
  --primary: #54b6ff;
  --primary-soft: #163c68;
  --ok: #49d39a;
  --warn: #f2bd5c;
  --bad: #ff6f91;
  --shadow: 0 18px 48px rgba(0,9,24,0.42);
}
html, body { margin: 0; min-height: 100vh; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }
body {
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 12% 4%, rgba(255,198,220,0.72), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(255,221,235,0.82), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 52%, var(--bg) 100%);
}
html[data-theme="dark-blue"] body {
  background:
    radial-gradient(circle at 10% 0%, rgba(47,125,225,0.30), transparent 30%),
    radial-gradient(circle at 90% 6%, rgba(84,182,255,0.22), transparent 28%),
    linear-gradient(180deg, #06111f 0%, #071a30 52%, #0a1324 100%);
}
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255,255,255,0.88);
  outline: none;
}
html[data-theme="dark-blue"] input,
html[data-theme="dark-blue"] textarea,
html[data-theme="dark-blue"] select { background: rgba(9,24,43,0.92); }
textarea { min-height: 92px; resize: vertical; font-family: Consolas, monospace; font-size: 12px; }
button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--card-strong);
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 17px; }
.hide { display: none !important; }
.wrap { width: min(100%, 680px); margin: 0 auto; padding: 12px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login-card, .sakura-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.login-card { width: min(100%, 420px); padding: 18px; }
.login-legacy-toggle { width: 100%; margin-top: 10px; }
.login-legacy-fields { margin-top: 10px; }
.brand-row, .hero, .section-head, .account-head, .auto-inline-head, .log-inline-head, .modal-actions, .hero-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-head, .auto-inline-head, .log-inline-head { flex-wrap: wrap; }
.account-head > div,
.section-head > div,
.auto-inline-head > *:first-child,
.log-inline-head > *:first-child { min-width: 0; }
.section-head > div { flex: 1 1 220px; }
.auto-inline-head > .muted { flex: 1 1 auto; min-width: 140px; text-align: right; }
.log-inline-head > div { display: flex; flex-wrap: wrap; gap: 6px; }
.brand-row { margin-bottom: 16px; }
.brand-row p, .hero-sub, .section-head span, .small, .muted, .k { color: var(--muted); font-size: 12px; }
.field { display: grid; gap: 6px; margin: 11px 0; font-size: 12px; color: var(--muted); }
.field-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inline-check { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.inline-check input { width: auto; }
.primary { background: linear-gradient(135deg, #ff78ad, var(--primary)); color: #fff; border-color: transparent; box-shadow: 0 10px 24px rgba(233,79,143,0.24); }
html[data-theme="dark-blue"] .primary { background: linear-gradient(135deg, #2f7de1, #54b6ff); box-shadow: 0 10px 24px rgba(47,125,225,0.26); }
.big-btn { width: 100%; min-height: 42px; }
.icon-btn { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; }
.link-btn { border: 0; background: transparent; color: var(--primary); padding: 4px 6px; box-shadow: none; }
.err-hint { color: var(--bad); min-height: 20px; font-size: 12px; margin-top: 8px; }
.center { text-align: center; }
.hero {
  min-height: 88px;
  margin-bottom: 12px;
  padding: 16px;
  color: #fff;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff78ad, #e94f8f);
  box-shadow: var(--shadow);
}
html[data-theme="dark-blue"] .hero { background: linear-gradient(135deg, #2f7de1, #54b6ff); }
.hero-title { font-size: 22px; font-weight: 700; }
.hero-sub { color: rgba(255,255,255,0.85); margin-top: 4px; }
.notice-icon { position: relative; color: #fff; background: transparent; border-color: rgba(255,255,255,0.42); }
.notice-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; }
.page { display: none; }
.page.active { display: block; }
.sakura-card { padding: 14px; margin-bottom: 12px; }
.account-card { display: grid; gap: 12px; }
.account-name { font-size: 24px; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; word-break: break-word; }
.tag { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 2px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; white-space: nowrap; }
.tag.ok { background: rgba(47,169,107,0.16); color: var(--ok); }
.tag.warn { background: rgba(216,148,30,0.16); color: var(--warn); }
.tag.err { background: rgba(223,79,112,0.16); color: var(--bad); }
.expire-box { padding: 12px; border: 1px dashed var(--line); border-radius: 8px; background: rgba(255,255,255,0.42); }
html[data-theme="dark-blue"] .expire-box { background: rgba(9,24,43,0.38); }
.expire-status { margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--text); }
.expire-status.warn { color: var(--warn); }
.expire-status.err { color: var(--bad); }
.countdown { margin-top: 4px; font-size: 20px; font-family: Consolas, monospace; color: var(--ok); }
.countdown.warn { color: var(--warn); }
.countdown.err { color: var(--bad); }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info-grid, .status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-grid > div, .status-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.46);
}
html[data-theme="dark-blue"] .info-grid > div,
html[data-theme="dark-blue"] .status-grid > div { background: rgba(9,24,43,0.38); }
.v, .value { margin-top: 4px; font-weight: 650; word-break: break-word; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.help-btn { width: 20px; height: 20px; padding: 0; border-radius: 50%; font-size: 12px; color: var(--primary); }
.auto-inline, .log-inline { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.auto-task-box { overflow-x: auto; }
.auto-task-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 620px; }
.auto-task-table th, .auto-task-table td { text-align: left; padding: 8px 7px; border-bottom: 1px dashed var(--line); white-space: nowrap; }
.task-pill { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; border-radius: 999px; background: rgba(122,103,116,0.12); color: var(--muted); font-weight: 700; }
.task-pill.running { background: rgba(47,169,107,0.16); color: var(--ok); }
.task-pill.waiting, .task-pill.queued { background: rgba(216,148,30,0.16); color: var(--warn); }
.task-pill.failed { background: rgba(223,79,112,0.16); color: var(--bad); }
.task-pill.done { background: rgba(47,169,107,0.10); color: #277c53; }
.task-pill.skipped { background: rgba(122,103,116,0.12); color: var(--muted); }
.task-pill.disabled { background: rgba(122,103,116,0.08); color: rgba(122,103,116,0.72); }
html[data-theme="dark-blue"] .task-pill.done { color: #8adfb9; }
html[data-theme="dark-blue"] .task-pill.disabled { color: rgba(214,226,240,0.58); }
.log-box { min-height: 88px; max-height: 180px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(20,16,24,0.06); font: 12px/1.55 Consolas, monospace; }
html[data-theme="dark-blue"] .log-box { background: rgba(3,10,20,0.42); }
.log-line .t { color: var(--muted); margin-right: 6px; }
.seg-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.seg-btn.active { background: var(--primary); color: #fff; border-color: transparent; }
.settings-card { width: 100%; }
.task-list { display: grid; gap: 10px; width: 100%; }
.task-card { width: 100%; padding: 0; overflow: hidden; }
.task-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px; cursor: pointer; }
.task-check { width: 18px; height: 18px; }
.task-head strong { display: block; font-size: 14px; }
.task-head small { display: block; color: var(--muted); margin-top: 3px; }
.task-card.disabled { opacity: 0.62; }
.task-card.disabled .task-head { cursor: not-allowed; }
.task-arrow { color: var(--primary); }
.task-body { padding: 0 12px 12px; }
.task-card.collapsed .task-body { display: none; }
.option-grid { display: grid; gap: 8px; }
.option-row { display: grid; gap: 6px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.task-note { padding: 10px 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; line-height: 1.65; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.chip-check, .lane-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.38);
  color: var(--text);
  font-size: 12px;
}
.chip-check input, .lane-check input { width: auto; }
.config-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  width: min(430px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.nav-btn {
  display: grid;
  place-items: center;
  border-radius: 8px;
  padding: 10px 6px;
  min-height: 54px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.nav-btn.active { background: var(--primary); color: #fff; border-color: transparent; }
.ico { display: none; }
.txt { font-size: 16px; }
.modal-mask { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(0,0,0,0.52); }
.modal-box { width: min(100%, 460px); max-height: 84vh; overflow: hidden; display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card-strong); box-shadow: var(--shadow); }
.modal-scroll, .dm-body { max-height: 58vh; overflow-y: auto; }
.dm-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed var(--line); }
.dm-k { color: var(--muted); }
.dm-v { text-align: right; font-family: Consolas, monospace; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 98px; transform: translateX(-50%); z-index: 200; max-width: min(92%, 420px); padding: 10px 14px; border-radius: 999px; background: rgba(30,20,32,0.88); color: #fff; box-shadow: var(--shadow); }
@media (min-width: 760px) {
  .wrap { width: min(100%, 980px); }
  .status-grid { grid-template-columns: repeat(3, 1fr); }
  .info-grid { grid-template-columns: repeat(4, 1fr); }
}
