/* ============================================================
   mimikko-auto 控制台 · 安静的工具型主题
   纸面底色 + 墨色文字 + 深青点缀；衬线标题 / 等宽数字
   ============================================================ */

:root {
  --paper:       #f5f4ef;
  --surface:     #ffffff;
  --surface-2:   #eeede6;
  --ink:         #27251e;
  --ink-2:       #6f6c5f;
  --ink-3:       #9b9789;
  --line:        #e2e0d4;
  --line-strong: #cfccbc;

  --accent:      #0e7a6c;
  --accent-ink:  #0a5c51;
  --accent-soft: #e2efec;
  --accent-line: #bcd9d3;

  --warn:        #9a6700;  --warn-soft:  #f8efdb;  --warn-line:  #e8d5a8;
  --danger:      #b3372f;  --danger-soft:#f9e8e5;  --danger-line:#ecc4bf;
  --ok:          #0e7a6c;  --ok-soft:    #e2efec;  --ok-line:    #bcd9d3;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 2px rgba(39, 37, 30, .05), 0 4px 14px -8px rgba(39, 37, 30, .10);

  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle, rgba(39, 37, 30, .045) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted-sm { color: var(--ink-3); font-size: 12px; }
.pad { padding: 20px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 22px; height: 58px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-title {
  font-family: var(--serif); font-size: 16px; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: .14em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; position: relative; }

/* ---------- 模拟数据模式提示条 ---------- */
body.mock-active { --banner-h: 38px; }
body.mock-active { padding-top: var(--banner-h); }
.mock-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  height: var(--banner-h, 38px);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--warn-soft); color: var(--warn);
  border-bottom: 1px solid var(--warn-line);
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.mock-banner-text::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); margin-right: 8px; vertical-align: 1px;
}
.mock-exit {
  background: var(--warn); border-color: var(--warn); color: #fff;
  padding: 3px 12px; font-size: 12px;
}
.mock-exit:hover { background: #7f5600; border-color: #7f5600; }
body.mock-active .topbar { top: var(--banner-h); }
body.mock-active .nav { top: calc(58px + var(--banner-h)); }
body.mock-active .toasts { top: calc(72px + var(--banner-h)); }

/* ---------- 徽标 chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 12.5px; cursor: pointer; transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--accent-line); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.chip.is-ok .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.chip.is-warn .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.chip.is-danger .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.chip.is-ok { border-color: var(--ok-line); }
.chip.is-warn { border-color: var(--warn-line); }
.chip.is-danger { border-color: var(--danger-line); }

/* ---------- 布局 ---------- */
.shell { display: flex; align-items: flex-start; }
.nav {
  position: sticky; top: 58px;
  width: 176px; flex: none;
  padding: 20px 10px 40px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.nav-item .num { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); width: 18px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.is-active {
  background: var(--accent-soft); color: var(--accent-ink);
  border-left-color: var(--accent); font-weight: 600;
}
.nav-item.is-active .num { color: var(--accent); }
.nav-item.is-placeholder { color: var(--ink-3); }
.nav-item.is-placeholder::after {
  content: "建设中"; margin-left: auto; font-size: 10px; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 4px;
}

.view {
  flex: 1; min-width: 0;
  max-width: 1040px;
  padding: 26px 32px 80px;
}

/* ---------- 视图头 ---------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head .kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; color: var(--accent); margin-bottom: 4px; }
.view-title { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.view-desc { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.view-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- SWR 更新细线（后台再验证期间） ---------- */
.swr-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 65;
  height: 2px; pointer-events: none; opacity: 0;
  transition: opacity .18s ease;
  background: linear-gradient(90deg, transparent, var(--accent) 35%, var(--accent-ink) 50%, var(--accent) 65%, transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
}
.swr-bar.is-on { opacity: 1; animation: swrSlide 1.1s ease-in-out infinite; }
@keyframes swrSlide { from { background-position: -60% 0; } to { background-position: 160% 0; } }
body.mock-active .swr-bar { top: var(--banner-h, 38px); }

/* ---------- 最后更新时间戳 ---------- */
.view-stamp {
  display: inline-flex; align-items: center; gap: 6px; align-self: center;
  font-size: 11px; color: var(--ink-3); white-space: nowrap;
  margin-right: 6px; font-variant-numeric: tabular-nums;
}
.view-stamp .stamp-dot { display: none; width: 10px; height: 10px; flex: none; }
.view-stamp.is-updating .stamp-dot {
  display: inline-block;
  border: 1.5px solid var(--accent); border-top-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-sub { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

.section-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  color: var(--ink-3); margin: 26px 0 10px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #9a2d26; border-color: #9a2d26; }
.btn-warn { background: var(--warn); border-color: var(--warn); }
.btn-warn:hover { background: #7f5600; border-color: #7f5600; }
.btn-sm { padding: 4px 11px; font-size: 12.5px; }
.btn:disabled, .btn.is-busy { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn.is-busy::before {
  content: ""; width: 12px; height: 12px; flex: none;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-size: 15px; line-height: 1; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- 开关 ---------- */
.switch { position: relative; display: inline-flex; align-items: center; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track {
  width: 36px; height: 20px; border-radius: 999px;
  background: var(--line-strong); transition: background .18s;
  position: relative; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 表单 ---------- */
.input, .select {
  font: inherit; color: var(--ink);
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
  width: 100%;
}
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.select-sm { width: auto; padding: 4px 8px; font-size: 12.5px; }
.input-sm { width: 84px; padding: 4px 8px; font-size: 12.5px; text-align: right; }
.form-error { color: var(--danger); font-size: 12.5px; margin-top: 8px; }
.field-label { font-size: 12px; color: var(--ink-2); margin-bottom: 4px; display: block; }

/* ---------- 状态徽标 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface);
  white-space: nowrap;
}
.tag-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--accent-ink); }
.tag-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.tag-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.tag-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.tag-dim { color: var(--ink-3); border-style: dashed; }

/* 任务等级徽标 */
.lv {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff;
}
.lv-D { background: #a8a49a; }
.lv-C { background: #7f9c99; }
.lv-B { background: #6e93b8; }
.lv-A { background: #c08a3e; }
.lv-S { background: #b85c4a; }
.lv-SS { background: #8a558f; }

/* ---------- 倒计时 ---------- */
.cd {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 20px; font-weight: 600; letter-spacing: .02em;
}
.cd-sm { font-size: 13px; font-weight: 500; }
.cd-label { font-size: 11px; color: var(--ink-2); }

/* ---------- 结果行 ---------- */
.result-rows {
  margin-top: 12px; border-top: 1px dashed var(--line);
  padding-top: 10px; display: flex; flex-direction: column; gap: 5px;
}
.result-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; color: var(--ink-2);
  animation: rowIn .25s ease both;
}
.result-row::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  align-self: center; background: var(--ok);
}
.result-row.is-err::before { background: var(--danger); }
.result-row.is-err { color: var(--danger); }
/* 预期内的暂态（如 409 奖励未就绪）：琥珀点、中性文案，非失败红 */
.result-row.is-pending::before { background: var(--warn); }
.result-row.is-pending { color: var(--ink-2); }
.result-row.is-pending .btn { flex: none; align-self: center; margin-left: auto; }
@keyframes rowIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- 骨架屏 ---------- */
.skel {
  border-radius: 6px;
  background: linear-gradient(100deg, var(--surface-2) 40%, #f7f6f1 50%, var(--surface-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  min-height: 14px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card { height: 110px; }
.skel-line { height: 12px; margin: 8px 0; }
.skel-line.w60 { width: 60%; } .skel-line.w80 { width: 80%; } .skel-line.w40 { width: 40%; }

.empty {
  text-align: center; color: var(--ink-3); font-size: 13px;
  padding: 36px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

/* ---------- 能源仓位 ---------- */
.slot { position: relative; overflow: hidden; }
.slot::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--line-strong);
}
.slot.is-ongoing::before { background: var(--accent); }
.slot.is-finished::before { background: var(--ok); }
.slot.is-cooling::before { background: var(--warn); }
.slot.is-locked { opacity: .55; }
.slot-pos { font-family: var(--mono); font-size: 12px; color: var(--ink-2); letter-spacing: .06em; }

/* ---------- 任务卡 ---------- */
.task-card { display: flex; flex-direction: column; gap: 10px; }
.task-name { font-weight: 600; font-size: 14.5px; }
.task-desc { color: var(--ink-2); font-size: 12.5px; }
.task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chars-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 11px; font-weight: 600; border: 1px solid var(--accent-line);
}
.avatar.is-idle { background: var(--surface-2); color: var(--ink-2); border-color: var(--line-strong); }
.char-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 2px 8px 2px 3px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
}

/* ---------- 子标签 ---------- */
.subtabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.subtab {
  padding: 5px 16px; font-size: 13px; border: 0; background: transparent;
  cursor: pointer; color: var(--ink-2);
}
.subtab + .subtab { border-left: 1px solid var(--line); }
.subtab.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

/* ---------- 签到日历条 ---------- */
.cal { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.cal-cell {
  aspect-ratio: 1; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10.5px;
  background: var(--surface-2); color: var(--ink-3);
  border: 1px solid transparent;
}
.cal-cell.is-signed { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); font-weight: 600; }
.cal-cell.is-today { border-color: var(--accent); border-style: solid; }
.cal-cell.is-miss { color: var(--ink-3); opacity: .6; }
.cal-cell { position: relative; }
.cal-cell.is-resign::after {
  content: ""; position: absolute; top: 3px; right: 3px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--warn);
}
.cal-unavailable { padding: 14px 2px; }

/* ---------- 邮件 ---------- */
.mail-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 6px; border-bottom: 1px solid var(--line);
}
.mail-row:last-child { border-bottom: 0; }
.mail-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex: none; }
.mail-unread.is-read { background: var(--line-strong); }
.mail-main { flex: 1; min-width: 0; }
.mail-title { font-weight: 600; font-size: 13.5px; }
.mail-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.attach { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); }
.attach.is-done { background: var(--surface-2); border-color: var(--line); color: var(--ink-3); }

/* ---------- 活动卡 ---------- */
.activity-cover {
  height: 92px; border-radius: 9px;
  display: flex; align-items: flex-end; padding: 10px 12px;
  color: #fff; font-family: var(--serif); font-size: 15px; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
  background: linear-gradient(135deg, #3c8577, #275e63 55%, #1f3a4d);
}
.activity-cover.alt-1 { background: linear-gradient(135deg, #7c6aa6, #4f5d92 60%, #31456e); }
.activity-cover.alt-2 { background: linear-gradient(135deg, #b8763f, #99533a 55%, #6e3242); }
.activity-cover.is-series { height: 64px; font-size: 13.5px; }

/* 7 日签到条：已签 ✓（青）、今日描边、未到灰 */
.day-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chip {
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-3);
  border: 1px solid transparent; cursor: default;
}
.day-chip.is-signed { background: var(--ok-soft); color: var(--accent-ink); border-color: var(--ok-line); }
.day-chip.is-today { border-color: var(--accent); border-style: solid; color: var(--ink-2); background: var(--surface); }

/* ---------- 引擎模块卡 ---------- */
.mod-card { display: flex; flex-direction: column; gap: 10px; }
.mod-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mod-name { font-weight: 600; font-size: 14px; }
.mod-nums { display: flex; gap: 16px; flex-wrap: wrap; }
.mod-num { display: flex; flex-direction: column; }
.mod-num b { font-family: var(--mono); font-size: 19px; font-weight: 600; }
.mod-num span { font-size: 11px; color: var(--ink-2); }
.mod-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

/* ---------- KV 表 ---------- */
.kv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kv-table td { padding: 5px 8px; border-bottom: 1px dashed var(--line); }
.kv-table tr:last-child td { border-bottom: 0; }
.kv-table td:first-child { color: var(--ink-2); white-space: nowrap; }
.kv-table td:last-child { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- 抽屉（运行日志） ---------- */
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: 42vh; min-height: 260px;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -12px 30px -18px rgba(39,37,30,.35);
  display: flex; flex-direction: column;
  animation: drawerUp .22s ease;
}
@keyframes drawerUp { from { transform: translateY(100%); } to { transform: none; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; border-bottom: 1px solid var(--line); flex: none;
}
.drawer-title { font-weight: 600; font-size: 14px; display: flex; align-items: baseline; gap: 8px; }
.drawer-actions { display: flex; align-items: center; gap: 8px; }
.drawer-body { flex: 1; overflow: auto; padding: 8px 18px 16px; font-family: var(--mono); font-size: 12px; }
.log-row { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.log-row:last-child { border-bottom: 0; }
.log-ts { color: var(--ink-3); flex: none; }
.log-job { flex: none; width: 64px; color: var(--accent-ink); }
.log-msg { color: var(--ink-2); word-break: break-all; }
.log-row.is-warn .log-msg { color: var(--warn); }
.log-row.is-error .log-msg { color: var(--danger); }

/* ---------- 弹窗 ---------- */
.dialog { border: 0; padding: 0; background: transparent; max-width: min(560px, calc(100vw - 40px)); width: 100%; }
.dialog::backdrop { background: rgba(39, 37, 30, .38); backdrop-filter: blur(2px); }
.dialog-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -20px rgba(39,37,30,.4);
  padding: 22px;
}
.dialog-title { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.dialog-desc { color: var(--ink-2); font-size: 12.5px; margin: 8px 0 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.plan-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 2px; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.plan-row:last-child { border-bottom: 0; }
.plan-task { font-weight: 600; flex: none; }
.plan-chars { color: var(--ink-2); font-size: 12.5px; }

/* ---------- 占位面板 ---------- */
.placeholder-panel {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  padding: 40px 28px; text-align: center;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.placeholder-glyph {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 24px; font-weight: 700;
}
.placeholder-title { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.placeholder-desc { color: var(--ink-2); font-size: 13px; margin: 8px auto 0; max-width: 420px; }
.placeholder-list {
  margin: 18px auto 0; padding: 0; list-style: none; text-align: left;
  max-width: 380px; display: flex; flex-direction: column; gap: 7px;
}
.placeholder-list li { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.placeholder-list li::before { content: "—"; color: var(--accent); flex: none; }

/* ---------- Toast ---------- */
.toasts {
  position: fixed; top: 68px; right: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; width: 320px; max-width: calc(100vw - 36px);
  pointer-events: none;
}
.toast {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px; box-shadow: var(--shadow);
  padding: 10px 14px; font-size: 13px;
  animation: toastIn .22s ease both;
  pointer-events: auto;
}
.toast.is-ok { border-left-color: var(--ok); }
.toast.is-warn { border-left-color: var(--warn); }
.toast.is-err { border-left-color: var(--danger); }
.toast.is-leaving { animation: toastOut .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }

/* ---------- 能源余额条（工会） ---------- */
.energy-strip {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 18px; margin-bottom: 14px;
}
.energy-strip .num { font-family: var(--mono); font-size: 24px; font-weight: 600; }
.energy-strip .lbl { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.energy-strip .sep { width: 1px; height: 30px; background: var(--line); }

/* 可选角色 pill（多选） */
.char-pill { cursor: pointer; user-select: none; transition: border-color .12s, background .12s; }
.char-pill.is-off { opacity: .45; cursor: not-allowed; }
.char-pill.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.char-pill.is-selected .avatar { background: var(--accent); color: #fff; border-color: var(--accent); }
.char-pill .pick-n { font-family: var(--mono); font-size: 11px; color: var(--ink-2); margin-left: 2px; }

/* ---------- 出游团行 ---------- */
.group-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 2px; border-top: 1px dashed var(--line);
}
.group-row:first-of-type { border-top: 0; }
.group-name { font-weight: 600; font-size: 13.5px; }
.group-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.group-cap { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* 过滤 chip 行（日志页） */
.chips-row { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  padding: 4px 13px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 12.5px; cursor: pointer; color: var(--ink-2);
  font-family: var(--mono);
}
.chip-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.chip-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* 日志页行（复用抽屉 .log-row） */
.log-page { padding: 6px 18px 14px; font-family: var(--mono); font-size: 12.5px; }
.count-badge {
  display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-2);
}

/* ---------- 响应式 ---------- */
@media (max-width: 920px) {
  .shell { flex-direction: column; }
  .nav {
    position: sticky; top: 58px; z-index: 30;
    width: 100%; flex-direction: row; overflow-x: auto;
    padding: 8px 14px;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    gap: 4px;
  }
  .nav-item { border-left: 0; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; padding: 6px 10px; flex: none; }
  .nav-item.is-active { border-bottom-color: var(--accent); }
  .nav-item.is-placeholder::after { display: none; }
  .view { padding: 18px 16px 90px; }
  .brand-sub { display: none; }
  .chip .chip-label { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .drawer { height: 55vh; }
}

/* ---------- 自动调度（dispatch.js / dashboard 调度卡 / travel 图鉴矩阵） ---------- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 16px; border-radius: 999px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.is-on { background: var(--surface); color: var(--accent-ink); font-weight: 600; box-shadow: var(--shadow); }

.hint { font-size: 12px; color: var(--ink-3); margin-top: 8px; line-height: 1.65; }
.hint b { color: var(--ink-2); }

.order-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.order-row + .order-row { margin-top: 8px; }
.order-idx { width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; font-weight: 700; flex: none; }
.order-row .order-btns { margin-left: auto; display: inline-flex; gap: 6px; }
.order-row .icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.pref-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pref-btn { flex: 1; min-width: 118px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.pref-btn b { font-size: 13px; }
.pref-btn span { font-size: 11px; color: var(--ink-3); }
.pref-btn:hover { border-color: var(--ink-3); }
.pref-btn.is-on { border-color: var(--accent); background: var(--accent-soft); }
.pref-btn.is-on b, .pref-btn.is-on span { color: var(--accent-ink); }
.pref-btn.is-on span { opacity: .75; }

.buy-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12.5px; flex-wrap: wrap; }
.buy-row + .buy-row { margin-top: 8px; }
.buy-row.is-dim { opacity: .55; }
.buy-name { font-weight: 600; min-width: 64px; }
.buy-bal { color: var(--ink-2); }
.buy-price { color: var(--ink-2); }
.price-null { color: var(--warn); font-size: 12px; }
.buy-cap { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.buy-cap .input-sm { width: 60px; }

.divider { height: 1px; background: var(--line); margin: 16px 0 14px; }

.round-summary .rs-line { font-size: 13px; padding: 2px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.round-summary .rs-line b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.gold { color: #8a6a12; }
.new-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #f8ecd0; border: 1px solid #d9b95c; color: #8a6a12; white-space: nowrap; }

/* 总览：调度主卡资源水位 */
.res-strip { display: flex; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; flex-wrap: wrap; }
.res-cell { flex: 1; min-width: 110px; padding: 10px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.res-cell:last-child { border-right: 0; }
.res-cell .res-name { font-size: 11px; color: var(--ink-2); }
.res-cell .res-num { font-family: var(--mono); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.res-cell.is-dim .res-num { color: var(--ink-3); }

/* 调度接管态 */
.mod-card.is-takeover .mod-name { color: var(--ink-2); }
.takeover-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink); }

/* 出游：图鉴进度矩阵 */
.ctx-bar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink); font-size: 12.5px; margin-bottom: 12px; }
.atlas-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.atlas-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.atlas-scroll { overflow-x: auto; }
.atlas-table { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 560px; }
.atlas-table th { font-size: 11.5px; font-weight: 500; color: var(--ink-2); padding: 2px 6px; text-align: center; white-space: nowrap; }
.atlas-table th:first-child { text-align: left; }
.atlas-table td { padding: 0; }
.atlas-char { font-size: 12.5px; padding: 0 6px; white-space: nowrap; }
.atlas-cell { position: relative; width: 100%; min-width: 64px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; padding: 7px 6px; text-align: center; font-size: 12px; color: var(--ink-2); transition: border-color .15s, background .15s; }
.atlas-cell:hover { border-color: var(--accent); background: var(--accent-soft); }
.atlas-cell b { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.atlas-cell.is-full { background: var(--ok-soft); border-color: var(--ok-line); color: var(--accent-ink); font-weight: 600; }
.atlas-cell .new-flag { position: absolute; top: -5px; right: -5px; display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; font-style: normal; background: #f8ecd0; border: 1px solid #d9b95c; color: #8a6a12; box-shadow: var(--shadow); }
.pc-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; padding-right: 4px; }
.pc-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12.5px; }
.pc-cover { width: 40px; height: 30px; border-radius: 6px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--ink-3); font-size: 12px; font-weight: 600; overflow: hidden; }
.pc-cover img { width: 100%; height: 100%; object-fit: cover; }
.pc-row.is-own { opacity: .65; }
.pc-row .pc-own-tag { margin-left: auto; flex: none; }

/* 能源：付费策略开关（视图头内联小开关 + 说明文字） */
.switch-inline { gap: 7px; }
.switch-inline .switch-text { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; user-select: none; }

/* ---------- 认证门屏（单账号语义：未认证时覆盖整个应用） ---------- */
.auth-gate {
  position: fixed; inset: 0; z-index: 68; /* 高于抽屉/细线，低于模拟提示条(70)与 toast(80) */
  display: grid; place-items: center;
  padding: 24px; overflow: auto;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle, rgba(39, 37, 30, .045) 1px, transparent 1px),
    radial-gradient(560px 280px at 50% -8%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%);
  background-size: 26px 26px, auto;
}
.auth-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -24px rgba(39, 37, 30, .35);
  padding: 32px 30px 26px;
  animation: gateIn .32s ease both;
}
@keyframes gateIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.auth-mark { display: block; width: 46px; height: 46px; margin: 0 auto 16px; }
.auth-title { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: .02em; text-align: center; }
.auth-sub { text-align: center; color: var(--ink-2); font-size: 13px; margin: 6px 0 18px; }
.auth-card .input { font-size: 14px; padding: 10px 12px; }
.auth-submit { width: 100%; margin-top: 12px; padding: 9px 16px; font-size: 14px; }
.gate-alert {
  font-size: 12.5px; line-height: 1.6;
  padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid; margin-bottom: 12px;
}
.gate-alert.is-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.gate-alert.is-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.gate-alert.is-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.gate-note { color: var(--ink-3); font-size: 12px; line-height: 1.7; margin: 14px 0 0; }
@media (max-width: 480px) { .auth-card { padding: 24px 18px 20px; } }

/* ---------- 账户菜单（顶栏 chip 弹出） ---------- */
.account-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 85;
  min-width: 224px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px -18px rgba(39, 37, 30, .4);
  padding: 12px;
  animation: menuIn .16s ease both;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.account-menu-title { font-weight: 600; font-size: 13px; }
.account-menu .btn { justify-content: center; }
.btn-danger-ghost { background: var(--surface); color: var(--danger); border-color: var(--line-strong); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
