/* =========================================================
   每日读文 · 样式表
   深浅双主题：通过 html[data-theme] 切换 CSS 变量
   品牌基因对齐歌单站（axuan.cmist.top）：夜空·星空·毛玻璃
   紫系主色 + 金色点缀 + 大圆角 + 衬线字体 + 同款缓动
   ========================================================= */

:root {
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", serif;

  /* 歌单站品牌 token：紫系 / 金色 / 圆角 / 缓动 */
  --purple-1: #b8a0e8;
  --purple-2: #8b6cc9;
  --purple-3: #6e4fb8;
  --gold: #d4b87a;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* 浅色主题（默认）· 紫调纸张 */
  --bg: #f5f1fa;
  --card: rgba(255, 255, 255, 0.72);
  --card-hover: #f0e9fb;
  --text: #2a2438;
  --text-2: #5c5470;
  --text-3: #8b82a0;
  --border: #e6def2;
  --primary: #8b6cc9;
  --primary-2: #d4b87a;
  --primary-soft: rgba(139, 108, 201, 0.10);
  --tag-bg: #efeaf9;
  --tag-text: #6e4fb8;
  --shadow: 0 4px 16px rgba(110, 79, 184, 0.10);
  --shadow-lg: 0 8px 32px rgba(110, 79, 184, 0.16);
  --music-glow: rgba(139, 108, 201, 0.16);
  --ink: rgba(42, 36, 56, 0.85);
  --paper-lines: rgba(139, 108, 201, 0.10);
}

[data-theme="dark"] {
  /* 深色主题 · 夜空紫 */
  --bg: #16121f;
  --card: rgba(31, 25, 48, 0.82);
  --card-hover: #2a2140;
  --text: #e8e0f5;
  --text-2: #b5a8d6;
  --text-3: #7f74a0;
  --border: #372e52;
  --primary: #b8a0e8;
  --primary-2: #d4b87a;
  --primary-soft: rgba(184, 160, 232, 0.14);
  --tag-bg: rgba(184, 160, 232, 0.12);
  --tag-text: #c9b8ee;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --music-glow: rgba(184, 160, 232, 0.22);
  --ink: rgba(232, 224, 245, 0.85);
  --paper-lines: rgba(184, 160, 232, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 108, 201, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 85% 110%, rgba(212, 184, 122, 0.07), transparent),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.hidden { display: none !important; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(110, 79, 184, 0.07);
}
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 8px;
}
.nav-logo { font-weight: 700; font-size: 18px; color: var(--text); white-space: nowrap; font-family: var(--kai); letter-spacing: 2px; }
.nav-logo .logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 5px; margin-right: 8px;
  background: var(--primary); color: #fdfbf4; font-size: 14px;
  box-shadow: 0 1px 4px rgba(139, 108, 201, 0.3);
}
.nav-links { display: flex; gap: 4px; margin-left: 16px; flex: 1; overflow-x: auto; }
.nav-link {
  padding: 6px 14px; border-radius: 6px; font-size: 14px;
  color: var(--text-2); border: none; background: transparent; white-space: nowrap;
  font-family: var(--kai); letter-spacing: 1px;
}
.nav-link:hover { color: var(--primary); background: var(--primary-soft); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card);
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s;
}
.theme-toggle:hover { transform: rotate(20deg); }

/* ---------- 主容器 ---------- */
.main { max-width: 960px; margin: 0 auto; padding: 24px 20px 80px; }
.page { display: none; animation: fadeIn 0.35s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; font-family: var(--kai); letter-spacing: 3px; display: flex; align-items: center; gap: 10px; }
.page-title::before {
  content: ""; width: 4px; height: 22px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  display: inline-block;
}
.page-sub { color: var(--text-3); font-size: 14px; margin-bottom: 24px; line-height: 1.7; }

