/* 每日一吃 · 共用样式 */
:root {
  --bg: #f6f5f1;
  --bg-elev: #ffffff;
  --bg-sunken: #efede8;
  --bg-hover: #f1efea;
  --line: #e7e4dd;
  --line-strong: #d8d4cb;
  --text: #1e1c19;
  --text-2: #5d5952;
  --text-3: #9a958c;
  --brand: #f05a28;
  --brand-hover: #df4c1b;
  --brand-soft: #fdeee6;
  --brand-ink: #b23f14;
  --ok: #178a59;
  --ok-soft: #e4f3eb;
  --warn: #b97409;
  --warn-soft: #fbf0dc;
  --bad: #cf3f36;
  --bad-soft: #fbe8e6;
  --info: #3069cc;
  --info-soft: #e7eefa;
  --mute-soft: #efede8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(30, 28, 25, .04), 0 2px 10px rgba(30, 28, 25, .04);
  --shadow-lg: 0 18px 50px rgba(30, 28, 25, .18);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #131211;
  --bg-elev: #1c1a18;
  --bg-sunken: #171614;
  --bg-hover: #24221f;
  --line: #2b2825;
  --line-strong: #3a3632;
  --text: #ece9e4;
  --text-2: #b0aaa1;
  --text-3: #7c776f;
  --brand: #ff7040;
  --brand-hover: #ff8259;
  --brand-soft: #3a2117;
  --brand-ink: #ffab86;
  --ok: #3cc58a;
  --ok-soft: #15291f;
  --warn: #e5a93a;
  --warn-soft: #2f2412;
  --bad: #f06a60;
  --bad-soft: #321917;
  --info: #6c9cf0;
  --info-soft: #172338;
  --mute-soft: #24221f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131211;
    --bg-elev: #1c1a18;
    --bg-sunken: #171614;
    --bg-hover: #24221f;
    --line: #2b2825;
    --line-strong: #3a3632;
    --text: #ece9e4;
    --text-2: #b0aaa1;
    --text-3: #7c776f;
    --brand: #ff7040;
    --brand-hover: #ff8259;
    --brand-soft: #3a2117;
    --brand-ink: #ffab86;
    --ok: #3cc58a;
    --ok-soft: #15291f;
    --warn: #e5a93a;
    --warn-soft: #2f2412;
    --bad: #f06a60;
    --bad-soft: #321917;
    --info: #6c9cf0;
    --info-soft: #172338;
    --mute-soft: #24221f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  /* 用户填写的长串（链接、无空格的英文名、长邮箱）允许在任意位置换行，避免把页面撑出横向滚动 */
  overflow-wrap: anywhere;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand); cursor: pointer; font: inherit; font-weight: inherit; }
.linkbtn:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- 布局 ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 22px 14px 16px; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand b { font-size: 17px; letter-spacing: .5px; }
.brand small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; letter-spacing: 0; margin-top: -2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }
.nav a.active svg { color: var(--brand); }
.nav a .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side-foot { margin-top: auto; }
.me {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; text-align: left;
}
.me:hover { background: var(--bg-hover); }
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 700;
}
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { color: var(--text-3); font-size: 12px; }

.main { min-width: 0; padding: 30px 36px 64px; }
.container { max-width: 1120px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 23px; line-height: 1.3; letter-spacing: .3px; }
.page-head p { margin: 4px 0 0; color: var(--text-3); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.topbar, .tabbar { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand { padding: 0; }
  .topbar .brand img { width: 30px; height: 30px; }
  .main { padding: 18px 16px 96px; }
  .tabbar {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
    backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--text-3); font-size: 11px; border-radius: 10px; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--brand); }
  .tabbar a svg { width: 22px; height: 22px; }
  .page-head h1 { font-size: 20px; }
}

