:root {
  --bg: #0f1115;
  --bg-soft: #14171d;
  --card: #171a21;
  --card-2: #1d2129;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e9ecf3;
  --text-dim: #9aa3b2;
  --text-faint: #6b7484;
  --brand: #7c5cff;
  --brand-2: #5b7cfa;
  --ok: #34d399;
  --warn: #fbbf24;
  --warn-ink: #fcd34d;
  --danger: #f87171;
  --radius: 16px;
  --tabbar-h: 62px;
}

/* 浅色变量：手动切到「浅色」时套用，系统是浅色且没手动选时也套用 */
:root[data-theme="light"],
:root:not([data-theme]) {
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6f9;
    --bg-soft: #ffffff;
    --card: #ffffff;
    --card-2: #f2f4f8;
    --line: rgba(15, 17, 21, 0.08);
    --text: #14171d;
    --text-dim: #5a6373;
    --text-faint: #8b93a2;
    --warn-ink: #b45309;
  }
  :root:not([data-theme="dark"]) { color-scheme: light; }
}

/* 手动选「浅色」：不管系统是深色都强制浅色 */
:root[data-theme="light"] {
  --bg: #f5f6f9;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-2: #f2f4f8;
  --line: rgba(15, 17, 21, 0.08);
  --text: #14171d;
  --text-dim: #5a6373;
  --text-faint: #8b93a2;
  --warn-ink: #b45309;
}

/* 手动选「深色」：系统是浅色也保持深色 */
:root[data-theme="dark"] {
  color-scheme: dark;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100dvh; }

.hidden { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; }
.muted { color: var(--text-dim); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.wide { width: 100%; }
.error-text { color: var(--danger); font-size: 13px; margin: 8px 0 0; }

/* ---------- 登录 ---------- */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(124, 92, 255, 0.22), transparent 65%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 22px 22px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.75);
}

.brand { text-align: center; margin-bottom: 22px; }
.brand h1 { font-size: 26px; margin-top: 10px; }
.brand p { margin: 6px 0 0; color: var(--text-dim); font-size: 13px; }

.form { display: flex; flex-direction: column; gap: 8px; }
.form label { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }

input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus {
  border-color: rgba(124, 92, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

textarea { resize: vertical; }

.auth-switch {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

.link {
  background: none;
  border: none;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0 2px;
}

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--card-2);
  color: var(--text);
  transition: transform 0.08s, filter 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.985); }
.btn.primary {
  margin-top: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(124, 92, 255, 0.9);
}
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.ghost.wide { margin-top: 12px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-dim);
  cursor: pointer;
}

/* ---------- 主界面 ---------- */
.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 14px calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 14px;
}

.topbar-date { margin: 0; font-size: 19px; font-weight: 650; }
.topbar-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); }

.panel { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

/* 状态卡 */
.status-card {
  background:
    radial-gradient(520px 220px at 100% 0%, rgba(124, 92, 255, 0.16), transparent 70%),
    var(--card);
}

.status-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.16);
  color: #b7a6ff;
  border: 1px solid rgba(124, 92, 255, 0.3);
}
.pill.ok { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.3); }
.pill.idle { background: var(--card-2); color: var(--text-dim); border-color: var(--line); }