/* ---------- 首页 ---------- */
.today-hero {
  background:
    radial-gradient(ellipse 120% 80% at 85% -20%, rgba(255,255,255,0.14), transparent),
    radial-gradient(ellipse 90% 70% at 10% 110%, rgba(212,184,122,0.18), transparent),
    linear-gradient(135deg, #6e4fb8, #8b6cc9);
  border-radius: var(--radius-lg); padding: 28px 28px; color: #fdfbf4;
  margin-bottom: 24px; box-shadow: 0 8px 32px rgba(110, 79, 184, 0.28);
  position: relative; overflow: hidden;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.14);
}
.today-hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0.08;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.5) 1px, transparent 1.5px),
    radial-gradient(circle at 80% 60%, rgba(255,255,255,0.4) 1px, transparent 1.5px);
  background-size: 22px 22px, 34px 34px;
  pointer-events: none;
}
.today-hero::after {
  content: "读"; position: absolute; right: -14px; bottom: -34px;
  font-family: var(--kai); font-size: 140px; font-weight: 700;
  color: rgba(253,251,244,0.07); line-height: 1; pointer-events: none;
}
.today-hero .date-big { font-size: 34px; font-weight: 800; letter-spacing: 1px; font-family: var(--kai); }
.today-hero .date-sub { opacity: 0.92; margin-top: 6px; font-size: 15px; }
.today-hero .hero-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.today-hero .hero-tags .hero-tag {
  background: rgba(253, 251, 244, 0.28);
  border: 1px solid rgba(253, 251, 244, 0.4);
  color: #fdfbf4; border-radius: 6px;
}
.today-hero .hero-seal {
  position: absolute; right: 24px; top: 20px; z-index: 1;
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #8b6cc9, #b8a0e8); color: #fdfbf4;
  font-family: var(--kai); font-size: 24px; font-weight: 700;
  border-radius: var(--radius-md); transform: rotate(4deg);
  box-shadow: 0 2px 8px rgba(110, 79, 184, 0.35);
  border: 1px solid rgba(255,255,255,0.3);
  letter-spacing: 0;
}
.hero-tag {
  background: rgba(255,255,255,0.22); border-radius: 20px;
  padding: 4px 12px; font-size: 12.5px; backdrop-filter: blur(4px);
}
.today-hero .poem-line {
  position: relative; z-index: 1; margin-top: 14px;
  font-family: var(--kai); font-size: 15px; opacity: 0.95;
  letter-spacing: 3px;
}

.section-title { font-size: 18px; font-weight: 700; margin: 26px 0 14px; display: flex; align-items: center; gap: 8px; font-family: var(--kai); letter-spacing: 2px; }
.section-title::before { content: "❖"; color: var(--primary); font-size: 14px; }
.section-title .badge {
  font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 4px;
  background: var(--primary-soft); color: var(--primary);
}

/* 文章卡片 */
.article-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px 22px; margin-bottom: 16px;
  cursor: pointer; transition: all 0.25s var(--ease); position: relative;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.article-card::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border-radius: 0 2px 2px 0; opacity: 0.85;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.card-badge { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); font-family: var(--kai); }