/* ---------- 基础组件 ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-head h3 svg { color: var(--brand); }
.card-body { padding: 18px 20px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; }
.gap-lg { margin-top: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--bg-elev);
  color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.btn.soft:hover { filter: brightness(.97); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad-soft); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 13px; color: var(--text); }
.field .help { color: var(--text-3); font-size: 12px; line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--bg-elev); outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a958c' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input.sm, .select.sm { min-height: 32px; height: 32px; padding: 4px 10px; font-size: 13px; }
.select { max-width: 100%; text-overflow: ellipsis; }
/* 筛选下拉框：选项里有很长的账号名时不跟着变宽 */
.select.sm { max-width: 240px; }
.select.sm { padding-right: 28px; background-position: right 9px center; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.search .input { padding-left: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.switch { position: relative; display: inline-flex; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--mute-soft); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--bg-sunken); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; color: var(--text-2); cursor: pointer; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }
.seg button .n { font-size: 11px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; line-height: 17px; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 2px; margin-bottom: -1px; color: var(--text-3); font-weight: 600; font-size: 15px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--text); border-color: var(--brand); }

/* 统计 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px 18px; }
.stat .k { color: var(--text-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 700; line-height: 1.25; margin-top: 4px; letter-spacing: -.3px; }
.stat .v small { font-size: 13px; color: var(--text-3); font-weight: 500; margin-left: 3px; letter-spacing: 0; }
.stat .s { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.stat.hl .v { color: var(--brand); }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .stat { padding: 13px 14px; } .stat .v { font-size: 22px; } }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar i { display: block; width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: var(--brand); opacity: .88; min-height: 3px; transition: height .4s; }
.bars .bar.zero i { background: var(--line-strong); opacity: 1; }
.bars .bar.today i { opacity: 1; box-shadow: 0 0 0 3px var(--brand-soft); }
.bars .bar span { font-size: 11px; color: var(--text-3); }
.bars .bar em { font-style: normal; font-size: 11px; color: var(--text-2); font-weight: 600; }

/* 券 */
.coupons { display: flex; flex-wrap: wrap; gap: 8px; }
.coupon {
  position: relative; display: inline-flex; align-items: stretch; border-radius: 9px; overflow: hidden;
  background: var(--brand-soft); color: var(--brand-ink); font-size: 12.5px; line-height: 1.3; max-width: 100%;
}
.coupon .amt { display: flex; align-items: baseline; gap: 1px; padding: 6px 10px; font-weight: 800; font-size: 16px; border-right: 1.5px dashed color-mix(in srgb, var(--brand) 40%, transparent); }
.coupon .amt small { font-size: 11px; font-weight: 700; }
.coupon .txt { padding: 5px 11px 5px 10px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.coupon .txt b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coupon .txt span { font-size: 11px; opacity: .78; white-space: nowrap; }
.coupon.mini .amt { font-size: 13px; padding: 3px 8px; }
.coupons-rest { display: contents; }
.coupon-more { border: 1px dashed color-mix(in srgb, var(--brand) 45%, transparent); background: transparent; color: var(--brand-ink); border-radius: 9px; padding: 0 12px; min-height: 30px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.coupon-more:hover { background: var(--brand-soft); }
.coupon.mini .txt { padding: 3px 9px 3px 8px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--bg-sunken); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-hover); }
.table td.nowrap, .table th.nowrap { white-space: nowrap; }
/* 操作列保持表格单元格（不能用 flex，否则高度不随整行撑满，悬停时底部会露出白边） */
.table td.act { text-align: right; white-space: nowrap; }
.table td.act > * + * { margin-left: 4px; }
.table tr.click { cursor: pointer; }

/* 列表项 */
.list { display: flex; flex-direction: column; }
.list > .item { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.list > .item:last-child { border-bottom: 0; }

.empty { padding: 44px 20px; text-align: center; color: var(--text-3); }
.empty .ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--bg-sunken); color: var(--text-3); }
.empty .ico svg { width: 26px; height: 26px; }
.empty h4 { margin: 0 0 4px; color: var(--text); font-size: 15px; }
.empty p { margin: 0 0 14px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.pager .row { gap: 6px; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--info); font-size: 13px; line-height: 1.55; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.brand { background: var(--brand-soft); color: var(--brand-ink); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice svg { margin-top: 1px; }
.notice .x { margin-left: auto; border: 0; background: none; color: inherit; cursor: pointer; opacity: .7; padding: 0; }
.notice .txt { white-space: pre-wrap; flex: 1; min-width: 0; }

.kv { display: grid; grid-template-columns: 100px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; word-break: break-all; }
/* 表格保持原有宽度、在 .table-wrap 里横向滚动，不把列挤成一个字一行 */
.table { overflow-wrap: normal; }

pre.code {
  margin: 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-sunken); border: 1px solid var(--line);
  font: 12.5px/1.6 var(--mono); overflow: auto; white-space: pre-wrap; word-break: break-all; max-height: 420px;
}
code.inline { font: 12.5px var(--mono); background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; word-break: break-all; }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-hover) 50%, var(--bg-sunken) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.progress { height: 6px; border-radius: 99px; background: var(--bg-sunken); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .3s; }
.progress.warn i { background: var(--warn); }
.progress.bad i { background: var(--bad); }

