:root {
  /* 参考登录卡：深蓝主色 + 冷灰底 + 浅输入底 */
  --bg: #f9fafb;
  --bg-soft: #f3f4f6;
  --card: #ffffff;
  --text: #0a1128;
  --muted: #6b7280;
  --accent: #1a36a8;
  --accent-press: #142a86;
  --accent-soft: #eef1fb;
  --link: #2563eb;
  --fill: #f3f4f6;
  --fill-press: #e5e7eb;
  --line: #e5e7eb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --ok: #16a34a;
  --ok-soft: #f0fdf4;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-ctrl: 12px;
  --touch: 48px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --ease: ease;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(16px + var(--safe-top)) 14px calc(28px + var(--safe-bottom));
}

/* Header */
.header {
  margin-bottom: 14px;
  padding: 4px 2px 2px;
}
.brand {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--text);
}
.sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* Cards */
.card {
  background: var(--card);
  border: 0;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  /* 只用 min-width 收束 flex 溢出；勿设 overflow-x:clip/hidden，
     否则 overflow-y 会被算成 auto，部分移动端会拦住整页滚动 */
  min-width: 0;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.subh {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Stats */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 14px;
}

.hx-rank-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 6px 0 10px;
  width: 100%;
}
.hx-rank-row .stat {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border-radius: 10px;
}
.hx-rank-row .stat-val {
  font-size: 16px;
}
.hx-rank-row .stat-lab {
  margin-top: 2px;
  font-size: 10px;
}
.hx-rank-row > button {
  flex: 0 0 auto;
  width: auto;
  min-width: auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}

.mod-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  min-width: 0;
  max-width: 100%;
}
.mod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.mod-head h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.mod-head > .mini {
  flex-shrink: 0;
}
.mod-status {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.mod-status.ok {
  color: #1c7c3a;
  background: var(--ok-soft);
}
.mod-status.err {
  color: #b42318;
  background: var(--danger-soft);
}
.mod-status-row .mini {
  flex-shrink: 0;
  width: auto;
  max-width: none;
}

.delay-row.auto-settings-row {
  margin: 0;
  padding: 8px 10px;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}
.delay-row.auto-settings-row .check-inline {
  margin: 0;
  color: var(--text);
  flex-shrink: 0;
  gap: 5px;
  font-size: 12px;
}
.delay-row.auto-settings-row input[type="number"] {
  width: 40px;
  min-height: 32px;
  padding: 4px 4px;
  flex-shrink: 0;
  font-size: 13px;
  background: var(--card);
  border-radius: 8px;
}
.delay-row.auto-settings-row > span {
  flex-shrink: 0;
  white-space: nowrap;
}
.delay-row.auto-settings-row .auto-log-view {
  width: auto;
  margin: 0 0 0 auto;
  flex-shrink: 0;
  min-height: 32px;
  padding: 6px 10px;
}
.delay-row.auto-settings-row .auto-log-view.hidden {
  display: none !important;
}
.multi-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 0 10px;
  min-width: 0;
  max-width: 100%;
}
.multi-toolbar .mini {
  width: auto;
  margin: 0;
  padding: 6px 10px;
  flex-shrink: 0;
}
.multi-toolbar #btnMultiHxToggle.hidden {
  display: none !important;
}
.multi-list {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  max-height: 50vh;
  overflow: auto;
  min-width: 0;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.multi-acc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  min-width: 0;
  max-width: 100%;
}
.multi-acc-row .multi-acc-run {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
  overflow: hidden;
  gap: 8px;
}
.multi-acc-row .multi-acc-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-acc-row .multi-acc-hx {
  flex-shrink: 0;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  gap: 5px;
}
.multi-acc-row .multi-acc-hx.is-disabled {
  opacity: 0.45;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  white-space: nowrap;
}

