/* ============================================================
   我的个人主页 · 基础样式
   改配色：改下面 :root 里的变量即可，其他样式会自动跟着变
   ============================================================ */

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

/* ---------- 主题变量 ---------- */
:root {
  --bg: #f6f7f9;            /* 页面背景 */
  --bg-alt: #ffffff;        /* 头部 / 卡片 / 交替区块背景 */
  --text: #23272f;          /* 正文颜色 */
  --text-muted: #5b6472;    /* 次要文字 */
  --accent: #4f6ef7;        /* 主色（按钮、高亮、链接） */
  --accent-strong: #3d5ce0; /* 主色 hover */
  --accent-soft: #e9edfe;   /* 主色的浅色底 */
  --border: #e3e6ec;
  --radius: 12px;
  --shadow: 0 6px 20px rgba(35, 39, 47, 0.06);
  --container: 960px;
  --header-h: 64px;
}

/* 手动选择深色 */
:root[data-theme="dark"] {
  --bg: #16181d;
  --bg-alt: #1e2127;
  --text: #e8eaf0;
  --text-muted: #9aa3b2;
  --accent: #7c93ff;
  --accent-strong: #93a6ff;
  --accent-soft: #272c45;
  --border: #2c3039;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* 未手动选择时，跟随系统深色模式 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181d;
    --bg-alt: #1e2127;
    --text: #e8eaf0;
    --text-muted: #9aa3b2;
    --accent: #7c93ff;
    --accent-strong: #93a6ff;
    --accent-soft: #272c45;
    --border: #2c3039;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

a { color: var(--accent); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 头部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.site-nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* 主题按钮：浅色显示太阳，深色显示月亮 */
.icon-btn .icon-moon { display: none; }
:root[data-theme="dark"] .icon-btn .icon-moon { display: block; }
:root[data-theme="dark"] .icon-btn .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .icon-moon { display: block; }
  :root:not([data-theme="light"]) .icon-btn .icon-sun { display: none; }
}

.nav-toggle { display: none; }

/* 按钮内嵌图标 */
.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.record-del svg {
  width: 15px;
  height: 15px;
}

/* ---------- 页面标题 ---------- */
.page-head {
  padding: 56px 0 40px;
  text-align: center;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.page-head h1 { font-size: 2rem; }
.page-head p { margin-top: 8px; color: var(--text-muted); }

.status-chip {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.guest-banner {
  margin: 14px auto 0;
  max-width: 640px;
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius);
  color: #d97706;
  font-size: 0.88rem;
  line-height: 1.6;
  text-align: center;
}

/* ---------- 通用区块 ---------- */
.section { padding: 64px 0; }
.section-sm { padding: 32px 0; }
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 { font-size: 1.5rem; margin-bottom: 12px; }
.sub-title { font-size: 1.15rem !important; }
.section-intro { color: var(--text-muted); margin-bottom: 28px; }

/* 占位提示框 */
.placeholder {
  padding: 16px 18px;
  color: var(--text-muted);
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, filter 0.15s ease, transform 0.1s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 110, 247, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.07);
  box-shadow: 0 6px 16px rgba(79, 110, 247, 0.35);
}

.btn-ghost {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- 首页：模块入口卡片 ---------- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.module-card {
  display: block;
  padding: 28px 24px;
  text-decoration: none;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.module-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
}

.module-card h3 {
  color: var(--text);
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.module-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.module-enter {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- 学习：统计与打卡 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.stat-num {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.checkin-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 110, 247, 0.28);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.checkin-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 8px 20px rgba(79, 110, 247, 0.36);
  transform: translateY(-1px);
}

.checkin-btn:active { transform: translateY(0) scale(0.99); }

.checkin-btn.done {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
  cursor: default;
}

.checkin-btn.done:hover {
  filter: none;
  box-shadow: none;
  transform: none;
}

/* ---------- 学习：日历 ---------- */
.calendar-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.month-label { font-weight: 600; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-grid .dow {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 2px 0 8px;
}

.cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cell.checked {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.cell.today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.cell.today.checked {
  box-shadow: inset 0 0 0 2px var(--accent-strong);
}

/* ---------- 学习：记录 ---------- */
.record-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.record-form textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
}

.record-form textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.record-actions {
  display: flex;
  justify-content: flex-end;
}

.record-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.record-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.record-main { min-width: 0; flex: 1; }

.record-main p {
  white-space: pre-wrap;
  word-break: break-word;
}

.record-main time {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.record-del {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 4px;
  cursor: pointer;
}

.record-del:hover { color: var(--danger); }

.empty-records {
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- 学习：链接列表 ---------- */
.link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
}

.link-list a:hover { border-color: var(--accent); }

.link-emoji { font-size: 1.3rem; }

.link-meta {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ---------- 娱乐：Steam 游戏库 ---------- */
.steam-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.steam-game {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.steam-game img {
  width: 96px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--accent-soft);
  flex-shrink: 0;
  align-self: center;
}

.steam-noimg {
  width: 96px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 6px;
  flex-shrink: 0;
  align-self: center;
}

.steam-game-info {
  flex: 1;
  min-width: 0;
}

.steam-game-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.steam-game-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steam-game-hours {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.steam-game-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.play-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--accent-soft);
  margin-top: 8px;
  overflow: hidden;
}

.play-bar span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.steam-ach-btn {
  margin-top: 10px;
  padding: 6px 14px;
  font-size: 0.82rem;
}

.steam-ach {
  display: none;
}

.steam-ach.open {
  display: block;
  margin-top: 10px;
}

.ach-head {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.steam-ach-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

.steam-ach-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}

.steam-ach-item.ach-locked {
  opacity: 0.55;
}

.ach-ico {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.ach-ico.ok {
  border-color: var(--success);
  background: var(--success);
}

.ach-name {
  font-weight: 600;
}

.ach-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.ach-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

/* ---------- 通用卡片（生活 / 娱乐占位用） ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

.badge {
  display: inline-block;
  margin-top: 14px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ---------- 工具条与提示 ---------- */
.toolbar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.text-input {
  width: 200px;
  max-width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s ease;
}

.text-input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

/* ---------- 页脚 ---------- */
.site-footer {
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* ---------- 访客锁 ---------- */
[hidden] { display: none !important; }

.lock-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lock-box {
  width: min(380px, 100%);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 26px;
  text-align: center;
}

.lock-box h2 { font-size: 1.3rem; margin-bottom: 10px; }
.lock-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; line-height: 1.8; }
.lock-box .text-input { width: 100%; margin-bottom: 14px; }
.lock-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 日记 ---------- */
.tab-row { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.tab-btn {
  padding: 10px 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}
.tab-btn:hover { color: var(--text); border-color: var(--accent); }
.tab-btn.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.diary-stats { margin-top: 0; }

.toolbar-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.toolbar-row .text-input { width: 230px; }

.mood-filter { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.mood-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}
.mood-btn:hover { border-color: var(--accent); }
.mood-btn.active { background: var(--accent-soft); border-color: var(--accent); }

.entry-list { display: flex; flex-direction: column; gap: 12px; }
.entry-card { text-align: left; }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.entry-date { font-weight: 700; font-size: 0.95rem; }
.entry-mood { font-size: 1.3rem; }
.entry-title { font-weight: 600; margin: 8px 0 4px; font-size: 1.05rem; }
.entry-body { color: var(--text-muted); font-size: 0.92rem; white-space: pre-wrap; word-break: break-word; }
.entry-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag { background: var(--accent-soft); color: var(--accent); font-size: 0.75rem; padding: 2px 10px; border-radius: 999px; }
.entry-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.entry-actions .btn { padding: 6px 14px; font-size: 0.82rem; }

.cell.diary { flex-direction: column; }
.cell.diary.has-entry { background: var(--accent-soft); color: var(--accent); }
.cell-mood { font-size: 0.8rem; line-height: 1; margin-top: 2px; }

/* 状态记录日历 */
.status-cell { font-weight: 700; flex-direction: column; }
.cell.status-yellow { background: #d4a72c; color: #0f172a; }
.cell.status-red { background: #c93a3f; color: #fff; }
.cell.status-blue { background: #2f6fd6; color: #fff; }
.cell.status-yellow.today,
.cell.status-red.today,
.cell.status-blue.today { box-shadow: inset 0 0 0 2px #ffffff; }
.cell.status-red .cell-mood { color: #fff; opacity: 0.9; }

.editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.editor-box {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  text-align: left;
}
.editor-box label { font-size: 0.85rem; color: var(--text-muted); display: block; margin: 14px 0 5px; }
.editor-row { display: flex; gap: 12px; }
.editor-row > div { flex: 1; }
.editor-row label { margin-top: 0; }
.editor-box input[type="date"],
.editor-box input[type="text"],
.editor-box input[type="time"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.editor-box textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.7;
  resize: vertical;
}
.editor-box input:focus, .editor-box textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.mood-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.mood-pick .mood-btn { font-size: 1.35rem; padding: 5px 12px; }
.word-count { font-size: 0.8rem; color: var(--text-muted); text-align: right; margin-top: 4px; }
.detail-body { white-space: pre-wrap; word-break: break-word; color: var(--text); line-height: 1.8; }

.weekly-form { display: flex; flex-direction: column; }
.weekly-form label { font-size: 0.9rem; font-weight: 600; margin: 12px 0 6px; display: block; text-align: left; }
.weekly-form textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--text);
  font: inherit;
  line-height: 1.7;
  resize: vertical;
  margin-bottom: 4px;
}
.weekly-form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.week-card { text-align: left; }
.week-card summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
.week-field { margin-top: 10px; }
.week-field b { font-size: 0.85rem; }
.week-field p { color: var(--text-muted); font-size: 0.9rem; white-space: pre-wrap; word-break: break-word; margin-top: 3px; }

/* ---------- 安全日志 ---------- */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  max-height: 320px;
  overflow-y: auto;
}
.log-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 8px 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.8rem;
}
.log-time { color: var(--text-muted); }
.log-action { color: var(--accent); font-weight: 600; }
.log-detail { color: var(--text-muted); }
.log-ip { margin-left: auto; color: var(--text-muted); font-family: ui-monospace, Consolas, monospace; }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: none; }

  .site-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--bg-alt);
    border-bottom: none;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 60;
  }

  .site-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 10px;
  }

  .site-nav .nav-icon { display: block; font-size: 20px; line-height: 1; }
  body { padding-bottom: 70px; }

  .section { padding: 48px 0; }
  .page-head { padding: 44px 0 32px; }
}

/* ===== 新版布局组件 ===== */
.nav-icon { display: none; }

.hero-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
}
.hero-num {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.15;
}
.hero-num.locked-num { font-size: 2.2rem; }
.hero-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.dual-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.dual-hero.single { grid-template-columns: 1fr; }

.diamond-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.diamond-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 4px;
  border-radius: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s ease;
}
.diamond-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.diamond-icon { font-size: 1.7rem; line-height: 1; }
.diamond-label { font-size: 0.8rem; }
.diamond-item.disabled { opacity: 0.55; cursor: not-allowed; }
.diamond-item.disabled:hover { transform: none; border-color: var(--border); }
.diamond-item.disabled .diamond-label::after { content: ' · 开发中'; color: var(--text-muted); }

.entry-stream { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .entry-stream { grid-template-columns: 1fr 1fr; } }

.group-list {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.group-head {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.group-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}
.group-row:last-child { border-bottom: none; }
.group-row .row-label { font-size: 0.9rem; }
.group-row .row-desc { width: 100%; color: var(--text-muted); font-size: 0.8rem; }

/* ===== AI 工作台 ===== */
.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; }
@media (max-width: 820px) { .chat-layout { grid-template-columns: 1fr; } }
.conv-side { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.conv-side-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 700; }
.conv-list { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.conv-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.conv-item:hover { background: rgba(255, 255, 255, 0.05); }
.conv-item.active { border-color: var(--accent); background: var(--accent-soft); }
.conv-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.conv-title { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { font-size: 0.72rem; color: var(--text-muted); }
.conv-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; padding: 2px 4px; }
.conv-del:hover { color: #f87171; }

.chat-main { display: flex; flex-direction: column; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-height: 420px; }
.msg-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; max-height: 520px; min-height: 300px; }
.ai-welcome { text-align: center; margin: auto; color: var(--text-muted); max-width: 420px; line-height: 1.7; }
.msg-row { display: flex; }
.msg-row.user { justify-content: flex-end; }
.msg-row.assistant { justify-content: flex-start; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; line-height: 1.65; font-size: 0.95rem; }
.msg-row.user .bubble { background: var(--accent); color: #04121f; border-bottom-right-radius: 4px; }
.msg-row.assistant .bubble { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble code { background: rgba(0, 0, 0, 0.25); padding: 1px 5px; border-radius: 5px; font-size: 0.85em; }
.code-block { background: #0b1220; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 0.82rem; line-height: 1.5; margin: 6px 0; }
.md-li { margin: 2px 0; }
.cursor { animation: blink 1s step-start infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.input-row { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.input-row textarea {
  flex: 1;
  resize: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  max-height: 160px;
}
.input-row textarea:focus { outline: none; border-color: var(--accent); }

/* ===== 今日复习（间隔重复） ===== */
.review-box { display: flex; flex-direction: column; gap: 10px; }
.review-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--bg-alt); }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 4px; }
.review-date { font-size: 0.85rem; color: var(--text-muted); }
.review-stage { font-size: 0.78rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px; }
.review-body { font-size: 0.95rem; line-height: 1.6; margin: 4px 0; }
.review-fey { font-size: 0.88rem; color: var(--text-muted); background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; margin: 4px 0; }
.review-hidden { filter: blur(6px); user-select: none; pointer-events: none; }
.review-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ===== 日记照片 ===== */
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; align-items: center; }
.photo-thumb-wrap { position: relative; width: 84px; height: 84px; }
.photo-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.photo-del {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #c93a3f; color: #fff; border: 2px solid var(--bg-alt);
  cursor: pointer; font-size: 12px; line-height: 1; padding: 0;
}
.photo-badge { font-size: 0.75rem; color: var(--text-muted); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photo-grid img.photo-cell {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 10px; cursor: zoom-in; border: 1px solid var(--border);
}
.photo-viewer {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92); z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px;
}
.photo-viewer img { max-width: 96%; max-height: 86vh; border-radius: 10px; }

/* ===== 手机体验优化 ===== */
@media (max-width: 720px) {
  .btn { min-height: 44px; }
  .icon-btn { min-height: 40px; min-width: 40px; }
  .toolbar-row { flex-wrap: wrap; }
  .toolbar-row .text-input { flex: 1 1 100%; }
  .toolbar-row .btn { flex: 0 0 auto; }
  .mode-row { gap: 6px; }
  .mode-btn { padding: 8px 12px; font-size: 13px; }
  .hero-num { font-size: 2.2rem; }
  .page-head { padding: 32px 0 24px; }
  .page-head h1 { font-size: 1.5rem; }
  .section { padding: 32px 0; }
  .diamond-grid { gap: 10px; }
  .diamond-icon { font-size: 1.5rem; }
  .calendar-card { padding: 12px; }
  .calendar-grid .cell { min-height: 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dual-hero { gap: 10px; }
  /* 编辑/详情弹层改为底部抽屉，手机更好操作 */
  .editor-overlay { padding: 0; align-items: flex-end; }
  .editor-overlay .editor-box {
    width: 100%; max-width: 100%; border-radius: 20px 20px 0 0;
    max-height: 92dvh; overflow-y: auto;
  }
  .lock-overlay .lock-box { width: 92%; padding: 24px 20px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  /* 防 iOS 聚焦输入框自动放大 */
  input, textarea, select { font-size: 16px; }
}

/* ===== 任务清单：纸墨账本风格（细横线 + 方框勾选 + 朱红优先级竖线） ===== */
.task-panel { display: flex; flex-direction: column; }
.task-toolbar { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 6px; }
.task-toolbar .text-input {
  flex: 1; border: none; border-bottom: 1px solid var(--border);
  background: transparent; border-radius: 0; padding: 10px 2px 8px;
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 1rem; color: var(--text);
}
.task-toolbar .text-input:focus { border-bottom-color: var(--accent); }
.task-toolbar .btn-primary { border-radius: 6px; padding: 9px 18px; }

.task-list { display: flex; flex-direction: column; }
.task-group { border-top: 1px solid var(--border); }
.task-group:first-child { border-top: none; }
.task-group-title {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 0.8rem; color: var(--text-muted); margin: 14px 0 0;
  letter-spacing: 0.1em;
}
.task-group-title::before { content: "·"; color: var(--accent); margin-right: 6px; }

.task-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border);
  background: transparent; border-radius: 0;
  position: relative;
}
.task-row:last-child { border-bottom: none; }
.task-check {
  width: 21px; height: 21px; flex: 0 0 auto; margin-top: 1px;
  border: 1.5px solid #c9bfa9; border-radius: 4px;
  background: transparent; color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; line-height: 1;
}
.task-row.done .task-check { border-color: var(--accent); }
.task-title { flex: 1; word-break: break-word; font-size: 1rem; line-height: 1.5; }
.task-row.done .task-title { text-decoration: line-through; color: var(--text-muted); }

.task-row.pri-high { padding-left: 10px; }
.task-row.pri-high::before {
  content: ''; position: absolute; left: 0; top: 15px; bottom: 15px;
  width: 3px; background: var(--accent); border-radius: 2px;
}
.task-row.pri-low .task-title { color: var(--text-muted); }

.task-meta {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--text-muted); white-space: nowrap;
}
.task-pri { color: var(--text-muted); }
.task-row.pri-high .task-pri { color: var(--accent); }
.task-due.overdue { color: var(--accent); }
.task-repeat { color: var(--accent); }
.task-subcount { color: var(--text-muted); }
.task-open, .task-del, .task-forget {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.95rem; padding: 4px 6px; line-height: 1;
  opacity: 0.35; transition: opacity 0.15s ease, color 0.15s ease;
}
.task-row:hover .task-open, .task-row:hover .task-del, .task-row:hover .task-forget { opacity: 1; }
.task-del:hover, .task-forget:hover { color: var(--accent); }
.task-open:hover { color: var(--text); }

/* 详情面板 */
#taskDetail .editor-box { display: flex; flex-direction: column; gap: 6px; }
#taskDetail label { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }
#taskDetail .editor-row { display: flex; gap: 10px; }
#taskDetail .editor-row > div { flex: 1; }
.td-subs { display: flex; flex-direction: column; margin-top: 4px; }
.td-sub {
  display: flex; align-items: center; gap: 10px; padding: 8px 2px;
  border-bottom: 1px solid var(--border);
}
.td-sub:last-child { border-bottom: none; }
.td-sub-check {
  width: 18px; height: 18px; border: 1.5px solid #c9bfa9; border-radius: 4px;
  background: transparent; color: var(--accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1; font-size: 0.75rem;
}
.td-sub-title { flex: 1; font-size: 0.9rem; }
.td-sub-del { background: none; border: none; color: var(--text-muted); cursor: pointer; }
#td-pri, #td-repeat { width: 100%; }

@media (max-width: 720px) {
  #taskDetail { padding: 0; align-items: flex-end; }
  #taskDetail .editor-box {
    width: 100%; max-width: 100%; border-radius: 20px 20px 0 0;
    max-height: 92dvh; overflow-y: auto;
  }
  .task-open, .task-del, .task-forget { opacity: 0.55; }
}

/* ===== 复习任务（并入任务清单，纸墨版） ===== */
.task-titlewrap { flex: 1; min-width: 0; }
.task-row.review .task-title { cursor: pointer; }
.task-row.review .task-title:hover { color: var(--accent); }
.rv-detail {
  margin-top: 8px; padding: 10px 14px;
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem; line-height: 1.7; word-break: break-word;
}
.rv-detail[hidden] { display: none; }
.rv-fey { margin-top: 6px; color: var(--accent); }
.review-stage { color: var(--accent); }
.review-hint { color: var(--text-muted); opacity: 0.75; }

/* ===== 首页「今日」区块 ===== */
.today-block {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.today-block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.today-stats {
  font-size: 0.85rem; color: var(--text-muted);
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
}
.today-block .checkin-btn {
  width: 100%; padding: 14px; font-size: 1.05rem;
  letter-spacing: 0.06em;
}

/* ===== Steam 顶部统计 ===== */
.steam-stats {
  display: flex; gap: 12px; margin: 14px 0;
  flex-wrap: wrap;
}
.steam-stat {
  flex: 1; min-width: 110px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: center;
  box-shadow: none;
}
.ss-num {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 1.35rem; font-weight: 700; color: var(--text);
  display: block;
}
.ss-label { font-size: 0.8rem; color: var(--text-muted); }

/* ===== 财务中心 ===== */
.fin-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; }
.fin-card {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: none;
  display: flex; flex-direction: column; gap: 4px;
}
.fin-label { font-size: 0.8rem; color: var(--text-muted); }
.fin-num {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 1.3rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
}
.fin-sub { font-size: 1rem; margin: 20px 0 8px; color: var(--text); font-weight: 700; }
.fin-list { display: flex; flex-direction: column; }
.fin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--border);
  position: relative;
}
.fin-row:last-child { border-bottom: none; }
.fin-row.muted { opacity: 0.55; }
.fin-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fin-cat { font-weight: 700; font-size: 0.95rem; }
.fin-merchant { font-size: 0.82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.fin-amount { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1rem; }
.fin-amount.pos { color: var(--success); }
.fin-amount.neg { color: var(--text); }
.fin-amount.refund { color: var(--text-muted); }
.fin-date { font-size: 0.78rem; color: var(--text-muted); }
.fin-edit, .fin-del {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.85rem; padding: 4px 6px; opacity: 0.4;
}
.fin-row:hover .fin-edit, .fin-row:hover .fin-del { opacity: 1; }
.fin-del:hover { color: var(--danger); }
.fin-edit:hover { color: var(--text); }

.budget-row { padding: 10px 2px; border-bottom: 1px solid var(--border); position: relative; }
.budget-row:last-child { border-bottom: none; }
.budget-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.budget-cat { font-weight: 700; }
.budget-nums { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.budget-nums .over { color: var(--danger); font-weight: 700; }
.budget-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.budget-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.2s ease; }
.budget-del { position: absolute; right: 2px; top: 10px; }

.csv-map-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.csv-map-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--text-muted); }