.badge-pref { background: rgba(139, 108, 201, 0.12); color: #6e4fb8; }
[data-theme="dark"] .badge-pref { background: rgba(184, 160, 232, 0.18); color: #c9b8ee; }
.badge-fresh { background: rgba(212, 184, 122, 0.16); color: #96702f; }
[data-theme="dark"] .badge-fresh { background: rgba(212, 184, 122, 0.2); color: #d9b078; }
.badge-explore { background: rgba(90, 118, 173, 0.14); color: #3f5d8f; }
[data-theme="dark"] .badge-explore { background: rgba(133, 156, 204, 0.2); color: #9fb4e0; }
.badge-poem { background: rgba(110, 79, 184, 0.16); color: #5d3f8f; }
[data-theme="dark"] .badge-poem { background: rgba(160, 133, 204, 0.22); color: #b09fe0; }
.badge-read { background: rgba(94, 150, 84, 0.16); color: #4d7c46; }
[data-theme="dark"] .badge-read { background: rgba(94, 150, 84, 0.2); color: #7fb77a; }
.card-tag { font-size: 11.5px; color: var(--text-3); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 2px 8px; font-family: var(--kai); }

.card-title { font-size: 19px; font-weight: 700; line-height: 1.5; margin-bottom: 8px; color: var(--text); font-family: var(--kai); letter-spacing: 1px; }
.article-card:hover .card-title { color: var(--primary); }
.card-desc { color: var(--text-2); font-size: 14.5px; line-height: 1.8; margin-bottom: 12px; }
.card-reason {
  background: var(--primary-soft); border-radius: 6px;
  border-left: 2px solid var(--primary);
  padding: 10px 14px; font-size: 13.5px; color: var(--text-2);
  line-height: 1.7; margin-bottom: 12px; position: relative;
}
.card-reason .reason-label { font-weight: 700; color: var(--primary); margin-right: 4px; font-family: var(--kai); }
.card-foot { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-size: 12.5px; }
.card-foot .source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.card-foot .readtime { margin-left: auto; }

/* AI 选文卡片 */
.ai-card::before { background: linear-gradient(180deg, #8c6d3f, #c9a86a); }
.ai-card .badge-pref { background: rgba(140, 109, 63, 0.12); color: #7a5c33; }
[data-theme="dark"] .ai-card .badge-pref { background: rgba(201, 168, 106, 0.18); color: #d9b078; }
.ai-hook {
  font-family: var(--kai); font-size: 15.5px; color: var(--primary);
  line-height: 1.9; margin-bottom: 10px; padding: 10px 14px;
  background: var(--primary-soft); border-radius: 8px;
  border-left: 3px solid var(--primary);
}
.ai-card .card-reason { margin-top: 10px; }

/* ---------- 日历 ---------- */
.calendar-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 0; max-width: 100%; box-shadow: 0 1px 3px rgba(110, 79, 184, 0.06); }

/* 日历左右双栏布局 */
.cal-split { display: flex; gap: 24px; align-items: flex-start; }
.cal-left { width: 320px; flex-shrink: 0; position: sticky; top: 80px; align-self: flex-start; }
.cal-right { flex: 1; min-width: 0; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.calendar-head .cal-title { font-size: 15px; font-weight: 700; font-family: var(--kai); letter-spacing: 2px; }
.cal-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.cal-btn:hover { border-color: var(--primary); color: var(--primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week { text-align: center; font-size: 11px; color: var(--text-3); padding: 4px 0; font-weight: 600; font-family: var(--kai); }
.cal-day {
  aspect-ratio: 1; border-radius: 6px; border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; position: relative; transition: all 0.2s;
}
.cal-day:hover { background: var(--card-hover); }
.cal-day.other { color: var(--text-3); opacity: 0.45; }
.cal-day.today { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.cal-day.has-rec::after {
  content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--primary);
}
.cal-day.selected { background: var(--primary); color: #fff; font-weight: 700; }
.cal-day.selected::after { background: #fff; }
.cal-day.today.selected { background: var(--primary); color: #fff; box-shadow: inset 0 0 0 2px rgba(253, 251, 244, 0.5); }
.cal-day-label { font-size: 9px; line-height: 1; margin-top: 1px; }
.cal-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 11.5px; color: var(--text-3); }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.legend-dot.has { background: var(--primary); }
.legend-dot.today { background: none; border: 1px solid var(--primary); }

.cal-day-list { margin-top: 4px; }
.cal-empty { text-align: center; color: var(--text-3); padding: 30px 0; font-size: 14px; }
.day-head { font-size: 16px; font-weight: 700; margin-bottom: 14px; font-family: var(--kai); letter-spacing: 1px; }
.day-head .day-reason { font-size: 13px; color: var(--text-2); font-weight: 400; margin-top: 4px; line-height: 1.7; }

/* ---------- 文章库 ---------- */
.lib-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.lib-search {
  flex: 1; min-width: 200px; padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-family: inherit; font-size: 14px;
}
.lib-search:focus { outline: none; border-color: var(--primary); }
.lib-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-2); font-size: 13px; font-family: var(--kai);
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); color: #fdfbf4; border-color: var(--primary); }

/* ---------- 阅读页 ---------- */
.reader { max-width: 780px; margin: 0 auto; }
.reader-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 14px; margin-bottom: 18px; cursor: pointer; }
.reader-back:hover { color: var(--primary); }
.reader-head { margin-bottom: 10px; }
.reader-title-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.reader-title { font-size: 28px; font-weight: 800; line-height: 1.45; flex: 1; min-width: 260px; font-family: var(--kai); letter-spacing: 2px; }
.music-btn {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(110, 79, 184, 0.08); transition: all 0.25s; margin-top: 6px;
}
.music-btn:hover { border-color: var(--primary); box-shadow: 0 0 0 6px var(--music-glow); transform: scale(1.06); }
.music-btn.playing { border-color: var(--primary); background: var(--primary-soft); animation: music-pulse 1.6s infinite; }
@keyframes music-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--music-glow); }
  50% { box-shadow: 0 0 0 10px transparent; }
}
.reader-meta { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-size: 13.5px; margin: 10px 0 20px; flex-wrap: wrap; }
.reader-meta .author { color: var(--text-2); font-weight: 600; }
.reader-origin {
  font-size: 12.5px; color: var(--text-3); background: var(--card);
  border: 1px dashed var(--border); border-radius: 8px; padding: 8px 14px; margin-bottom: 22px;
}
.reader-origin a { color: var(--primary); }
.font-size-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 14px; margin-bottom: 22px; width: fit-content;
  box-shadow: 0 1px 3px rgba(110, 79, 184, 0.06);
}
.font-size-bar .fs-label { font-size: 12.5px; color: var(--text-3); margin-right: 4px; }
.font-size-bar .fs-btn {
  padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-2); font-size: 13px; font-family: inherit;
}
.font-size-bar .fs-btn:hover { border-color: var(--primary); color: var(--primary); }
.font-size-bar .fs-val { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 26px; text-align: center; }
.reader-body { line-height: 2.05; font-size: 17px; color: var(--text); transition: font-size 0.15s; position: relative; }
.reader-body::before {
  content: ""; position: absolute; left: -14px; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, var(--paper-lines) 8%, var(--paper-lines) 92%, transparent);
}
.reader-body p { margin-bottom: 1.1em; text-indent: 2em; }
.reader-body h2 { font-size: 20px; margin: 1.6em 0 0.8em; }
.reader-body h3 { font-size: 18px; margin: 1.4em 0 0.6em; }
.reader-body .quote { border-left: 3px solid var(--primary); padding: 10px 16px; background: var(--primary-soft); border-radius: 0 10px 10px 0; color: var(--text-2); margin: 1.2em 0; font-style: normal; }
.reader-body .quote p { text-indent: 0; margin-bottom: 0.4em; }
.reader-body .center { text-align: center; }
.reader-body .poem { font-family: var(--serif); font-size: 17px; }
.reader-body .poem p { text-indent: 0; text-align: center; margin-bottom: 0.6em; }
.reader-body .hr { border: none; border-top: 1px solid var(--border); margin: 2em auto; width: 60%; }

/* 音乐播放器浮层 */
.music-player {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px); animation: fadeIn 0.2s;
}
.music-player-inner {
  width: min(480px, 92vw); background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--border);
}
.music-player-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.music-player-header span { font-weight: 700; font-size: 15px; font-family: var(--kai); letter-spacing: 1px; }
.music-close { border: none; background: none; font-size: 22px; color: var(--text-3); line-height: 1; padding: 2px 6px; }
.music-close:hover { color: var(--text); }
.music-list { padding: 10px; max-height: 60vh; overflow-y: auto; }
.music-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 10px; cursor: pointer; transition: background 0.2s;
}
.music-item:hover { background: var(--card-hover); }
.music-item.playing { background: var(--primary-soft); }
.music-icon { font-size: 18px; width: 30px; text-align: center; color: var(--text-3); }
.music-item.playing .music-icon { color: var(--primary); animation: music-pulse 1.6s infinite; }
.music-info { flex: 1; }
.music-info .name { font-size: 14px; font-weight: 600; color: var(--text); }
.music-item.playing .name { color: var(--primary); }
.music-info .desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.music-state { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.music-hint { padding: 10px 20px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); line-height: 1.7; }

/* 评价区 */
.rating-box {
  margin-top: 36px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 22px 24px; text-align: center;
  box-shadow: 0 1px 3px rgba(110, 79, 184, 0.06);
}
.rating-box .rating-q { font-size: 16px; font-weight: 700; margin-bottom: 14px; font-family: var(--kai); letter-spacing: 1px; }
.rating-stars { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.rating-stars .star { font-size: 30px; color: var(--border); cursor: pointer; transition: transform 0.15s, color 0.15s; background: none; border: none; }
.rating-stars .star:hover { transform: scale(1.2); }
.rating-stars .star.on { color: #d99a2b; }
.rating-labels { display: flex; justify-content: space-between; max-width: 340px; margin: 0 auto; color: var(--text-3); font-size: 12px; }
.rating-done { color: #4e9e6f; font-size: 14px; margin-top: 8px; }
[data-theme="dark"] .rating-done { color: #6fd69a; }
.rating-foot { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.btn-read { background: rgba(94, 204, 143, 0.14); color: #2e9e68; border-color: rgba(94, 204, 143, 0.4); }
[data-theme="dark"] .btn-read { background: rgba(94, 204, 143, 0.2); color: #5fd69a; }

/* 后台复选框 */
.admin-checkbox { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); flex-shrink: 0; }

/* 后台添加文章表单 */
.admin-article-form { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.admin-article-form .form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.admin-article-form .form-row label { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.admin-article-form .form-row input,
.admin-article-form .form-row select,
.admin-article-form .form-row textarea {
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-family: inherit; font-size: 14px;
}
.admin-article-form .form-row textarea { resize: vertical; min-height: 80px; line-height: 1.8; }
.admin-article-form .form-row input:focus,
.admin-article-form .form-row select:focus,
.admin-article-form .form-row textarea:focus { outline: none; border-color: var(--primary); }

/* 待读清单 */
.todo-item .card-title a { color: var(--primary); }
.todo-item .card-title a:hover { text-decoration: underline; }

/* 按钮 */
.btn {
  padding: 9px 20px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-2); font-size: 14px; font-family: inherit;
  transition: all 0.2s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-primary { background: var(--primary); color: #fdfbf4; border-color: var(--primary); }
.btn-primary:hover { opacity: 0.9; color: #fdfbf4; background: var(--primary); }

/* 后台 */
.admin-login { max-width: 380px; margin: 60px auto; text-align: center; }
.admin-login h2 { margin-bottom: 20px; }
.admin-login input {
  width: 100%; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-family: inherit; font-size: 15px;
}
.admin-login input:focus { outline: none; border-color: var(--primary); }
.admin-panel { display: flex; flex-direction: column; gap: 24px; }
.admin-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; box-shadow: 0 1px 2px rgba(110, 79, 184, 0.05); }
.admin-section h3 { font-size: 16px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; font-family: var(--kai); letter-spacing: 1px; }
.admin-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.admin-row select, .admin-row input {
  padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-family: inherit; font-size: 13.5px;
}
.admin-pick-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--bg);
}
.admin-pick-item .idx { font-weight: 700; color: var(--primary); width: 22px; text-align: center; }
.admin-pick-item .info { flex: 1; min-width: 0; }
.admin-pick-item .info .t { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-pick-item .info .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat-box { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.stat-box .num { font-size: 22px; font-weight: 800; color: var(--primary); }
.stat-box .label { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* 首页空状态 */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty-state .big { font-size: 44px; margin-bottom: 12px; }

/* 页脚 */
.site-footer {
  margin-top: 60px; padding: 24px 0 8px; text-align: center;
  position: relative;
}
.footer-line {
  width: 120px; height: 1px; margin: 0 auto 14px;
  background: linear-gradient(90deg, transparent, var(--primary-2), transparent);
  opacity: 0.6;
}
.footer-text {
  font-family: var(--kai); font-size: 13px; color: var(--text-3);
  letter-spacing: 3px;
}
.footer-seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-top: 10px;
  background: var(--primary-soft); color: var(--primary);
  font-family: var(--kai); font-size: 13px; border-radius: 5px;
  border: 1px solid var(--primary-soft);
}
.footer-beian {
  margin-top: 8px; font-size: 11.5px; color: var(--text-3);
  font-family: var(--kai); letter-spacing: 1px;
}
.footer-beian a { color: var(--text-3); transition: color 0.2s; }
.footer-beian a:hover { color: var(--primary); }

/* 响应式 */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-inner { padding: 0 14px; }
  .main { padding: 16px 14px; }
  .reader-title { font-size: 23px; }
  .reader-body { font-size: 16.5px; line-height: 1.95; }
  .today-hero { padding: 22px 20px; }
  .article-card { padding: 16px; }
  /* 日历双栏在小屏改为上下布局 */
  .cal-split { flex-direction: column; gap: 16px; }
  .cal-left { width: 100%; position: static; }
  .ai-chat-area { height: calc(100vh - 260px); }
}

/* ---------- AI 推荐对话页 ---------- */
.ai-page { display: flex; flex-direction: column; min-height: calc(100vh - 140px); }
.ai-chat-area {
  flex: 1; overflow-y: auto; padding: 8px 0 16px;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 300px; max-height: calc(100vh - 280px);
}

/* 欢迎区 */
.ai-welcome { text-align: center; padding: 40px 20px; color: var(--text-3); }
.ai-welcome-icon { font-size: 36px; color: var(--primary); margin-bottom: 12px; }
.ai-welcome-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 6px; font-family: var(--kai); letter-spacing: 2px; }
.ai-welcome-desc { font-size: 14px; margin-bottom: 22px; }
.ai-suggest-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ai-chip {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-2); font-size: 13px; font-family: var(--kai);
  cursor: pointer; transition: all 0.2s; letter-spacing: 1px;
}
.ai-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* 消息气泡 */
.ai-msg { display: flex; gap: 10px; max-width: 88%; }
.ai-msg-user { margin-left: auto; flex-direction: row-reverse; }
.ai-msg-bot { margin-right: auto; }
.ai-msg-avatar {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary); color: #fdfbf4;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--kai); font-size: 14px; font-weight: 700;
  box-shadow: 0 1px 4px rgba(139, 108, 201, 0.3);
}
.ai-msg-bubble {
  padding: 12px 16px; border-radius: 10px; line-height: 1.75;
  font-size: 14.5px; color: var(--text); word-break: break-word;
}
.ai-msg-user .ai-msg-bubble {
  background: var(--primary); color: #fdfbf4; border-radius: 10px 10px 2px 10px;
}
.ai-msg-bot .ai-msg-bubble {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px 10px 10px 2px;
  box-shadow: 0 1px 3px rgba(110, 79, 184, 0.06);
}
.ai-msg-bubble p { margin-bottom: 0.6em; }
.ai-msg-bubble p:last-child { margin-bottom: 0; }

/* 打字动画 */
.ai-typing { display: inline-flex; gap: 4px; align-items: center; padding: 16px 20px; }
.ai-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-3);
  animation: ai-typing-bounce 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* AI 推荐的文章卡片（嵌入聊天中） */
.ai-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; margin: 8px 0; cursor: pointer; transition: all 0.2s;
}
.ai-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(110, 79, 184, 0.08); }
.ai-card-top { display: flex; gap: 6px; margin-bottom: 6px; }
.ai-card-title { font-size: 16px; font-weight: 700; color: var(--text); font-family: var(--kai); letter-spacing: 1px; margin-bottom: 4px; }
.ai-card-desc { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 6px; }
.ai-card-foot { font-size: 12px; color: var(--text-3); }
.ai-card-link .ai-card-title a { color: var(--primary); }
.ai-card-link .ai-card-title a:hover { text-decoration: underline; }
.ai-card-add { margin-top: 8px; padding: 5px 14px; font-size: 12px; }

/* 输入栏 */
.ai-input-bar {
  display: flex; gap: 10px; padding: 12px 0;
  border-top: 1px solid var(--border); background: var(--bg);
  position: sticky; bottom: 0;
}
.ai-input {
  flex: 1; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-family: inherit; font-size: 14px;
}
.ai-input:focus { outline: none; border-color: var(--primary); }
.ai-input:disabled { opacity: 0.5; }
.ai-send-btn {
  padding: 12px 22px; border-radius: 10px; border: none;
  background: var(--primary); color: #fdfbf4; font-size: 14px; font-family: inherit;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.ai-send-btn:hover { opacity: 0.9; }
.ai-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 用量提示 */
.ai-quota {
  text-align: center; font-size: 12px; color: var(--text-2);
  padding: 6px 0 2px; border-top: 1px solid var(--border);
  background: var(--bg);
}
.ai-quota-low { color: var(--primary); font-weight: 600; }

/* 上传进度条 */
.upload-bar {
  width: 100%; height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden; margin-top: 6px;
}
.upload-bar-fill {
  width: 30%; height: 100%; background: var(--primary);
  border-radius: 2px;
  animation: upload-pulse 1.5s ease-in-out infinite;
}
@keyframes upload-pulse {
  0%, 100% { width: 30%; opacity: 0.6; }
  50% { width: 90%; opacity: 1; }
}