.hx-read-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  width: 100%;
}
.hx-read-toolbar > button {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.hx-read-toolbar .hx-read-times-inner {
  flex: 0 0 auto;
  margin: 0;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}
.hx-read-toolbar .hx-read-times-inner input {
  width: 52px;
}
.hx-read-mode {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px 8px;
  margin: 4px 0 10px;
  padding: 8px 10px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  width: 100%;
  box-sizing: border-box;
}
.hx-read-mode-lab {
  font-size: 13px;
  color: var(--muted, #6b7280);
  flex: 0 0 auto;
}
.hx-read-mode .check-inline {
  flex: 1 1 0;
  justify-content: center;
  margin: 0;
  padding: 4px 2px;
  font-size: 13px;
  min-width: 0;
}
.stat {
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 12px 4px;
  text-align: center;
  min-width: 0;
  border: 0;
}
.stat-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-val:is(:empty, [data-empty="1"]),
.stat-val.stat-empty {
  color: var(--muted);
  font-weight: 500;
  opacity: 0.55;
}
.stat-lab {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

/* Forms */
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}
.hint { font-weight: 400; color: var(--muted); }
.hint-block {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: var(--touch);
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-ctrl);
  background: var(--bg-soft);
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(26, 54, 168, 0.45);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(26, 54, 168, 0.12);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 12px;
  min-height: 40px;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.login-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 4px 0 18px;
  justify-content: center;
  align-items: center;
}
.login-options .check {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  min-height: 32px;
}

.alert-err {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}
.alert-err.is-hidden,
.alert-err[hidden] {
  display: none;
}
.field-err {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--danger);
  line-height: 1.35;
}
.field-err[hidden] {
  display: none;
}
.field.is-invalid input[type="text"],
.field.is-invalid input[type="password"] {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.field.is-invalid input[type="text"]:focus,
.field.is-invalid input[type="password"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

/* Buttons */
button {
  width: 100%;
  min-height: var(--touch);
  border: 0;
  border-radius: var(--radius-ctrl);
  padding: 12px 16px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.12s ease;
}
button:active:not(:disabled) { background: var(--accent-press); opacity: 0.92; }
button:disabled { opacity: 0.38; cursor: not-allowed; }
button.ghost {
  background: var(--fill);
  color: var(--text);
  box-shadow: none;
  font-weight: 600;
}
button.ghost:active:not(:disabled) {
  background: var(--fill-press);
  box-shadow: none;
  opacity: 0.92;
}
button.mini {
  width: auto;
  min-height: 34px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 980px;
}
/* 文字链按钮：切换 / 刷新 */
button.btn-text {
  width: auto;
  min-width: 0;
  min-height: 36px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--link);
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
  white-space: nowrap;
}
button.btn-text:active:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  opacity: 1;
}
button.btn-text:disabled {
  opacity: 0.4;
  color: var(--muted);
}
/* 已完成任务按钮：灰底弱化，不用大蓝块 */
button.btn-done,
button.btn-done:disabled {
  background: var(--fill) !important;
  color: var(--muted) !important;
  opacity: 1;
  box-shadow: none;
  font-weight: 600;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}
.actions:has(> :only-child) {
  grid-template-columns: 1fr;
}
.actions.actions-one {
  grid-template-columns: 1fr;
}
.actions.auto-main-actions {
  margin: 4px 0 10px;
  gap: 10px;
}
.actions.auto-main-actions:has(#btnAutoMulti.hidden),
.actions.auto-main-actions.auto-main-solo {
  grid-template-columns: 1fr;
}
.actions.auto-main-actions button {
  min-height: 48px;
  font-size: 16px;
  letter-spacing: -0.02em;
  border-radius: 14px;
}
.actions.auto-main-actions button.ghost {
  background: var(--fill);
  color: var(--text);
  box-shadow: none;
}
.actions.auto-main-actions button.ghost:active:not(:disabled) {
  background: var(--fill-press);
}
.home-mod-split {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 2px 14px;
  min-width: 0;
}
.home-mod-split-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.home-mod-split p {
  margin: 0;
  flex-shrink: 0;
  max-width: 78%;
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.actions.train-main-actions {
  grid-template-columns: 1fr 1fr;
  margin: 4px 0 8px;
  gap: 10px;
}
.actions.train-main-actions button {
  min-height: 48px;
  font-size: 15px;
  letter-spacing: -0.02em;
  border-radius: 14px;
}
.train-sub-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  min-width: 0;
}
.train-sub-actions .btn-text {
  min-width: auto;
  padding: 6px 2px;
  font-size: 13px;
}
.train-sub-actions .train-stop {
  color: var(--danger);
}
.list-item.train-item-run {
  cursor: pointer;
}
.list-item.train-item-loading {
  opacity: 0.72;
  cursor: wait;
}
.list-item.train-item-loading .badge {
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
}
.train-sub-actions .train-stop:disabled {
  color: var(--muted);
  opacity: 0.55;
}

.delay-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.delay-row input[type="number"] {
  width: 68px;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
}

.home-card-identity {
  position: relative;
  z-index: 30;
  overflow: visible;
}
.home-card-stats {
  position: relative;
  z-index: 1;
  padding-top: 10px;
  padding-bottom: 10px;
}
.home-card-stats .stat-row {
  margin: 0;
  gap: 6px;
  width: 100%;
}
.home-card-stats .stat {
  padding: 6px 4px;
  border-radius: 10px;
}
.home-card-stats .stat-val {
  font-size: 16px;
}
.home-card-stats .stat-lab {
  margin-top: 2px;
  font-size: 10px;
}
.home-card-auto {
  padding-top: 14px;
}
.home-card-auto .auto-main-actions {
  margin-top: 0;
}
.auto-run-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  min-width: 0;
  cursor: pointer;
}
.auto-run-status.hidden {
  display: none !important;
}
.auto-run-status.is-wait {
  background: var(--fill);
  color: var(--muted);
}
.auto-run-status.is-ok {
  background: var(--ok-soft);
  color: #1c7c3a;
}
.auto-run-status.is-err {
  background: var(--danger-soft);
  color: var(--danger);
}
.auto-run-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}
.auto-run-status-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auto-run-status .auto-run-stop {
  flex-shrink: 0;
  margin: 0;
  padding: 0 2px;
  min-width: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}