/* ---------- 弹层 ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(20, 18, 16, .42); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--bg-elev); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { max-width: 760px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 6px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 12px 22px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
}
.drawer-overlay { justify-content: flex-end; padding: 0; align-items: stretch; }
.drawer { width: min(560px, 100vw); height: 100%; background: var(--bg-elev); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer .modal-body { flex: 1; }

.menu { position: fixed; z-index: 120; min-width: 168px; padding: 6px; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: fade .12s; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); }
.menu button:hover { background: var(--bg-hover); }
.menu button.danger { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

.toasts { position: fixed; z-index: 200; top: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .2s ease-out; max-width: calc(100vw - 32px); }
.toast.ok svg { color: #4fd69a; }
.toast.bad svg { color: #ff8a80; }
.toast.leave { opacity: 0; transform: translateY(-6px); transition: all .2s; }

/* ---------- 登录页 ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; position: relative; overflow: hidden; }
.auth::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 80vh; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; text-align: center; }
.auth-logo img { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 30%, transparent); }
.auth-logo h1 { margin: 0; font-size: 26px; letter-spacing: 1px; }
.auth-logo p { margin: -6px 0 0; color: var(--text-3); }
.auth .card { padding: 24px; }
.auth .tabs { margin: -6px 0 18px; }
.auth .stack { gap: 14px; }
.auth-foot { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 18px; }
.result-state { text-align: center; padding: 10px 4px; }
.result-state .ico { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.result-state .ico svg { width: 28px; height: 28px; }
.result-state h3 { margin: 0 0 6px; }
.result-state p { margin: 0 0 18px; color: var(--text-2); }

/* ---------- 业务：账号卡片 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .search { width: 240px; max-width: 100%; }
@media (max-width: 640px) {
  .toolbar .search { width: 100%; }
  .toolbar > .grow { display: none; }
  .toolbar > .btn:last-child { margin-left: auto; }
}
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acc { display: flex; flex-direction: column; padding: 16px 18px 14px; gap: 12px; transition: border-color .15s, box-shadow .15s; }
.acc:hover { border-color: var(--line-strong); }
.acc.off { opacity: .66; }
.acc .top { display: flex; align-items: flex-start; gap: 12px; }
.acc .ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.acc .ico svg { width: 20px; height: 20px; }
.acc .name { font-weight: 650; font-size: 15px; line-height: 1.35; }
.acc .meta { color: var(--text-3); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1px; }
.acc .last { font-size: 12.5px; color: var(--text-2); padding: 9px 11px; border-radius: 10px; background: var(--bg-sunken); line-height: 1.55; }
.acc .last .muted { font-size: 12px; }
.acc .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acc .foot .total { font-size: 12px; color: var(--text-3); }
.acc .foot .total b { color: var(--text); font-size: 14px; }
.acc .sel { margin-top: 2px; }

/* 记录 */
.rec { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 6px 16px; align-items: start; }
.rec .when { color: var(--text-3); font-size: 12.5px; line-height: 1.5; }
.rec .when b { display: block; color: var(--text); font-weight: 600; font-size: 13px; }
.rec .what .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.rec .what .msg { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.rec .what .coupons { margin-top: 8px; }
.rec .side-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 640px) {
  .rec { grid-template-columns: minmax(0, 1fr) auto; }
  .rec .when { grid-column: 1 / -1; display: flex; gap: 8px; }
  .rec .when b { display: inline; }
}

