:root {
  --paper: #f5f3ee;
  --paper-2: #ece8dd;
  --ink: #1a1a1a;
  --ink-soft: #444;
  --line: #d8d2c4;
  --line-soft: #e6e1d3;
  --accent: #c8553d;
  --accent-soft: #e8a597;
  --muted: #8a857a;
  --gray: #f0ede5;
  --mono: ui-monospace, "JetBrains Mono", Menlo, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; background: var(--paper); color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hint { color: var(--ink-soft); font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.msg { min-height: 1.2em; font-size: 13px; color: var(--accent); margin: 8px 0 0; }
code { background: var(--gray); padding: 1px 6px; font-family: var(--mono); font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- 按钮 ---------- */
.btn {
  appearance: none; border: 1px solid var(--ink);
  font-family: inherit; font-size: 13px; padding: 8px 14px;
  cursor: pointer; border-radius: 2px; line-height: 1.2;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: #b04631; border-color: #b04631; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); background: var(--paper-2); }
.btn-text { background: transparent; color: var(--muted); border: 0; padding: 6px 8px; font-size: 12px; }
.btn-text:hover { color: var(--accent); }
.link-button {
  appearance: none; background: transparent; border: 0; padding: 0;
  color: var(--ink); font: inherit; cursor: pointer; text-align: left;
}
.link-button:hover { color: var(--accent); text-decoration: underline; }
.task-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

input, select, textarea {
  font: inherit; padding: 7px 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 2px;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); }

/* ---------- 登录页 ---------- */
body[data-page="login"] { display: grid; place-items: center; min-height: 100vh; }
.login { width: min(420px, 92vw); border: 1px solid var(--line); padding: 36px 32px; background: var(--paper); }
.login__brand { margin-bottom: 24px; }
.login__form .field { display: block; margin-bottom: 16px; }
.field__label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 4px; }
.field input, .field textarea { width: 100%; box-sizing: border-box; }
.login__foot { margin-top: 24px; text-align: center; }

/* 登录页 Tab 切换 */
.login__tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.login__tab {
  appearance: none; border: 0; border-bottom: 2px solid transparent;
  background: transparent; font: inherit; font-size: 14px; padding: 8px 20px;
  cursor: pointer; color: var(--muted); transition: color .15s, border-color .15s;
}
.login__tab:hover { color: var(--ink); }
.login__tab--active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.login__panel { display: none; }
.login__panel--active { display: block; }

/* ---------- Dashboard 整体布局 ---------- */
body[data-page="dashboard"] { min-height: 100vh; }

/* 固定侧边栏 */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 220px;
  background: var(--paper-2); border-right: 1px solid var(--line);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 16px;
  z-index: 20;
}
.sidebar__brand {
  font-size: 18px; font-weight: 700; color: var(--ink);
  letter-spacing: 0.02em; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.sidebar-primary-menu { display: flex; flex-direction: column; gap: 6px; }
.sidebar-primary-item {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.sidebar-primary-item.active {
  border-color: rgba(200, 85, 61, .35);
  box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar-subtabs {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.sidebar__tabs { display: flex; flex-direction: column; gap: 4px; }
.tab-btn {
  appearance: none; text-align: left; background: transparent; border: 0;
  font: inherit; font-size: 14px; color: var(--ink-soft);
  padding: 8px 10px; cursor: pointer; border-radius: 2px;
  border-left: 3px solid transparent;
}
.tab-btn:hover { background: var(--paper); color: var(--ink); }
.tab-btn.active {
  background: var(--paper); color: var(--accent);
  border-left-color: var(--accent); font-weight: 600;
}
.sidebar__sep { height: 1px; background: var(--line); margin: 4px 0; }
.sidebar__actions { display: flex; flex-direction: column; gap: 8px; }
.sidebar__actions .btn { width: 100%; }
.sidebar__foot {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.account-line { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.account-who {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-weight: 400;
  word-break: break-word;
}
.account-expiry-line { font-size: 12px; color: var(--muted); line-height: 1.35; }
.trustee-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  white-space: nowrap;
}
.trustee-status--ok { color: #2a7a3b; }
.trustee-status--bad { color: var(--accent); }
.trustee-status--idle { color: #777; }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #999;
}
.status-dot--ok { background: #2a7a3b; box-shadow: 0 0 0 3px rgba(42,122,59,.12); }
.status-dot--bad { background: var(--accent); box-shadow: 0 0 0 3px rgba(200,85,61,.12); }
.status-dot--idle { background: #8a8a8a; }

/* 主区 */
.main {
  margin-left: 220px;
  padding: 0;
  min-height: 100vh;
}

/* ---------- 顶部状态条（sticky）---------- */
.status-bar {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 16px 110px 16px 28px; /* 右侧留出常驻「支持」icon 的空间 */
  display: grid;
  grid-template-columns: 1.2fr 2fr 0.8fr;
  gap: 24px; align-items: center;
}
.status-bar__left .status-bar__title {
  font-size: 18px; font-weight: 700; color: var(--ink);
}
.status-bar__left .status-bar__sub {
  font-size: 12px; color: var(--muted); margin-top: 4px;
}
.status-bar__progress { display: flex; flex-direction: column; gap: 6px; }
.progress-num {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--mono); font-size: 22px; font-weight: 600;
}
.progress-num .muted { font-size: 18px; font-weight: 400; }
.progress-pct {
  margin-left: auto; font-size: 14px; color: var(--accent); font-weight: 600;
}
.bar {
  height: 6px; background: var(--line); position: relative;
  overflow: hidden; border-radius: 3px;
}
.bar > i {
  display: block; height: 100%; background: var(--accent);
  width: 0; transition: width 0.4s ease;
}
.status-bar__rank { text-align: right; }
.status-bar__rank .rank-label { font-size: 11px; color: var(--muted); }
.status-bar__rank .rank-value {
  font-family: var(--mono); font-size: 22px; font-weight: 700;
  color: var(--ink); margin-top: 2px;
}

/* ---------- Tab Panel ---------- */
.tab-panel { display: none; padding: 24px 28px 80px; }
.tab-panel.active { display: block; }
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }
.page-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.page-hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.section-title {
  font-size: 14px; font-weight: 600; color: var(--ink);
  margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.section-title:first-of-type { margin-top: 8px; }

/* ---------- 数据表 ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--line-soft); text-align: left;
  vertical-align: middle;
}
.data-table th {
  background: var(--gray); color: var(--ink-soft);
  font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line);
}
.data-table td.num, .data-table th.num {
  font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums;
}
.data-table tbody tr:hover { background: var(--paper-2); }
.data-table .empty { color: var(--muted); text-align: center; padding: 20px; }
.data-table tr.row-full { opacity: 0.5; }
.data-table tr.row-zero { background: rgba(80, 130, 200, 0.05); color: var(--muted); }
.data-table tr.row-zero:hover { background: rgba(80, 130, 200, 0.10); }
.data-table tr.row-mine { background: rgba(200, 85, 61, 0.08); }
.data-table tr.row-mine:hover { background: rgba(200, 85, 61, 0.14); }

/* 品质标签 */
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 2px; font-weight: 500;
}
.tag-blue { background: #e1edfa; color: #2e6cb8; }
.tag-purple { background: #ece1f5; color: #6b3aa3; }
.tag-orange { background: #f8e3dd; color: var(--accent); }
.tag-blue { background: #e0eaf5; color: #2e5a9c; }
.tag-green { background: #def0e3; color: #2a7a3b; }
.suggest-cut { color: var(--accent); font-weight: 600; }
.status-pill {
  display: inline-block; padding: 1px 6px; font-size: 11px;
  background: var(--gray); color: var(--ink-soft); border-radius: 2px;
}

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  z-index: 40; opacity: 0; transition: opacity .2s;
}
.drawer-mask.open { opacity: 1; }
.drawer-mask[hidden] { display: none; }

.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 460px;
  max-width: 92vw; background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -4px 0 16px rgba(0,0,0,0.08);
  transform: translateX(100%); transition: transform .25s ease;
  z-index: 50; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer[hidden] { display: none; }
.drawer__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.drawer__head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.drawer__close {
  appearance: none; background: transparent; border: 0;
  font-size: 24px; line-height: 1; color: var(--muted);
  cursor: pointer; padding: 0 4px;
}
.drawer__close:hover { color: var(--ink); }
.drawer__body { padding: 20px; overflow-y: auto; flex: 1; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.qr-area {
  border: 1px solid var(--line); padding: 16px; margin: 12px 0;
  min-height: 220px; display: grid; place-items: center;
  color: var(--muted); background: #fff;
}
.qr-area img { max-width: 200px; image-rendering: pixelated; }
.status-line {
  font-size: 13px; color: var(--ink-soft); padding: 8px 12px;
  background: var(--gray); border-left: 3px solid var(--line); min-height: 1.4em;
}
.status-line.error { color: var(--accent); border-left-color: var(--accent); }
.status-line.success { color: #2a7a3b; border-left-color: #2a7a3b; }
.asset-section { margin-bottom: 18px; }
.asset-section h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink); }
.asset-grid { display: grid; grid-template-columns: 1fr auto; border-top: 1px solid var(--line-soft); }
.asset-grid div { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
.asset-grid .num { color: var(--ink-soft); }

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
}
.admin-single { max-width: none; }
.admin-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-form input,
.admin-form select { min-width: 140px; }
.admin-inline-field {
  display: flex;
  flex: 1 1 150px;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}
.admin-inline-field span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}
.admin-inline-field input {
  box-sizing: border-box;
  width: 100%;
}
.admin-inline-field--number {
  flex: 0 1 150px;
}
.admin-passcode-form {
  align-items: flex-end;
}
.admin-account-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 8px;
}
.admin-account-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.admin-account-filters input,
.admin-account-filters select {
  height: 32px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  padding: 0 8px;
}
.admin-account-filters input {
  min-width: 240px;
}
.admin-account-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.admin-account-pager select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.admin-account-pager .btn {
  padding: 4px 10px;
  font-size: 12px;
}
.admin-account-page-note {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 8px;
}
.admin-account-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  background: #fff;
}
.admin-account-table {
  min-width: 980px;
  table-layout: fixed;
}
.admin-account-table th:first-child,
.admin-account-table td:first-child { width: 42px; text-align: center; }
.admin-account-table th:nth-child(2) { width: 150px; }
.admin-account-table th:nth-child(3) { width: 150px; }
.admin-account-table th:nth-child(4) { width: 190px; }
.admin-account-table th:nth-child(5) { width: 120px; }
.admin-account-table th:nth-child(6) { width: 110px; }
.admin-account-table th:nth-child(7) { width: 300px; }
.admin-account-table td {
  overflow-wrap: anywhere;
}
.admin-cell-main {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-cell-sub,
.admin-muted,
.admin-warn {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.admin-warn { color: var(--accent); }
.admin-code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.admin-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-row-actions .btn {
  font-size: 11px;
  padding: 4px 8px;
  white-space: nowrap;
}
.admin-row-actions input {
  width: 64px;
  min-width: 64px;
  padding: 4px 6px;
  font-size: 11px;
}
.admin-row-actions .danger-lite {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .sidebar {
    position: static; width: 100%; height: auto; flex-direction: row;
    flex-wrap: wrap; gap: 8px; padding: 12px; align-items: flex-start;
  }
  .sidebar__brand { width: 100%; border-bottom: 0; padding-bottom: 0; }
  .sidebar__sep { display: none; }
  .sidebar-primary-menu { width: 100%; flex-direction: row; }
  .sidebar-primary-item { flex: 1; }
  .sidebar-subtabs { width: 100%; padding-left: 0; border-left: 0; }
  .sidebar__tabs { flex-direction: row; flex-wrap: wrap; }
  .sidebar__actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .sidebar__actions .btn {
    width: 100%;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .sidebar__foot { width: 100%; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); }
  .main { margin-left: 0; }
  .status-bar { grid-template-columns: 1fr; gap: 12px; padding: 12px 16px; }
  .status-bar__rank { text-align: left; }
  .tab-panel { padding: 16px; }
  .drawer { width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }
}

/* 任务表整行可点击勾选（提升可用性） */
.task-row-clickable {
  cursor: pointer;
  transition: background 0.08s ease;
}
.task-row-clickable:hover {
  background: rgba(225, 200, 130, 0.18);
}
.task-row-selected,
.task-row-selected:hover {
  background: rgba(46, 125, 50, 0.16) !important;
}
.task-row-clickable .task-select {
  cursor: pointer;
  transform: scale(1.15);
}

/* 「我能完成」的空闲任务：任务名走 Claude 式玻璃反光流光 + 暖金高亮，整行淡金底色 */
.task-row.task-doable {
  background: linear-gradient(90deg, rgba(212, 160, 40, 0.10), rgba(212, 160, 40, 0.03));
}
.task-row.task-doable:hover {
  background: linear-gradient(90deg, rgba(212, 160, 40, 0.18), rgba(212, 160, 40, 0.06)) !important;
}
.task-row.task-guild-doable {
  background: linear-gradient(90deg, rgba(46, 125, 50, 0.10), rgba(46, 125, 50, 0.03));
}
.task-doable-text {
  font-weight: 700;
  color: #b8860b; /* 不支持 background-clip:text 时的兜底色 */
  background: linear-gradient(100deg, #b8860b 0%, #d4a017 35%, #fff4cf 50%, #d4a017 65%, #b8860b 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: task-text-shine 2.8s linear infinite;
}
@keyframes task-text-shine {
  to { background-position: -200% center; }
}
@media (prefers-reduced-motion: reduce) {
  .task-doable-text { animation: none; }
}
.help-accept-item:hover {
  background: var(--paper-2) !important;
}

.guide-mask {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(18,16,14,.10);
  pointer-events: auto;
}
.guide-highlight {
  position: fixed;
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(18,16,14,.18), 0 0 0 5px rgba(200,85,61,.35);
  transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease;
  pointer-events: none;
}
.guide-target { position: relative; z-index: 100001 !important; }
.guide-card {
  position: fixed;
  width: min(300px, calc(100vw - 32px));
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0,0,0,.28);
  padding: 16px;
}
.guide-card h3 { margin: 0 0 8px; font-size: 16px; }
.guide-card p { margin: 0; color: var(--ink-soft); line-height: 1.6; font-size: 13px; }
.guide-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* 左侧导航底部：守护连接卡 */
.guard-card {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper-2);
  font-size: 12px;
  line-height: 1.6;
}
.guard-card--ok {
  border-color: rgba(42, 122, 59, .35);
  background: #f4fbf6;
}
.guard-card--bad {
  border-color: rgba(200, 85, 61, .45);
  background: #fff6f3;
}
.guard-card--idle {
  background: var(--paper-2);
}
.guard-card__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-bottom: 4px;
}
.guard-status-help {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font: 700 11px/1 var(--font);
  cursor: help;
}
.guard-status-help:hover,
.guard-status-help:focus-visible {
  color: var(--ink);
  border-color: var(--accent-soft);
  outline: none;
}
.guard-status-help:hover::after,
.guard-status-help:focus-visible::after {
  content: attr(data-tooltip);
  position: fixed;
  left: 16px;
  bottom: 52px;
  z-index: 30;
  width: max-content;
  max-width: min(260px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.65;
  text-align: left;
  white-space: normal;
}
.guard-card__identity {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}
.guard-card__expiry {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.guard-card__meta {
  color: var(--muted);
  font-size: 11px;
}
.guard-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #aaa;
}
.guard-dot.online       { background: #2a7a3b; box-shadow: 0 0 6px rgba(46,125,50,0.6); }
.guard-dot.connecting   { background: #1565c0; }
.guard-dot.kicked,
.guard-dot.token_expired{ background: var(--accent); }
.guard-dot.disconnected,
.guard-dot.stopped      { background: #888; }
.guard-dot.error        { background: #c62828; }

/* 配置 Tab 通用 */
.cfg-switch {
  display: inline-flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--paper); cursor: pointer; line-height: 1.4; font-size: 13px;
}
.cfg-switch input { margin-top: 2px; }
.cfg-switch:hover { background: var(--paper-2); }

/* 筛选芯片：复选框 + 标题 + 说明，选中态高亮，彼此独立可区分 */
.filter-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); cursor: pointer; line-height: 1.25;
  transition: background .15s, border-color .15s;
}
.filter-chip:hover { background: var(--paper-2); border-color: var(--accent-soft); }
.filter-chip input { margin: 0; flex: none; }
.filter-chip__text { display: inline-flex; flex-direction: column; }
.filter-chip__text b { font-size: 12px; font-weight: 600; }
.filter-chip__text small { font-size: 10px; color: var(--muted); }
.filter-chip:has(input:checked) {
  background: var(--accent-soft); border-color: var(--accent);
}
.filter-chip:has(input:checked) .filter-chip__text small { color: var(--ink); }
.filter-chip[hidden] { display: none; }

/* 仅会长可见的 tab，前端 JS 根据 role 动态切换 display */
.tab-btn.tab-admin-only { display: none; }
body.is-admin .tab-btn.tab-admin-only { display: block; }
.admin-backend-only[hidden] { display: none; }

/* 顺位选择行 */
.tier-row {
  display: flex; align-items: center; padding: 6px 10px;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.tier-row:hover { background: var(--paper-2); }
.tier-row .tier-score { font-weight: 600; color: var(--accent); min-width: 50px; }
.tier-row .tier-desc { flex: 1; padding: 0 12px; }
.tier-row .tier-radios { display: flex; gap: 6px; }
.tier-radios label {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border: 1px solid var(--border); border-radius: 4px;
  cursor: pointer; font-size: 12px;
}
.tier-radios input { margin: 0; }
.tier-radios label.t1 { color: #c62828; }
.tier-radios label.t2 { color: #ef6c00; }
.tier-radios label.t3 { color: #1565c0; }
.tier-radios label.selected { background: currentColor; }
.tier-radios label.selected b { color: white; }

/* ---------- 右上角「支持作者」常驻小 icon ---------- */
/* 复用「我能完成」任务名的暖金玻璃流光：同一套高亮语言，避免出现第二种样式。 */
.support-fab {
  position: fixed; top: 14px; right: 18px; z-index: 90;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 250, 235, 0.92), rgba(245, 238, 220, 0.86));
  box-shadow: 0 4px 14px rgba(200, 85, 61, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer; font: inherit; font-size: 12px; font-weight: 700;
  color: #b8860b; line-height: 1;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.support-fab:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(200, 85, 61, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.support-fab__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 999px;
  background: rgba(200, 85, 61, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 12px;
}
/* 文字走和任务高亮完全一致的暖金流光 */
.support-fab__text {
  font-weight: 800;
  color: #b8860b;
  background: linear-gradient(100deg, #b8860b 0%, #d4a017 35%, #fff4cf 50%, #d4a017 65%, #b8860b 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: task-text-shine 2.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .support-fab__text { animation: none; }
}

/* 支持作者弹窗 */
.support-modal {
  position: fixed; inset: 0; z-index: 100010;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(26, 26, 26, 0.45);
}
.support-modal[hidden] { display: none; }
.support-modal__card {
  width: min(360px, 92vw);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.support-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 16px;
  background: var(--accent); color: #fff;
}
.support-modal__head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.support-modal__close {
  appearance: none; border: 0; cursor: pointer;
  width: 28px; height: 28px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22); color: #fff;
  font-size: 18px; line-height: 1;
}
.support-modal__close:hover { background: rgba(255, 255, 255, 0.34); }
.support-modal__body { padding: 16px 18px 18px; text-align: center; }
.support-modal__tip {
  font-size: 13px; line-height: 1.65; color: var(--ink-soft);
  font-weight: 600; margin: 0 0 12px;
}
.support-modal__qr {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 12px;
}
.support-modal__qr img { display: block; width: 100%; height: auto; border-radius: 6px; }
.support-modal__hint { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 10px 0 0; }
.support-modal__mail {
  font-size: 12px; color: var(--ink-soft); line-height: 1.6;
  margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line);
}
.support-modal__mail a { color: var(--accent); font-weight: 700; word-break: break-all; }