.auto-run-status .auto-run-stop.hidden {
  display: none !important;
}
.home-card-identity .home-top {
  margin-bottom: 0;
}
.hx-rank-row > button.btn-text {
  align-self: stretch;
  min-width: auto;
  padding: 0 12px;
}
.hx-rank-mine {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: 12px;
  font-size: 13px;
  color: var(--muted);
}
.hx-rank-mine strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
.hx-rank-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(58vh, 480px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 4px;
  min-height: 120px;
}
.hx-rank-list .hx-rank-empty,
.hx-rank-list .hx-rank-loading,
.hx-rank-list .hx-rank-error {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.hx-rank-list .hx-rank-error {
  color: var(--danger);
}
.hx-rank-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  background: var(--fill);
  border-radius: 12px;
}
.hx-rank-item .hx-rank-no {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg-soft);
  font-variant-numeric: tabular-nums;
}
.hx-rank-item.top1 .hx-rank-no {
  color: #fff;
  background: #e6b422;
}
.hx-rank-item.top2 .hx-rank-no {
  color: #fff;
  background: #9aa3af;
}
.hx-rank-item.top3 .hx-rank-no {
  color: #fff;
  background: #c47a3a;
}
.hx-rank-item .hx-rank-meta {
  min-width: 0;
}
.hx-rank-item .hx-rank-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hx-rank-item .hx-rank-dept {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hx-rank-item .hx-rank-score {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.home-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 2px;
}
.portal-brief {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.portal-brief strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  line-height: 1.25;
}
.role-admin,
.role-user {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 999px;
}
.role-admin {
  color: var(--accent);
  background: var(--accent-soft);
}
.role-user {
  color: #5b6570;
  background: #e8ebef;
}
.brief { font-size: 14px; }
.brief strong { font-weight: 600; }
.brief .hint {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.user-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.user-line-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
a.shell-nav-link.is-active {
  color: var(--text) !important;
  background: var(--fill-press) !important;
  font-weight: 600;
}
.shell-top-card {
  overflow: visible;
}

/* 我的 / 设置 */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.force-pwd-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
body.is-force-pwd #pwdModal .modal-close,
body.is-force-pwd #pwdModal [data-close-pwd] {
  display: none !important;
}
body.is-force-pwd #pwdModal .modal-backdrop {
  pointer-events: none;
}
body.is-force-pwd #pwdModal .actions {
  grid-template-columns: 1fr;
}
.settings-group-title {
  margin: 0 0 8px;
  padding: 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.settings-group-card {
  padding: 0;
  overflow: hidden;
}
.settings-cell-list {
  display: flex;
  flex-direction: column;
}
.settings-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.settings-cell:last-child {
  border-bottom: 0;
}
a.settings-cell {
  display: flex;
}
.settings-cell:hover,
.settings-cell:active {
  background: var(--fill) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
.settings-cell-lab {
  flex: 1;
  min-width: 0;
}
.settings-cell-meta {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.settings-cell-arrow {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  opacity: 0.7;
}
.settings-cell-static {
  cursor: default;
}
.settings-cell-static:hover,
.settings-cell-static:active {
  background: transparent !important;
}
.settings-cell-danger {
  justify-content: center;
  color: var(--danger) !important;
  font-weight: 600;
}
.settings-cell-danger:hover,
.settings-cell-danger:active {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}
.settings-group-note {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.settings-nav-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
}
.settings-nav-chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  margin: 0;
  padding: 8px 6px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.settings-nav-chip input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.settings-nav-chip:has(input:not(:checked)) {
  color: var(--muted);
}
.account-empty .btn-link-block {
  margin-top: 8px;
}
.user-menu-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto !important;
  min-width: 0 !important;
  min-height: 32px !important;
  height: 32px;
  padding: 0 12px !important;
  border-radius: 980px !important;
  font-size: 13px;
  font-weight: 500;
  color: var(--text) !important;
  background: var(--fill) !important;
  box-shadow: none !important;
}

/* Logs — Apple 浅色等宽文本区，非深绿终端 */
.log {
  margin: 12px 0 0;
  padding: 12px 14px;
  max-height: 220px;
  overflow: auto;
  border-radius: 12px;
  background: var(--fill);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  -webkit-overflow-scrolling: touch;
  box-shadow: none;
}
.log.ok {
  background: var(--ok-soft);
  box-shadow: none;
}
.log.err {
  background: var(--danger-soft);
  box-shadow: none;
}
.log.log-modal {
  max-height: min(56vh, 480px);
  min-height: 220px;
  margin: 0 0 14px;
  padding: 14px 16px;
  background: #1c1c1e;
  color: #f2f2f7;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.6;
}
.log.log-modal.ok {
  box-shadow: inset 0 0 0 1px rgba(52, 199, 89, 0.35);
}
.log.log-modal.err {
  box-shadow: inset 0 0 0 1px rgba(255, 59, 48, 0.4);
}
#autoLogModal .modal-header h3,
#detailLogModal .modal-header h3 {
  font-size: 17px;
  letter-spacing: -0.02em;
}
#btnAutoStop.ghost {
  color: var(--danger);
  background: var(--danger-soft);
}
#btnAutoStop.ghost:active:not(:disabled) {
  background: #ffd4d1;
}
#autoLogModal .actions,
#detailLogModal .actions {
  margin-top: 0;
  margin-bottom: 0;
}

