:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card2: #273449;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #2563eb;
  --good: #16a34a;
  --bad: #dc2626;
  --warn: #d97706;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden { display: none !important; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.break { word-break: break-all; }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }

/* 登录页 */
.auth-wrap { padding: 18vh 22px 22px; max-width: 460px; margin: 0 auto; }
.logo { font-size: 21px; margin: 0 0 6px; text-align: center; }
.sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 26px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: 15px;
}
.tab.active { background: var(--card); color: var(--text); border-color: var(--primary); }
.form { display: flex; flex-direction: column; gap: 12px; }

input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 15px;
}
input[type="checkbox"] { width: auto; }
input[type="time"] { max-width: 150px; }

button { font-size: 14px; border: none; border-radius: 10px; cursor: pointer; }
button:disabled { opacity: .45; }
.primary { background: var(--primary); color: #fff; padding: 12px; width: 100%; }
.primary.small { width: auto; padding: 8px 14px; }
.ghost { background: var(--card2); color: var(--text); padding: 9px 12px; border: 1px solid var(--line); }
.ghost.small { padding: 7px 11px; font-size: 13px; }
.ghost.danger { color: #fca5a5; }
.block { display: block; text-align: center; text-decoration: none; padding: 13px; border-radius: 10px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(15, 23, 42, .95); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; }
.who { margin-left: auto; color: var(--muted); font-size: 13px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding: 12px 14px 40px; max-width: 760px; margin: 0 auto; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head button { margin-left: auto; }

.row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.row > span { flex: none; color: var(--muted); font-size: 13px; }
.row > input { margin-left: auto; }

.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.stat-row:last-child { margin-bottom: 0; }
.stat {
  flex: 1 1 calc(50% - 8px); min-width: 96px;
  background: var(--card2); border-radius: 10px; padding: 10px 12px;
}
.stat b { display: block; font-size: 19px; }
.stat span { color: var(--muted); font-size: 12px; }

/* 账号卡片 */
.list { display: flex; flex-direction: column; gap: 10px; }
.account { background: var(--card2); border-radius: 12px; padding: 12px; }
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-head b { font-size: 15px; margin-right: 8px; }
.account-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 4px; font-size: 13px; color: var(--muted); }
.account-meta b { color: var(--text); }

.pill { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--line); white-space: nowrap; }
.pill.good { background: rgba(22, 163, 74, .18); color: #4ade80; }
.pill.bad { background: rgba(220, 38, 38, .18); color: #fca5a5; }
.pill.muted { background: rgba(148, 163, 184, .16); color: var(--muted); }

.tasks { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.task { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.task-name { flex: none; width: 62px; color: var(--muted); }
.task-msg { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* 弹窗与提示 */
.modal { position: fixed; inset: 0; background: rgba(2, 6, 23, .72); display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 20; }
.modal-box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; width: 100%; max-width: 460px; max-height: 82vh; overflow: auto; }
.modal-box h3 { margin: 0 0 8px; font-size: 16px; }
.modal-box .primary, .modal-box .ghost { margin-top: 12px; }
.modal-box .ghost { width: 100%; }

.toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 40;
  background: #0b1220; border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 999px; font-size: 13.5px; max-width: 88vw;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