/* 日志 */
.logs { font-size: 13px; }
.log-line { display: grid; grid-template-columns: 74px 16px minmax(0, 1fr) auto; gap: 10px; padding: 8px 20px; align-items: start; border-bottom: 1px dashed var(--line); }
.log-line:last-child { border-bottom: 0; }
.log-line:hover { background: var(--bg-hover); }
.log-line .t { color: var(--text-3); font-family: var(--mono); font-size: 12px; padding-top: 1px; }
.log-line .t small { display: block; font-size: 10.5px; }
.log-line .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--text-3); }
.log-line.success .dot { background: var(--ok); }
.log-line.warn .dot { background: var(--warn); }
.log-line.error .dot { background: var(--bad); }
.log-line.info .dot { background: var(--info); }
.log-line .m { word-break: break-word; line-height: 1.55; }
.log-line.error .m { color: var(--bad); }
.log-line.success .m { color: var(--text); }
.log-line .tags { display: inline-flex; gap: 6px; margin-right: 6px; vertical-align: 1px; }
.tag { display: inline-block; font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 5px; background: var(--bg-sunken); color: var(--text-2); border: 1px solid var(--line); cursor: default; font-family: var(--mono); }
button.tag { cursor: pointer; }
button.tag:hover { border-color: var(--brand); color: var(--brand); }
.log-run { padding: 7px 20px; background: var(--bg-sunken); color: var(--text-2); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
@media (max-width: 640px) { .log-line { grid-template-columns: 54px 12px minmax(0, 1fr); padding: 8px 14px; } .log-line .x { grid-column: 3; } }

/* 任务 */
.task { padding: 16px 18px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.task .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--info-soft); color: var(--info); }
.task.off .ico { background: var(--bg-sunken); color: var(--text-3); }
.task .name { font-weight: 650; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.task .when { margin-top: 3px; font-size: 13.5px; color: var(--text); }
.task .sub { margin-top: 2px; color: var(--text-3); font-size: 12.5px; }
.task .runs { margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.task .runs span b { color: var(--text); font-weight: 600; }
.task .ops { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
@media (max-width: 640px) { .task { grid-template-columns: minmax(0, 1fr) auto; } .task .ico { display: none; } }

.timechips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.timechip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 6px 0 12px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; font-family: var(--mono); }
.timechip button { border: 0; background: none; color: inherit; cursor: pointer; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; opacity: .7; }
.timechip button:hover { opacity: 1; background: color-mix(in srgb, var(--brand) 15%, transparent); }
.timechip button svg { width: 14px; height: 14px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { width: 38px; height: 34px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--bg-elev); cursor: pointer; font-weight: 600; color: var(--text-2); }
.days button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pick-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px; }
.pick-list label { padding: 6px 8px; border-radius: 7px; }
.pick-list label:hover { background: var(--bg-hover); }
.preview { font-size: 12.5px; color: var(--text-2); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-sunken); line-height: 1.7; }

/* 运行进度 */
.run-items { display: flex; flex-direction: column; gap: 8px; }
.run-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--bg-sunken); }
.run-item .grow b { display: block; font-size: 13.5px; }
.run-item .grow .msg { font-size: 12.5px; color: var(--text-2); }
.run-item .coupons { margin-top: 6px; }
.run-sum { display: flex; gap: 18px; justify-content: center; text-align: center; padding: 6px 0 14px; }
.run-sum div b { display: block; font-size: 22px; }
.run-sum div span { font-size: 12px; color: var(--text-3); }

/* 对接中心 */
.hero {
  position: relative; overflow: hidden; padding: 22px 24px; border-radius: var(--radius);
  background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 12%, var(--bg-elev)), var(--bg-elev) 65%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero h2 { margin: 0 0 6px; font-size: 19px; display: flex; gap: 10px; align-items: center; }