.account-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 12px;
  background: var(--fill);
  border-radius: 14px;
  overflow: visible;
}
.account-bar-head {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}
.account-switch-lab {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
  line-height: 1.45;
  padding-top: 1px;
}
.account-user-brief {
  flex: 1 1 12em;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}
.account-user-brief strong {
  color: var(--accent);
  font-weight: 600;
}
.account-user-brief .hint {
  display: inline;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
}
.account-switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.account-switch-row select {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  border: 1px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-bar .mini,
.account-bar .btn-text {
  flex-shrink: 0;
  width: auto;
  min-height: 40px;
}
.account-bar .mini {
  padding: 8px 14px;
  background: var(--card) !important;
  box-shadow: none !important;
  color: var(--accent) !important;
  font-weight: 600;
}
.account-bar .btn-text {
  padding: 8px 6px;
  background: transparent !important;
  color: var(--link) !important;
}
.account-bar.is-empty .account-switch-row {
  display: none;
}
.account-empty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  padding: 8px 4px 4px;
}
.account-empty.hidden { display: none !important; }
.account-empty-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.account-empty-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 28em;
}
.account-empty > button {
  width: 100%;
  margin: 6px 0 0;
  min-height: 44px;
}

/* Lists */
.list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}
.list-item {
  text-align: left;
  background: var(--fill);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  min-height: 48px;
  border-radius: 14px;
  box-shadow: none;
}
.list-item.green {
  /* 与 App 标绿题一致：浅绿色底，不跟全站主色走 */
  background: #e8f7ee;
  color: #0b6b3a;
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.22);
}
.list-item.gray {
  background: var(--fill);
  color: #8e8e93;
}
.list-item.done { opacity: 0.55; }
.list-item .badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: 4px;
  background: rgba(0, 0, 0, 0.05);
}
.list-item.green .badge {
  background: #16a34a;
  color: #fff;
}

.accounts-list { display: grid; gap: 6px; margin-bottom: 12px; }
.modal-card .accounts-list {
  max-height: min(55vh, 420px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
  padding-right: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal-card .accounts-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.acc-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: 12px;
}
.acc-row.is-default {
  background: var(--accent-soft);
}
.acc-row-sort {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.acc-row-sort .mini {
  min-height: 30px;
  min-width: 28px;
  padding: 4px 6px;
  font-size: 13px;
  line-height: 1;
}
.acc-row-sort .mini:disabled {
  opacity: 0.35;
}
.acc-row-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
  max-width: 100%;
}
.acc-row-actions .mini {
  min-height: 30px;
  min-width: 30px;
  padding: 4px 8px;
  font-size: 11px;
}
.acc-row-actions .mini:disabled {
  opacity: 0.35;
}
.danger-mini { color: var(--danger) !important; }
.hidden { display: none !important; }

code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 4px;
}

/* 弹窗打开时锁住底层页面滚动（含 iOS） */
body.modal-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

/* Modal — mobile bottom sheet */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  overscroll-behavior: none;
}
.modal.hidden { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  touch-action: none;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: min(480px, 100%);
  max-height: min(92vh, 920px);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  background: var(--card);
  border-radius: 14px 14px 0 0;
  padding: 18px 16px calc(16px + var(--safe-bottom));
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  -webkit-overflow-scrolling: touch;
}
.modal-wide { max-width: 480px; }