@media (max-width: 720px) {
  .fin-hero { grid-template-columns: repeat(2, 1fr); }
  .csv-map-grid { grid-template-columns: 1fr; }
  .fin-edit, .fin-del { opacity: 0.55; }
}

/* ===== 回收站 ===== */
.trash-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-alt);
}
.trash-main { flex: 1; min-width: 0; }
.trash-date { font-size: 0.8rem; color: var(--text-muted); margin-right: 8px; }
.trash-title { font-weight: 700; }
.trash-preview {
  display: block; font-size: 0.85rem; color: var(--text-muted);
  margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trash-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 720px) {
  .trash-item { flex-direction: column; align-items: flex-start; }
  .trash-actions { width: 100%; }
}

/* 财务：分类排行 */
.cat-row { padding: 9px 2px; border-bottom: 1px solid var(--border); }
.cat-row:last-child { border-bottom: none; }
.cat-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.cat-name { font-weight: 700; }
.cat-num { font-size: 0.85rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cat-num.pos { color: var(--success); font-weight: 700; }

/* 财务：环形饼图 */
.pie-wrap {
  display: flex; align-items: center; gap: 26px;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  flex-wrap: wrap;
}
.pie-chart-box { width: 200px; height: 200px; flex: 0 0 200px; }
.pie-total {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 13px; font-weight: 700; fill: var(--text);
}
.pie-sub { font-size: 8px; fill: var(--text-muted); }
.pie-legend { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 9px; }
.pie-leg-item { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; }
.pie-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.pie-leg-name { flex: 1; }
.pie-leg-val { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
@media (max-width: 720px) {
  .pie-wrap { flex-direction: column; align-items: stretch; gap: 14px; }
  .pie-chart-box { width: 100%; height: 190px; flex: none; }
}
