/* 纯白主题：只有黑白灰，动效统一走动画 */
:root {
  --bg: #ffffff;
  --subtle: #fafafa;
  --line: #ededed;
  --line-strong: #dcdcdc;
  --text: #111111;
  --muted: #8f8f8f;
  --accent: #111111;
  --radius: 12px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease),
              color .16s var(--ease), transform .12s var(--ease);
}
button:hover { border-color: var(--text); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; transform: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #000; border-color: #000; }
button.sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
button.danger { border-color: var(--text); }
button.danger:hover { background: #f7f7f7; }

input, select, textarea {
  font: inherit;
  width: 100%;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .05);
}
textarea { min-height: 88px; resize: vertical; }

@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

.view-enter > * { animation: fade-up .26s var(--ease) both; }
.view-enter > *:nth-child(2) { animation-delay: .03s; }
.view-enter > *:nth-child(3) { animation-delay: .06s; }
.view-enter > *:nth-child(4) { animation-delay: .09s; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------- 外壳 ---------- */
.shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  width: 208px;
  flex: 0 0 208px;
  padding: 26px 16px 18px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
}

.brand { font-size: 15px; font-weight: 700; padding: 0 8px; letter-spacing: .2px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: #444;
  font-size: 13px;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav a:hover { background: var(--subtle); color: var(--text); }
.nav a.active { background: var(--text); color: #fff; }

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.sidebar-foot .who { font-size: 13px; padding: 0 8px; }
.sidebar-foot .who span { display: block; color: var(--muted); font-size: 12px; }
.sidebar-foot button { width: 100%; margin-top: 10px; }

.main { flex: 1; min-width: 0; padding: 30px 36px 56px; }
.main-inner { width: 100%; max-width: 1120px; margin: 0 auto; }

/* ---------- 排版 ---------- */
.page-title { font-size: 20px; font-weight: 700; margin: 0 0 18px; letter-spacing: .2px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  transition: border-color .18s var(--ease);
}
.card:hover { border-color: var(--line-strong); }
.card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.card h3 .sub { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; }
.stat:hover { border-color: var(--line-strong); }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 21px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.stat .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
tbody tr { transition: background .14s var(--ease); }
tbody tr:hover { background: var(--subtle); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tight th, table.tight td { padding: 6px 8px; }
table.tight th { font-size: 11px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

.row { display: flex; gap: 10px; align-items: flex-end; }
.row > * { flex: 1; min-width: 0; }
.row > .fixed { flex: 0 0 auto; }
.row.tight { gap: 8px; align-items: center; }
.row.tight > * { flex: 0 0 auto; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 34px 0; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #555;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
  background: #fff;
  white-space: nowrap;
}
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; border: 1px solid currentColor; }
.tag.ok::before { background: currentColor; }
.tag.danger::before { border-radius: 1px; }
.tag.warn::before { border-style: dashed; }

.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; border: 1px solid var(--line-strong); background: var(--subtle); }
.alert.error { border-color: var(--text); background: #fff; }
.alert.warn { border-style: dashed; }

/* ---------- 账号卡 ---------- */
.acc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; align-items: start; }
.acc {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 14px;
  background: #fff;
  animation: fade-in .2s var(--ease) both;
  transition: border-color .18s var(--ease);
}
.acc:hover { border-color: var(--line-strong); }
.acc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.acc-head .name { font-weight: 600; font-size: 14px; }
.acc-head .tel { color: var(--muted); font-size: 12px; }
.grow { flex: 1; }
.acc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.acc-grid .label { color: var(--muted); font-size: 11px; }
.acc-grid .v { font-size: 13px; font-weight: 600; }
.acc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; flex-wrap: wrap; }
.acc-foot .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.acc-note { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
  animation: fade-in .14s var(--ease) both;
}
.modal {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  animation: pop-in .2s var(--ease) both;
  max-height: 86vh;
  overflow-y: auto;
}
.modal.wide { max-width: 680px; }
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal p.lead { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 80;
  animation: slide-down .2s var(--ease) both;
  max-width: 80vw;
}
.toast.error { background: #fff; color: var(--text); border: 1px solid var(--text); }

/* ---------- 登录 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box { width: 100%; max-width: 340px; }
.auth-box h1 { font-size: 20px; margin: 0 0 4px; text-align: center; }
.auth-box .tip { color: var(--muted); font-size: 12px; text-align: center; margin: 0 0 22px; }

/* ---------- 小屏 ---------- */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    border-right: 0; border-bottom: 1px solid var(--line); padding: 16px 14px 12px;
  }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav a { padding: 6px 10px; }
  .sidebar-foot { display: flex; align-items: center; justify-content: space-between; border-top: 0; padding-top: 10px; }
  .sidebar-foot button { width: auto; margin-top: 0; }
  .main { padding: 18px 16px 40px; }
  .acc-list { grid-template-columns: 1fr; }
  .acc-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

/* 任务页「只跑一个号」：全局 select 是 width:100%，在 .row.tight（子项不伸缩）里会占满整格，
   把后面的「跑」按钮挤出单元格、被 .table-wrap 裁掉。让号码下拉让出位置。 */
.row.tight > select[data-acc] { flex: 1 1 0; min-width: 0; }
.row.tight > button[data-one] { white-space: nowrap; }

/* ---------- 卡券页 ---------- */
.kq-table td { vertical-align: top; }
.kq-table td.kq-op { white-space: normal; }
.kq-table td.kq-op .small { margin-top: 3px; }
.kq-rest { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.kq-rest summary { cursor: pointer; font-size: 12px; color: var(--muted); user-select: none; }
.kq-rest summary:hover { color: var(--text); }
.kq-rest[open] summary { margin-bottom: 8px; }