/* 后台通用提示 / 确认弹窗（紧凑、右对齐按钮，避免整行大按钮） */
.ui-dialog-modal {
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-dialog-card {
  width: min(360px, calc(100vw - 40px));
  max-width: min(360px, calc(100vw - 40px));
  border-radius: 16px !important;
  padding: 18px 18px 16px !important;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.16) !important;
}
.modal-dialog-card .modal-header {
  margin-bottom: 10px;
}
.modal-dialog-card .modal-header h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.ui-dialog-msg {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.announce-body {
  margin: 0 0 4px;
  max-height: min(50vh, 360px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  color: var(--text);
  font-size: 14px;
  -webkit-overflow-scrolling: touch;
}
.announce-date {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}
.ui-dialog-field {
  display: block;
  margin: 0 0 16px;
}
.ui-dialog-field.hidden {
  display: none !important;
}
.ui-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.ui-dialog-actions button {
  width: auto;
  min-width: 76px;
  min-height: 40px;
  padding: 8px 18px;
  font-size: 14px;
  border-radius: 10px;
  border: 0;
  outline: none;
  box-shadow: none;
}
.ui-dialog-actions button:focus,
.ui-dialog-actions button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 54, 168, 0.18);
}
.ui-dialog-actions button.ghost {
  background: var(--fill);
  color: var(--text);
}
.ui-dialog-actions button.ghost:active:not(:disabled) {
  background: var(--fill-press);
}
.ui-dialog-actions button.ghost:focus-visible {
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}
#uiDialogOk.danger-solid {
  background: var(--danger);
}
#uiDialogOk.danger-solid:active:not(:disabled) {
  background: #dc2626;
  opacity: 0.92;
}
#uiDialogOk.danger-solid:focus-visible {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
}
.admin-modal-list {
  max-height: min(55vh, 420px);
  overflow-y: auto;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.admin-modal-list .admin-acc-row {
  margin-bottom: 0;
}

/* 后台表单弹窗底部按钮：右对齐紧凑（不影响前台答题页） */
body.admin-shell .modal-card > .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 16px 0 0;
}
body.admin-shell .modal-card > .actions button {
  width: auto;
  min-width: 88px;
  min-height: 40px;
  padding: 8px 18px;
  font-size: 14px;
  border-radius: 10px;
  outline: none;
  box-shadow: none;
}
body.admin-shell .modal-card > .actions button:focus,
body.admin-shell .modal-card > .actions button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 54, 168, 0.18);
}
body.admin-shell .modal-card > .actions.actions-one {
  justify-content: flex-end;
}
body.admin-shell .modal-card > .actions.actions-one button {
  min-width: 88px;
}
body.admin-shell .modal {
  align-items: center;
  padding: 20px;
}
body.admin-shell .modal-card {
  border-radius: 16px;
  padding: 20px 18px 16px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
}
.help-current-ver {
  margin: 0 0 16px;
}
.help-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 12px;
}
.help-page .help-card {
  margin-bottom: 0;
}
.help-page .help-title {
  margin: 0;
}
.help-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.help-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
a.user-menu-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
a.user-menu-btn.hidden {
  display: none !important;
}
a.btn-link-block {
  display: block;
  width: 100%;
  min-height: var(--touch);
  border-radius: var(--radius-ctrl);
  padding: 12px 16px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  box-sizing: border-box;
}
a.btn-link-block:active {
  background: var(--accent-press);
  opacity: 0.92;
}
.help-footer {
  margin-top: 8px;
  margin-bottom: 0;
}
.help-sec {
  margin: 0 0 18px;
}
.help-sec:last-child {
  margin-bottom: 0;
}
.help-sec h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.help-sec p {
  margin: 0 0 8px;
  color: var(--muted);
}
.help-sec ol,
.help-sec ul {
  margin: 0 0 8px;
  padding-left: 1.25em;
  color: var(--muted);
}
.help-sec li {
  margin: 0 0 6px;
}
.help-sec li:last-child {
  margin-bottom: 0;
}
.help-sec strong {
  color: var(--text);
  font-weight: 600;
}
.help-flow {
  margin: 0 0 12px !important;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent) !important;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  letter-spacing: 0.01em;
}
.help-disclaimer {
  margin-top: 4px;
  padding: 12px 14px;
  border-top: 0;
  border-radius: 12px;
  background: var(--bg-soft);
}
.help-disclaimer h4 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.help-disclaimer p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-header h3,
.modal-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.modal-header-actions > .ghost.mini {
  width: auto;
  min-width: 0;
  min-height: 32px;
  margin: 0;
  padding: 4px 10px;
  font-size: 13px;
}
.modal-close {
  background: var(--bg-soft) !important;
  color: var(--muted) !important;
  border: 0;
  width: 36px !important;
  min-height: 36px !important;
  height: 36px;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  flex-shrink: 0;
}
.modal-close:active { opacity: 0.7; }

/* Admin module tabs（对齐 ssc-tabs；主导航已迁入统一壳） */
.admin-module-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 14px;
}
.admin-module-tabs .ssc-tab {
  font-size: 14px;
}