.hero p { margin: 0; color: var(--text-2); max-width: 620px; }
.keybox { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-sunken); border: 1px dashed var(--line-strong); font-family: var(--mono); word-break: break-all; }
.api-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.api-row:last-child { border-bottom: 0; }
.method { font: 700 11.5px var(--mono); padding: 3px 0; border-radius: 6px; text-align: center; height: fit-content; }
.method.get { background: var(--info-soft); color: var(--info); }
.method.post { background: var(--ok-soft); color: var(--ok); }
.method.put { background: var(--warn-soft); color: var(--warn); }
.method.delete { background: var(--bad-soft); color: var(--bad); }
.api-row .path { font: 600 13px var(--mono); word-break: break-all; }
.api-row .desc { grid-column: 2; color: var(--text-2); font-size: 13px; }
.api-row details { grid-column: 2; margin-top: 4px; }
.api-row summary { cursor: pointer; color: var(--brand); font-size: 12.5px; }
.api-row details pre { margin-top: 8px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 960px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

.theme-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-opts button { border: 1px solid var(--line-strong); background: var(--bg-elev); border-radius: 10px; padding: 10px 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-2); }
.theme-opts button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------- 拼图滑块 ---------- */
.cap { max-width: 320px; margin: 0 auto; user-select: none; -webkit-user-select: none; }
.cap-stage { position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: 10px; overflow: hidden; background: var(--bg-sunken); }
.cap-bg { display: block; width: 100%; height: 100%; -webkit-user-drag: none; }
.cap-piece { position: absolute; left: 0; height: auto; pointer-events: none; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)); -webkit-user-drag: none; }
.cap-msg { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; font-size: 13px; font-weight: 600; color: #fff; text-align: center; background: rgba(0, 0, 0, .45); opacity: 0; transform: translateY(100%); transition: all .2s; }
.cap-msg:not(:empty) { opacity: 1; transform: none; }
.cap.ok .cap-msg { background: color-mix(in srgb, var(--ok) 85%, transparent); }
.cap.bad .cap-msg { background: color-mix(in srgb, var(--bad) 85%, transparent); }
.cap-track { position: relative; height: 44px; margin-top: 12px; border-radius: 22px; background: var(--bg-sunken); border: 1px solid var(--line); touch-action: none; }
.cap-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 22px; border-radius: 22px; background: var(--brand-soft); }
.cap-hint { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--text-3); pointer-events: none; transition: opacity .15s; }
.cap.dragging .cap-hint, .cap.ok .cap-hint { opacity: 0; }
.cap-handle { position: absolute; top: -1px; left: -1px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-elev); color: var(--brand); border: 1px solid var(--line-strong); box-shadow: var(--shadow); cursor: grab; touch-action: none; }
.cap.dragging .cap-handle { cursor: grabbing; }
.cap.ok .cap-handle { background: var(--ok); border-color: var(--ok); color: #fff; }
.cap.bad .cap-handle { background: var(--bad); border-color: var(--bad); color: #fff; }
.cap.bad .cap-stage { animation: cap-shake .32s; }
@keyframes cap-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.cap-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; }
.code-row .btn { flex: none; min-width: 112px; height: 38px; }
.auth-link { text-align: right; margin-top: -4px; }

/* ---------- 获取账号链接教程 ---------- */
.guide { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-sunken); }
.guide summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-weight: 600; list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform .15s; }
.guide[open] summary::after { transform: rotate(-135deg); }
.guide summary svg { color: var(--brand); }
.guide summary .muted { font-weight: 400; }
.guide[open] summary { border-bottom: 1px dashed var(--line-strong); }
.guide-body { display: flex; gap: 20px; align-items: center; padding: 16px 14px 10px; }
.guide-qr { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 6px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.guide-qr img { display: block; width: 148px; height: 148px; }
.guide-qr span { font-size: 12px; color: #6b665e; font-weight: 600; }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; line-height: 1.55; }
.guide-steps li { counter-increment: step; display: flex; gap: 10px; align-items: flex-start; }
.guide-steps li::before { content: counter(step); flex: none; width: 22px; height: 22px; margin-top: 0; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.guide-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 14px 12px; }
.guide-mobile { display: none; padding: 0 14px 12px; color: var(--text-2); }
.cred-hint { font-size: 12.5px; min-height: 0; }
.cred-hint:empty { display: none; }
.cred-hint.ok { color: var(--ok); }
.cred-hint.warn { color: var(--warn); }
.cred-hint.bad { color: var(--bad); }
@media (max-width: 640px) {
  .guide-body { flex-direction: column; align-items: stretch; }
  .guide-qr { align-self: center; }
  .guide-mobile { display: block; }
}