.status-time {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.status-note { margin: 10px 0 0; color: var(--text-dim); font-size: 13.5px; }

.status-photos { display: flex; gap: 10px; margin-top: 12px; }
.status-photos figure { margin: 0; flex: 1; }
.status-photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.status-photos figcaption { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .btn { margin-top: 0; }

/* 缩略图网格 */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.thumb-grid:empty::after {
  content: "还没有内容";
  color: var(--text-faint);
  font-size: 13px;
  grid-column: 1 / -1;
  padding: 6px 0;
}
.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-2);
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.thumb.note-only {
  display: grid;
  place-items: center;
  padding: 8px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  cursor: default;
  overflow: hidden;
}

/* 历史列表 */
.day-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.day-row:last-child { border-bottom: none; }
.day-row .day-date { min-width: 76px; }
.day-row .day-date b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.day-row .day-date span { font-size: 11.5px; color: var(--text-faint); }
.day-row .day-body { flex: 1; min-width: 0; }
.day-row .day-times { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.day-row .day-dur { font-weight: 650; color: var(--text); }
.day-row .day-note {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.day-thumbs { display: flex; gap: 6px; margin-top: 8px; }
.day-thumbs img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

/* 统计 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .k { font-size: 12px; color: var(--text-dim); }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--text-faint); margin-left: 2px; }

.heatmap-wrap {
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.heatmap-wrap::-webkit-scrollbar { display: none; }
.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 10px);
  grid-auto-columns: 10px;
  gap: 3px;
  width: max-content;
}
.heatmap i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--card-2);
  display: block;
}
.heatmap i[data-lv="1"] { background: rgba(124, 92, 255, 0.28); }
.heatmap i[data-lv="2"] { background: rgba(124, 92, 255, 0.48); }
.heatmap i[data-lv="3"] { background: rgba(124, 92, 255, 0.7); }
.heatmap i[data-lv="4"] { background: rgba(124, 92, 255, 0.92); }
.heatmap i[data-lv="5"] { background: #a48cff; }

.date-input { width: auto; padding: 6px 10px; font-size: 13px; }

/* 我的 */
.profile-card { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.profile-card h2 { font-size: 17px; }

.list-card { padding: 4px 0; display: flex; flex-direction: column; }
.row-btn {
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.list-card .row-btn:last-child { border-bottom: none; }
.row-btn.danger { color: var(--danger); }

/* 底部导航 */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  z-index: 40;
}
.tab {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-faint);
  font-size: 11px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--brand); }

/* 弹层 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
  padding: 0;
}
.modal-box {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 92dvh;
  overflow-y: auto;
  animation: slide-up 0.22s ease-out;
}
@keyframes slide-up { from { transform: translateY(14px); opacity: 0.6; } to { transform: none; opacity: 1; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-head h2 { font-size: 17px; }
#modal-form { display: flex; flex-direction: column; gap: 8px; }
#modal-form label { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }

.photo-picker { display: flex; flex-direction: column; gap: 10px; }
.picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  border: 1px dashed rgba(124, 92, 255, 0.45);
  border-radius: 14px;
  background: rgba(124, 92, 255, 0.07);
  color: #b7a6ff;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.preview { display: flex; gap: 8px; flex-wrap: wrap; }
.preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 20px;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  opacity: 1;
  transition: opacity 0.25s ease;
}
/* 缩略图放大时先糊一下，原图到位再淡入到清晰 */
.lightbox img:not(.fade) { filter: blur(6px); }
.lightbox img.fade { filter: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 24px);
  transform: translate(-50%, 12px);
  background: rgba(28, 32, 40, 0.96);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 90;
  max-width: 84vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 6px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  padding: 26px 10px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* 历史记录删除 */
.day-row { position: relative; }
.day-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: var(--card-2);
  color: var(--text-faint);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.day-del:hover { background: rgba(255, 92, 92, 0.16); color: var(--danger, #e5484d); }

/* 系统状态与备份 */
.status-list, .backup-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.status-list li, .backup-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--card-2);
}
.status-list b { font-weight: 600; }
.backup-list .bk-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.backup-list .bk-ops { display: flex; gap: 6px; flex-shrink: 0; }
.backup-list .bk-ops button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}
.backup-list .bk-ops button:hover { background: var(--card); color: var(--text); }
.backup-empty { color: var(--text-dim); }

/* 系统更新 */
.update-card .card-head { display: flex; align-items: center; justify-content: space-between; }
.update-card #update-version { cursor: pointer; }
.update-hint { margin: 6px 0 12px; }
.update-actions { display: flex; gap: 10px; }
.update-actions .btn { flex: 1; }
.update-log {
  margin: 12px 0 0;
  padding: 10px;
  max-height: 200px;
  overflow: auto;
  border-radius: 10px;
  background: var(--card-2);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- 今日目标 ---------- */
.goal-card .card-head { margin-bottom: 10px; }
.goal-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--card-2);
  overflow: hidden;
}
.goal-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  transition: width 0.4s ease;
}
.goal-bar i.done { background: linear-gradient(90deg, #34d399, #10b981); }
.goal-card #goal-hint { margin: 8px 0 0; }

/* ---------- 周报 / 月报 ---------- */
.seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.seg-btn {
  border: none;
  background: none;
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.seg-btn.active { background: var(--brand); color: #fff; }

.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.report-tile {
  background: var(--card-2);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
}
.report-tile .k { font-size: 11px; color: var(--text-dim); }
.report-tile .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.report-tile .v small { font-size: 10.5px; font-weight: 500; color: var(--text-faint); margin-left: 1px; }

.report-cmp { margin: 12px 0 2px; font-size: 12.5px; color: var(--text-dim); }
.report-cmp b.up { color: var(--ok); }
.report-cmp b.down { color: var(--danger); }
.report-best { margin: 4px 0 0; font-size: 12.5px; color: var(--text-dim); }

.week-bars {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  height: 96px;
  margin-top: 14px;
  align-items: flex-end;
}
.week-bar { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.week-track {
  flex: 1;
  width: 60%;
  max-width: 18px;
  background: var(--card-2);
  border-radius: 999px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.week-track i {
  display: block;
  width: 100%;
  min-height: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.week-track i.zero { opacity: 0.25; }
.week-bar span { font-size: 10px; color: var(--text-faint); }

.place-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.place-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.report-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }

/* ---------- 成就 ---------- */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.ach {
  display: flex;
  gap: 8px;
  padding: 9px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  opacity: 0.55;
}
.ach.on {
  opacity: 1;
  border-color: rgba(124, 92, 255, 0.35);
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.12), var(--card-2));
}
.ach-badge {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  color: var(--text-faint);
  font-size: 15px;
}
.ach.on .ach-badge { color: #d9ccff; background: rgba(124, 92, 255, 0.25); }
.ach-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ach-info b { font-size: 12.5px; }
.ach-info span { font-size: 10.5px; color: var(--text-dim); }
.ach-info em { font-style: normal; font-size: 10px; color: var(--text-faint); }
.ach-prog { height: 4px; border-radius: 999px; background: var(--card); overflow: hidden; margin: 3px 0; }
.ach-prog i { display: block; height: 100%; background: var(--brand); }

/* ---------- 手动补卡 ---------- */
#manual-form { display: flex; flex-direction: column; gap: 8px; }
#manual-form label { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- 一天多段：分段列表 ---------- */
.seg-list { display: flex; flex-direction: column; gap: 8px; }

.seg-row {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.seg-row:first-child { margin-top: 4px; }

.seg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.seg-idx {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: rgba(124, 92, 255, 0.18);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.seg-range { font-size: 13.5px; font-weight: 650; }
.seg-dur { margin-left: auto; font-size: 12.5px; color: var(--text-dim); }

.seg-note {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.seg-ops { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.seg-op {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  border-radius: 9px;
  padding: 4px 10px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
}
.seg-op:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.22); }
.seg-op.danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.32); }

.seg-row .day-thumbs img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; }

/* 记录页里点时间行展开当天分段 */
.day-times-clickable { cursor: pointer; }
.day-sessions { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.day-sessions.hidden { display: none !important; }

.day-row.flash {
  animation: dayFlash 1.2s ease;
  border-radius: 12px;
}
@keyframes dayFlash {
  0% { background: rgba(124, 92, 255, 0.22); }
  100% { background: transparent; }
}

/* ---------- 搜索 ---------- */
.search-bar { display: flex; gap: 8px; margin-top: 8px; }
.search-bar input {
  flex: 1;
  min-width: 0;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.search-bar input:focus { outline: none; border-color: var(--brand); }
.search-bar .btn { padding: 9px 14px; white-space: nowrap; }
#search-results { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 380px) {
  .row-2 { grid-template-columns: 1fr; }
}

/* 跨天未出馆提示：一条窄条 + 一个补出馆按钮 */
.stale-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--warn, #d97706) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn, #d97706) 35%, transparent);
  font-size: 13px;
  line-height: 1.4;
}
.stale-hint[hidden] { display: none; }
.warn-text { color: var(--warn-ink, #b45309); }
.stale-hint .stale-text { flex: 1; }
.stale-hint .btn { white-space: nowrap; }

/* ---------- 专注（番茄钟） ---------- */
.focus-body {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 14px;
}
.focus-ring {
  flex: 0 0 auto;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--p, 0) * 1%), var(--card-2) 0);
  display: grid;
  place-items: center;
  transition: background 0.3s linear;
}
.focus-ring-inner {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
  gap: 2px;
}
.focus-ring-inner strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.focus-ring-inner span { font-size: 11px; }
.focus-side { flex: 1; min-width: 0; }
.focus-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text-dim);
  cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active {
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
#focus-card .actions { margin-top: 0; }

/* ---------- 照片时间轴 ---------- */
.photos-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
}
.photos-nav strong { font-size: 15px; }
.photos-day { margin: 0 0 18px; }
.photos-day-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.photos-day-head strong { font-size: 14px; }
.photos-day figure figcaption { text-align: center; }
.photos-day .thumb-grid { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 640px) {
  .photos-day .thumb-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 科目分布 ---------- */
.subject-list { display: flex; flex-direction: column; gap: 10px; }

.subject-row { display: flex; flex-direction: column; gap: 4px; }

.subject-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}

.subject-name { font-weight: 600; }
.subject-name.none { color: var(--text-dim); font-weight: 500; }

.subject-bar {
  height: 6px;
  background: var(--card-2);
  border-radius: 999px;
  overflow: hidden;
}

.subject-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.subject-bar > i.none { background: var(--text-faint); }

.subject-chip {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  background: rgba(124, 92, 255, 0.16);
  color: var(--brand);
  vertical-align: 1px;
}

.report-subjects { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.report-subjects > .subject-row { gap: 3px; }
.seg-subject { margin: 2px 0 0; }