.admin-panel h2 {
  margin: 0 0 2px;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.admin-panel .desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.admin-panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.admin-panel-head-actions > button {
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 4px 12px;
  font-size: 13px;
}
.admin-panel-head .subh {
  margin: 0;
  font-size: 15px;
}
.admin-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.admin-field-lab {
  display: block;
  line-height: 1.3;
}
.admin-field input,
.admin-field textarea,
.admin-field select {
  margin-top: 0;
  font-weight: 400;
}
.announce-head {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.announce-head h2 {
  margin: 0;
  margin-right: auto;
}
.announce-enable {
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
}
.announce-status {
  flex-shrink: 0;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}
.announce-status.is-on {
  color: var(--accent);
  background: var(--accent-soft);
}

.admin-search {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  margin-bottom: 12px;
  align-items: center;
}
.admin-search input {
  margin: 0;
  min-height: 40px;
}
.admin-search .mini {
  min-height: 40px;
  padding: 0 12px;
}

.admin-list {
  display: grid;
  gap: 10px;
}
.admin-list .hint-block,
.admin-list .admin-empty {
  margin: 0;
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 14px;
  background: var(--fill);
  border-radius: 14px;
}

.admin-user-row,
.admin-log-row,
.admin-acc-row {
  padding: 14px 16px;
  background: var(--fill);
  border-radius: 14px;
}
.admin-user-row.is-off {
  opacity: 0.72;
}
.admin-user-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.admin-user-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.admin-user-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.admin-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
}
.admin-pill.role-admin {
  margin: 0;
  color: var(--accent);
  background: var(--accent-soft);
}
.admin-pill.role-user {
  margin: 0;
  color: #5b6570;
  background: #e8ebef;
}
.admin-pill.status-on {
  color: var(--ok);
  background: #e8f7ee;
}
.admin-pill.status-off {
  color: var(--danger);
  background: var(--danger-soft);
}
.admin-count {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.admin-user-actions .mini {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
  width: auto;
}
.admin-user-actions .danger-mini {
  color: var(--danger) !important;
}

.admin-acc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-acc-title {
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}
.admin-acc-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-log-row {
  display: grid;
  gap: 6px;
}
.admin-log-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-log-action {
  font-size: 13px;
  font-weight: 600;
}
.admin-log-ip {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #e8ebef;
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}
.admin-log-meta {
  font-size: 12px;
  color: var(--muted);
}
.admin-log-detail {
  margin: 0;
  padding: 10px 12px;
  max-height: 120px;
  overflow: auto;
  border-radius: 10px;
  background: #1c1c1e;
  border: 0;
  color: #f2f2f7;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}
.admin-log-detail-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.admin-bound {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.admin-daylog-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px 12px;
  margin-bottom: 12px;
  align-items: end;
  flex-shrink: 0;
}
.admin-daylog-filters label {
  margin-bottom: 0;
}
.admin-daylog-filters select,
.admin-daylog-filters .admin-user-combo {
  margin-top: 6px;
  width: 100%;
}
.admin-daylog-user-field {
  grid-column: 1 / -1;
  position: relative;
  z-index: 2;
}
.admin-user-combo {
  position: relative;
}
.admin-user-combo input[type="search"] {
  width: 100%;
  margin: 0;
}
.admin-user-combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: min(40vh, 280px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.admin-user-combo-list.hidden,
.admin-user-combo-list[hidden] {
  display: none !important;
}
.admin-user-combo-list li {
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
  color: var(--text);
}
.admin-user-combo-list li:hover,
.admin-user-combo-list li.active {
  background: var(--accent-soft);
}
.admin-user-combo-list li.admin-user-combo-empty {
  color: var(--muted);
  cursor: default;
}
.admin-user-combo-list li.admin-user-combo-empty:hover {
  background: transparent;
}
.admin-daylog-query-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  justify-content: flex-end;
}
.admin-daylog-query-lab {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  height: 1.2em;
  visibility: hidden;
}
.admin-daylog-query-cell button {
  margin-top: 6px;
  width: auto;
  min-width: 88px;
  padding: 0 18px;
  min-height: var(--touch);
  white-space: nowrap;
}
.admin-daylog-acc {
  grid-column: 1 / -1;
}
#dayLogQueryModal .modal-card {
  display: flex;
  flex-direction: column;
  /* 固定高度，日志区才能 flex 占满剩余空间 */
  height: min(88vh, 820px);
  max-height: min(88vh, 820px);
  overflow: hidden;
  overscroll-behavior: contain;
}
#dayLogQueryModal .modal-header,
#dayLogQueryModal .hint-block,
#dayLogQueryModal .admin-daylog-filters {
  flex-shrink: 0;
}
/* 仅日志区滚动，覆盖 .log.log-modal 的 max-height，避免弹窗外层再出滚动条 */
#dayLogQueryModal .log.log-modal.admin-daylog-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 520px) {
  .admin-daylog-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .admin-daylog-user-field,
  .admin-daylog-acc {
    grid-column: 1 / -1;
  }
  /* 手机：近全屏底栏，日志区尽量大 */
  body.admin-shell #dayLogQueryModal.modal {
    align-items: flex-end;
    padding: 0;
  }
  #dayLogQueryModal .modal-card {
    width: 100%;
    max-width: 100%;
    height: min(92dvh, 920px);
    max-height: min(92dvh, 920px);
    border-radius: 14px 14px 0 0;
    padding-bottom: calc(12px + var(--safe-bottom));
  }
  #dayLogQueryModal .hint-block {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
  }
  #dayLogQueryModal .admin-daylog-filters {
    gap: 8px;
    margin-bottom: 8px;
  }
}
.pager {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
.pager button { width: auto; min-width: 88px; }

.login-version {
  margin-top: 24px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  user-select: none;
  opacity: 0.8;
}
body.login-page .page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 420px;
  padding-top: max(32px, var(--safe-top));
  padding-bottom: max(32px, var(--safe-bottom));
}
body.login-page .header {
  text-align: center;
  margin-bottom: 20px;
}
body.login-page .brand {
  font-size: 36px;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text);
}
body.login-page .sub {
  margin-top: 8px;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-weight: 400;
}
body.login-page .card {
  padding: 28px 22px 24px;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}
body.login-page label {
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
}
body.login-page input[type="text"],
body.login-page input[type="password"] {
  margin-top: 8px;
  min-height: 48px;
  font-size: 15px;
  background: var(--fill);
  border-radius: 12px;
  border: 1px solid transparent;
}
body.login-page input::placeholder {
  color: #9ca3af;
}
body.login-page button[type="submit"] {
  min-height: 48px;
  font-size: 16px;
  margin-top: 6px;
  letter-spacing: 0;
  border-radius: 12px;
  background: var(--accent);
}
body.login-page .login-options {
  justify-content: center;
  gap: 8px 28px;
  margin: 4px 0 18px;
}

/* Wider screens keep centered phone column */
@media (min-width: 640px) {
  .page { padding-top: 28px; padding-bottom: 40px; }
  .admin-module-tabs .ssc-tab { font-size: 14px; }
  .modal {
    align-items: center;
    padding: 20px;
  }
  .modal-card {
    border-radius: var(--radius);
    padding: 20px;
    max-height: 86vh;
  }
  .stat { padding: 14px 8px; }
  .stat-val { font-size: 22px; }
  .stat-lab { font-size: 11px; }
  body.login-page .brand { font-size: 40px; }
}

@media (max-width: 360px) {
  .brand { font-size: 24px; }
  body.login-page .brand { font-size: 30px; }
}

/* —— 随手查独立页 —— */
.ssc-page .ssc-top-card {
  margin-bottom: 12px;
}
.ssc-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.ssc-tab {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.ssc-tab.is-active {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
a.ssc-tab-link,
span.ssc-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}
a.ssc-tab-link:hover,
a.ssc-tab-link:active {
  color: var(--accent);
}
.ssc-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ssc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.ssc-lab {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ssc-req {
  color: var(--danger);
  font-weight: 700;
}
.ssc-field-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.ssc-form input[type="text"],
.ssc-form input[type="date"],
.ssc-form input[type="search"],
.ssc-form select,
.ssc-form textarea,
.ssc-list-toolbar input {
  width: 100%;
  min-height: var(--touch);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  background: var(--fill);
}
.ssc-form textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
}
.ssc-lab-with-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  width: 100%;
}
.ssc-lab-with-count .ssc-img-count {
  margin-left: auto;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ssc-form input[type="file"] {
  font-size: 13px;
  color: var(--muted);
}
.ssc-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ssc-preview-item {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-soft);
  display: block;
}
.ssc-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
button.ssc-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 400;
  opacity: 1;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
button.ssc-preview-remove:active:not(:disabled) {
  background: rgba(15, 23, 42, 0.8);
  opacity: 1;
}
button.ssc-preview-remove > span {
  position: relative;
  display: block;
  width: 11px;
  height: 11px;
}
button.ssc-preview-remove > span::before,
button.ssc-preview-remove > span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 1.5px;
  border-radius: 1px;
  background: #fff;
}
button.ssc-preview-remove > span::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
button.ssc-preview-remove > span::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.ssc-msg {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}
.ssc-msg.is-ok { color: var(--ok); }
.ssc-msg.is-err { color: var(--danger); }
.ssc-list-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ssc-list-toolbar-hint {
  margin: 0;
  flex: 1;
  color: var(--muted);
}
.ssc-list-toolbar input { flex: 1; }
.ssc-list-meta {
  margin: 0 0 8px;
  color: var(--muted);
}
.ssc-list-toolbar .ssc-list-meta {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.ssa-pager {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}
.ssc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
button.ssc-list-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--fill);
  color: var(--text);
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 400;
  min-height: 0;
}
button.ssc-list-item:active:not(:disabled) {
  background: var(--bg-soft);
  opacity: 1;
}
.ssc-list-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 8px;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}
.ssc-list-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}
.ssc-list-date {
  flex-shrink: 0;
}
.ssc-list-zg {
  flex-shrink: 0;
}
.ssc-list-zg.is-yes {
  color: #2563eb;
  font-weight: 600;
}
.ssc-list-zg.is-no {
  color: var(--muted);
}
.ssc-audit {
  margin-left: auto;
  font-weight: 600;
}
.ssc-audit.is-pending { color: #ea580c; }
.ssc-audit.is-pass { color: #16a34a; }
.ssc-audit.is-fail { color: var(--danger); }

.ssc-detail-card.modal-card,
.ssc-detail-card,
.ssc-detail-body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ssc-detail-card.modal-card::-webkit-scrollbar,
.ssc-detail-card::-webkit-scrollbar,
.ssc-detail-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.ssc-detail-card {
  max-height: min(92vh, 720px);
  display: flex;
  flex-direction: column;
}
.ssc-detail-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 2px 8px;
  flex: 1;
  min-height: 0;
}
.ssc-detail-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ssc-detail-row {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 8px 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  align-items: start;
}
.ssc-detail-lab {
  color: var(--muted);
  flex-shrink: 0;
}
.ssc-detail-val {
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
  min-width: 0;
}
.ssc-detail-section {
  margin-top: 8px;
  padding-top: 4px;
}
.ssc-detail-section-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  padding: 10px 4px 6px;
}
.ssc-detail-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 4px 12px;
}
.ssc-detail-photos img {
  width: 88px;
  height: 88px;
  max-width: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-soft);
  display: block;
  -webkit-touch-callout: default;
  touch-action: manipulation;
}
.ssc-detail-photo-ph {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  background: var(--bg-soft);
}

/* —— 随手查审核 —— */
.ssa-filter-card {
  margin-bottom: 12px;
}
.ssa-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ssa-filter-row input[type="search"] {
  flex: 1;
  min-width: 140px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  padding: 8px 12px;
  background: var(--fill);
}
.ssa-filter-row-local {
  margin-bottom: 4px;
}
.ssa-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.ssa-filter-field select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  padding: 8px 10px;
  background: var(--fill);
  color: var(--text);
}
.ssa-filter-hint {
  margin: 0;
  font-size: 12px;
}
.ssa-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--fill);
  padding: 12px 14px;
}
.ssa-list-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
button.ssa-btn-audit {
  width: auto;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
button.ssa-btn-audit:active:not(:disabled) {
  background: #dc2626;
  opacity: 0.95;
}
button.ssa-btn-view {
  width: auto;
  flex-shrink: 0;
}
.ssa-audit-form {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 4px;
}
.ssa-audit-form .ssc-field {
  margin: 0 0 10px;
}
.ssa-readonly-row {
  margin-bottom: 8px;
}

/* —— 兑换记录只读页 —— */
.redeem-page .ssc-top-card {
  margin-bottom: 12px;
}
.redeem-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.redeem-year-field {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  margin: 0;
}
.redeem-year-lab {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.redeem-year-field select {
  flex: 1;
  min-width: 0;
  max-width: 160px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctrl);
  background: var(--fill);
  color: var(--text);
}
.redeem-toolbar > .ghost.mini {
  flex-shrink: 0;
  width: auto;
}
.redeem-list {
  display: flex;
  flex-direction: column;
}
.redeem-empty {
  margin: 12px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.redeem-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.redeem-item:last-child {
  border-bottom: 0;
}
.redeem-item-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px;
}
.redeem-item-img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
}
.redeem-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.redeem-item-img-ph {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-soft), var(--fill));
}
.redeem-item-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.redeem-item-score {
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.redeem-item-date {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 党建答题 */
.djyl-list {
  display: grid;
  gap: 0;
}
.djyl-empty {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.djyl-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.djyl-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.djyl-pager.hidden {
  display: none !important;
}
.djyl-page-label {
  font-size: 13px;
  color: var(--muted);
  min-width: 4.5em;
  text-align: center;
}
.djyl-pager .mini:disabled {
  opacity: 0.35;
}
.djyl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.djyl-item.is-static {
  cursor: default;
}
.djyl-item.is-disabled {
  opacity: 0.72;
}
.djyl-item:last-child {
  border-bottom: 0;
}
.djyl-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.djyl-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.djyl-item-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.djyl-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  color: #fff;
  white-space: nowrap;
}
.djyl-badge.is-blue { background: #3b82f6; }
.djyl-badge.is-red { background: #ef4444; }
.djyl-badge.is-green { background: #16a34a; }
.djyl-badge.is-muted { background: #94a3b8; }
.djyl-modal-name {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 15px;
}
.djyl-modal-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
}
.djyl-modal-meta strong {
  font-weight: 700;
}

