:root {
  --accent: #d63a2a;
  --accent-dark: #b02a1e;
  --accent-soft: #fdeeea;
  --bg: #fff8f1;
  --card: #ffffff;
  --text: #33302c;
  --muted: #8a8178;
  --border: #f0e2d4;
  --radius: 18px;
  --shadow: 0 3px 14px rgba(180, 90, 40, .09);
  --input-bg: #ffffff;
  --track: #f3e9dc;
  --cover-bg: #f3efe9;
  --hero-bg: rgba(255, 255, 255, .88);
  --login-bg: rgba(255, 255, 255, .94);
  --notice-bg: #fff4d6;
  --notice-border: #f0d48a;
  --notice-text: #7a5b12;
  --star: #f5a623;
}
/* 深色模式：整套调色板换深，背景图压更暗的罩层保证可读 */
[data-theme="dark"] {
  --accent: #e85a47;
  --accent-dark: #ff9d76;
  --accent-soft: #3d2422;
  --bg: #16120f;
  --card: #251e19;
  --text: #f2e9df;
  --muted: #ab9c8d;
  --border: #40342a;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --input-bg: #2b231d;
  --track: #3a2f26;
  --cover-bg: #33291f;
  --hero-bg: rgba(30, 24, 20, .88);
  --login-bg: rgba(30, 24, 20, .94);
  --notice-bg: #3a2f16;
  --notice-border: #6b5518;
  --notice-text: #f0d48a;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* 全站背景：底图 + 柔和渐变罩 + 两层小圆点星屑纹理（错开排布），保证文字与卡片可读 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(rgba(214, 58, 42, .13) 1.2px, transparent 1.4px),
    radial-gradient(rgba(240, 118, 42, .11) 1px, transparent 1.2px),
    linear-gradient(rgba(255, 248, 241, .80), rgba(255, 240, 228, .90)),
    url("bg.jpg");
  background-size: 26px 26px, 38px 38px, cover, cover;
  background-position: 0 0, 14px 19px, center, center;
  background-repeat: repeat, repeat, no-repeat, no-repeat;
}
[data-theme="dark"] body::before {
  background-image:
    radial-gradient(rgba(255, 190, 160, .10) 1.2px, transparent 1.4px),
    radial-gradient(rgba(255, 220, 190, .08) 1px, transparent 1.2px),
    linear-gradient(rgba(14, 11, 8, .80), rgba(14, 11, 8, .89)),
    url("bg.jpg");
}
.hidden { display: none !important; }

/* ---------- 头部（毛玻璃细条，不再是实色大横幅） ---------- */
.app-header {
  background: rgba(255, 247, 240, .85);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 18px rgba(180, 90, 40, .10);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .app-header {
  background: rgba(26, 21, 17, .85);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}
.header-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 9px 16px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-icon-img {
  width: 38px; height: 38px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(180, 90, 40, .18);
}
.brand h1 { font-size: 20px; margin: 0; letter-spacing: 2px; color: var(--text); }
.brand-spark { color: var(--accent); font-size: 15px; margin-left: -4px; }
.auth-area { display: flex; align-items: center; gap: 8px; }
.user-info { font-size: 13px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.readonly-badge {
  font-size: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
/* 导航：图标砖（固定方形，图不变形）+ 下方小标签 */
.tabs {
  max-width: 1024px;
  margin: 0 auto;
  padding: 4px 12px 10px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 9px 5px;
  border-radius: 16px;
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: background .15s, color .15s, transform .1s;
}
.tab-icon {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 6px rgba(120, 60, 20, .14);
}
.tab-label { line-height: 1.15; white-space: nowrap; }
.tab:hover { background: var(--accent-soft); }
.tab.active {
  background: var(--accent-soft);
  border-color: var(--border);
  color: var(--accent-dark);
  font-weight: 700;
}
.tab.active .tab-icon { animation: navPop .35s ease; }
@keyframes navPop {
  0% { transform: scale(.85); }
  55% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1); }
}
.tab:active { transform: scale(.94); }
/* 门禁未开时的锁定样式（未选登录方式时全部目录/统计不可进） */
.tab.locked { opacity: .5; }
.tab.locked .tab-icon { filter: grayscale(.55); }
.btn.locked { opacity: .55; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  background: var(--card);
  color: var(--text);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: inherit; }
.btn-danger { background: var(--card); border-color: #e5b4ae; color: #c0392b; }
.btn-large { font-size: 16px; padding: 12px 26px; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: wait; }

/* ---------- 提示条 ---------- */
.notice {
  max-width: 1024px;
  margin: 12px auto 0;
  width: calc(100% - 32px);
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  color: var(--notice-text);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- 主区域 ---------- */
main { flex: 1; width: 100%; max-width: 1024px; margin: 0 auto; padding: 16px; }

.login-view { display: flex; justify-content: center; padding-top: 48px; }
.login-card {
  background: var(--login-bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 36px 28px;
  text-align: center;
  max-width: 420px;
}
.login-emoji { font-size: 44px; }
.login-card h2 { margin: 12px 0 8px; font-size: 20px; }
.login-card p { color: var(--muted); line-height: 1.7; margin: 0 0 20px; }

/* ---------- 主页 ---------- */
.home-hero {
  background: var(--hero-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 36px 28px 32px;
  text-align: center;
  max-width: 640px;
  margin: 24px auto 0;
}
.home-title { font-size: 26px; margin: 18px 0 6px; letter-spacing: 1px; }
.home-sub { color: var(--muted); line-height: 1.7; margin: 0 0 22px; }
.home-stats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 26px; }
.home-chip {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.home-chip-num { font-size: 19px; font-weight: 700; color: var(--accent-dark); }
.home-chip-label { font-size: 13px; color: var(--muted); }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.home-actions .btn-ghost { border-color: var(--border); color: var(--text); }
.home-auth {
  margin: 26px auto 0;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  text-align: center;
}
.home-auth-title { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.home-auth-title .readonly-badge {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
  margin-left: 6px;
  vertical-align: 2px;
}
.home-auth-sub { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0 0 14px; }
.home-auth-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar input[type="search"] {
  flex: 1 1 200px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--input-bg);
  color: var(--text);
}
.toolbar select {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.chip {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted);
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.result-count { color: var(--muted); font-size: 13px; margin: 8px 2px; }

.seed-box {
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}
.seed-box p { margin: 0 0 10px; }

/* ---------- 记录卡片 ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-cover {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--cover-bg);
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-title { font-size: 16px; font-weight: 600; line-height: 1.45; word-break: break-all; }
.card-note { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.card-release { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag {
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 6px;
  padding: 2px 8px;
}
.tag.date { background: var(--cover-bg); color: var(--muted); }
.tag.rewatch { background: #ffe9a8; color: #8a6410; font-weight: 700; }
.card-actions { margin-top: auto; display: flex; align-items: center; justify-content: flex-end; }
.card-actions .spacer { flex: 1; }
.btn-edit {
  border: none; background: none; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 2px 4px;
}
.btn-edit:hover { color: var(--accent); }
/* 收藏星标：主人可点切换；非主人只看到静态 ★ 指示 */
.btn-fav {
  border: none; background: none; cursor: pointer;
  font-size: 19px; line-height: 1; padding: 2px 6px; color: #d8c6ab;
}
.btn-fav:hover { color: #f5a623; }
.btn-fav.active { color: #f5a623; }
.fav-static { font-size: 16px; line-height: 1; padding: 2px 6px; color: #f5a623; }
#fav-tab-count { font-size: 11px; }
.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- 统计 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 16px 8px 18px;
}
.stat-card:nth-child(1) { background: linear-gradient(150deg, rgba(240, 118, 42, .14), transparent 60%), var(--card); }
.stat-card:nth-child(2) { background: linear-gradient(150deg, rgba(126, 200, 227, .18), transparent 60%), var(--card); }
.stat-card:nth-child(3) { background: linear-gradient(150deg, rgba(244, 143, 177, .16), transparent 60%), var(--card); }
.stat-card:nth-child(4) { background: linear-gradient(150deg, rgba(179, 157, 219, .18), transparent 60%), var(--card); }
.stat-card:nth-child(5) { background: linear-gradient(150deg, rgba(245, 166, 35, .16), transparent 60%), var(--card); }
.stat-card:nth-child(6) { background: linear-gradient(150deg, rgba(129, 199, 132, .16), transparent 60%), var(--card); }
.stat-card:nth-child(7) { background: linear-gradient(150deg, rgba(232, 69, 44, .12), transparent 60%), var(--card); }
.stat-ico { font-size: 19px; line-height: 1; margin-bottom: 6px; }
.stat-num { font-size: 30px; font-weight: 800; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
/* 统计分区卡：柔和粉彩渐变 + 图标标题，逐个淡入上浮 */
.stat-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  margin-top: 18px;
  animation: statIn .55s ease backwards;
}
.stat-section.tint-1 { background: linear-gradient(135deg, rgba(240, 118, 42, .10), transparent 55%), var(--card); }
.stat-section.tint-2 { background: linear-gradient(135deg, rgba(126, 200, 227, .13), transparent 55%), var(--card); }
.stat-section.tint-3 { background: linear-gradient(135deg, rgba(244, 143, 177, .12), transparent 55%), var(--card); }
.stat-section.tint-4 { background: linear-gradient(135deg, rgba(179, 157, 219, .13), transparent 55%), var(--card); }
.stat-section.tint-5 { background: linear-gradient(135deg, rgba(129, 199, 132, .12), transparent 55%), var(--card); }
.stat-section.tint-6 { background: linear-gradient(135deg, rgba(245, 166, 35, .12), transparent 55%), var(--card); }
#view-stats .stat-section:nth-of-type(2) { animation-delay: .04s; }
#view-stats .stat-section:nth-of-type(3) { animation-delay: .08s; }
#view-stats .stat-section:nth-of-type(4) { animation-delay: .12s; }
#view-stats .stat-section:nth-of-type(5) { animation-delay: .16s; }
#view-stats .stat-section:nth-of-type(6) { animation-delay: .20s; }
#view-stats .stat-section:nth-of-type(7) { animation-delay: .24s; }
#view-stats .stat-section:nth-of-type(8) { animation-delay: .28s; }
#view-stats .stat-section:nth-of-type(9) { animation-delay: .32s; }
#view-stats .stat-section:nth-of-type(10) { animation-delay: .36s; }
#view-stats .stat-section:nth-of-type(11) { animation-delay: .40s; }
#view-stats .stat-section:nth-of-type(12) { animation-delay: .44s; }
#view-stats .stat-section:nth-of-type(13) { animation-delay: .48s; }
#view-stats .stat-section:nth-of-type(14) { animation-delay: .52s; }
@keyframes statIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.stat-section .section-title { margin: 0 0 12px; }
.section-title { margin: 26px 0 12px; font-size: 17px; }
.section-title::before { content: "✦ "; color: var(--accent); }
.sec-ico { margin-right: 6px; }
.period-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.period-name { width: 92px; font-size: 14px; color: var(--muted); text-align: right; }
.period-bar-wrap { flex: 1; background: var(--track); border-radius: 6px; height: 20px; overflow: hidden; }
.period-bar { height: 100%; background: linear-gradient(90deg, #e8452c, #f0762a); border-radius: 6px; min-width: 2px; transition: width .8s cubic-bezier(.22, .8, .3, 1); }
.period-num { width: 64px; font-size: 14px; font-weight: 600; }
/* 时期圆环图 */
.period-flex { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.period-bars { flex: 1 1 260px; min-width: 240px; }
.donut-wrap { flex: none; width: 168px; margin: 0 auto; }
.donut-svg { width: 150px; height: 150px; display: block; margin: 0 auto; }
.donut-seg { transition: stroke-dasharray .9s cubic-bezier(.22, .8, .3, 1); }
.donut-center-num { font-size: 30px; font-weight: 800; fill: var(--accent); }
.donut-center-label { font-size: 12px; fill: var(--muted); }
.donut-legend { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.donut-legend-row { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.donut-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.donut-legend-name { color: var(--muted); }
.donut-legend-num { margin-left: auto; font-weight: 600; }
.monthly-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 132px;
  padding: 8px 4px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.month-col { flex: 1 0 18px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
/* 日期标签横排（不再竖排），只给每第 6 个月渲染文字，其余留空占位 */
.month-bar { width: 70%; max-width: 22px; background: linear-gradient(180deg, #f0762a, #e8452c); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .7s cubic-bezier(.22, .8, .3, 1); }
.month-label { font-size: 9px; color: var(--muted); margin-top: 4px; height: 12px; line-height: 12px; white-space: nowrap; }
.month-count { font-size: 10px; color: var(--accent-dark); font-weight: 700; }
.stats-note { color: var(--muted); font-size: 13px; margin: 4px 2px 0; }

/* ---------- 访客记录（仅主人可见） ---------- */
.visits-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.visits-head .section-title { margin: 26px 0 12px; }
.visits-list { margin-top: 12px; }
.visit-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 8px;
  font-size: 13.5px; box-shadow: var(--shadow);
}
.visit-time { font-weight: 700; white-space: nowrap; }
.visit-who { color: var(--accent-dark); font-weight: 600; white-space: nowrap; }
.visit-meta { color: var(--muted); }
.visit-event {
  margin-left: auto; font-size: 12px; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 6px; padding: 2px 8px;
}
/* Top 10 排行：名次徽章行（前三名奖牌色） */
.longest-list { margin: 0; padding: 0; list-style: none; }
.longest-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  border-bottom: 1px dashed var(--border);
  line-height: 1.5;
}
.longest-list li:last-child { border-bottom: none; }
.rank-main { flex: 1; min-width: 0; }
.rank-chip {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--track);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.rank-chip.top1 { background: linear-gradient(135deg, #ffd76e, #f5a623); color: #7a4b00; box-shadow: 0 2px 6px rgba(245, 166, 35, .4); }
.rank-chip.top2 { background: linear-gradient(135deg, #f2f2f6, #b9bec9); color: #4a4e57; box-shadow: 0 2px 6px rgba(150, 155, 170, .35); }
.rank-chip.top3 { background: linear-gradient(135deg, #f0b28a, #c97b4a); color: #6b3410; box-shadow: 0 2px 6px rgba(201, 123, 74, .35); }
.longest-list .eps { color: var(--accent); font-weight: 700; margin-left: 6px; }
.longest-list .when { color: var(--muted); font-size: 13px; margin-left: 6px; }

/* ---------- 弹窗表单 ---------- */
dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  background: var(--card);
  color: var(--text);
  width: min(92vw, 420px);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(60, 30, 10, .35); }
#record-form { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
#record-form h3 { margin: 0 0 4px; }
#record-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
#record-form label.checkbox { flex-direction: row; align-items: center; color: var(--text); }
#record-form input[type="text"], #record-form input:not([type]),
#record-form input[type="number"], #record-form input[type="date"], #record-form select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
  background: var(--input-bg);
  width: 100%;
}
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dialog-actions .spacer { flex: 1; }

.app-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 0 26px; }

@media (max-width: 560px) {
  .brand h1 { font-size: 18px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .card-title { font-size: 14px; }
  .user-info { display: none; }
}
@media (max-width: 380px) {
  .cards { grid-template-columns: 1fr; }
}

/* ---------- 主题切换 ---------- */
.btn-theme { padding: 8px 10px; font-size: 16px; line-height: 1; }

/* ---------- 视图切换（列表 / 海报墙） ---------- */
.view-toggle { display: inline-flex; margin-left: auto; }
.btn-toggle { border-radius: 0; border: 1px solid var(--border); border-left: none; background: var(--card); color: var(--muted); }
.btn-toggle:first-child { border-radius: 10px 0 0 10px; border-left: 1px solid var(--border); }
.btn-toggle:last-child { border-radius: 0 10px 10px 0; }
.btn-toggle.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ---------- 海报墙 ---------- */
.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--cover-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.tile.clickable { cursor: pointer; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.5;
  word-break: break-all;
}
.tile-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 10px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8));
  color: #fff;
  pointer-events: none;
}
.tile-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; word-break: break-all; }
.tile-year { font-size: 11.5px; opacity: .85; margin-top: 2px; }

/* ---------- 评分与标签（卡片） ---------- */
.card-rating { color: var(--star); font-weight: 700; font-size: 14px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-chip {
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.6;
}
.tag-chip:hover { border-color: var(--accent); }
.chip .cnt { font-size: 11.5px; opacity: .75; margin-left: 2px; }

/* ---------- 标签预设（弹窗） ---------- */
.tag-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.preset-chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  cursor: pointer;
}
.preset-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ---------- 主页：开播纪念日 ---------- */
.anniv-wrap { max-width: 640px; margin: 18px auto 0; display: flex; flex-direction: column; gap: 10px; }
.anniv-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: linear-gradient(120deg, #fff1d6, #ffe3ec);
  border: 1px solid #f0d48a;
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .anniv-card {
  background: linear-gradient(120deg, #3a2f16, #3d2430);
  border-color: #6b5518;
}
.anniv-cover { width: 54px; height: 72px; object-fit: cover; border-radius: 8px; flex: 0 0 54px; background: var(--cover-bg); }
.anniv-text { font-size: 15px; line-height: 1.6; }
.anniv-text .anniv-title { font-weight: 700; }
.anniv-list {
  background: var(--hero-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.anniv-list h4 { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.anniv-list ul { margin: 0; padding-left: 20px; line-height: 1.9; font-size: 14px; }

/* ---------- 主页：随机重温 ---------- */
.home-random { max-width: 640px; margin: 20px auto 0; text-align: center; }
.random-card {
  margin-top: 14px;
  background: var(--hero-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  gap: 16px;
  text-align: left;
}
.random-cover {
  width: 110px;
  flex: 0 0 110px;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--cover-bg);
}
.random-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.random-cover-empty {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 10px; text-align: center;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; font-size: 13px;
}
.random-info { flex: 1; min-width: 0; }
.random-info h4 { margin: 0 0 8px; font-size: 18px; line-height: 1.4; word-break: break-all; }
.random-meta { color: var(--muted); font-size: 13.5px; line-height: 1.85; }
.random-tags { margin-top: 8px; }
.random-again { margin-top: 10px; }

/* ---------- 想看清单 ---------- */
.wl-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.wl-add input {
  flex: 1 1 220px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--input-bg);
  color: var(--text);
}
.wl-add #wl-note { flex: 1 1 160px; }
.wl-list { display: flex; flex-direction: column; gap: 8px; }
.wl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.wl-main { min-width: 0; }
.wl-name { font-weight: 600; font-size: 15px; word-break: break-all; }
.wl-note { color: var(--muted); font-size: 13px; margin-top: 2px; word-break: break-all; }
.wl-side { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.wl-date { color: var(--muted); font-size: 12px; white-space: nowrap; margin-right: 4px; }

/* ---------- 年度报告海报 ---------- */
.poster-controls { margin-top: 18px; }
.poster-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.poster-bar select {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
}
.poster-canvas {
  margin-top: 14px;
  width: min(100%, 420px);
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: block;
  background: var(--card);
}

@media (max-width: 560px) {
  .wall { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
  .random-card { flex-direction: column; align-items: center; text-align: center; }
  .random-info { text-align: center; }
  .wl-side { flex-wrap: wrap; justify-content: flex-end; }
}

/* ---------- 没看完 / 续集状态徽标 ---------- */
.tag.unfinished { background: #e2e3f1; color: #4a4e7a; font-weight: 700; }
[data-theme="dark"] .tag.unfinished { background: #33365a; color: #c6c9f2; }
.tag.aired { background: #dff3e2; color: #23703a; font-weight: 700; }
[data-theme="dark"] .tag.aired { background: #1f4030; color: #9fd8ae; }
.tag.scheduled { background: #fdeeda; color: #9a6410; font-weight: 700; }
[data-theme="dark"] .tag.scheduled { background: #4a3410; color: #f2c879; }
.tag.watched-badge { background: #dff3e2; color: #23703a; font-weight: 700; }
[data-theme="dark"] .tag.watched-badge { background: #1f4030; color: #9fd8ae; }
#unf-tab-count, #seq-tab-count { font-size: 11px; }

/* ---------- 系列（全部目录系列视图 + 详情） ---------- */
.series-tile { cursor: pointer; }
.tile-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  box-shadow: var(--shadow);
  z-index: 2;
}
.series-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.series-title { margin: 0; font-size: 19px; }
.series-head .result-count { margin: 0; }

/* ---------- 续集待看 ---------- */
.seq-group { margin-bottom: 22px; }
.seq-group-title { margin: 18px 0 10px; font-size: 16px; }
.seq-group-title .from { color: var(--muted); font-weight: 400; font-size: 13.5px; margin-right: 6px; }
.seq-actions { margin-top: auto; display: flex; gap: 6px; justify-content: flex-end; }
.seq-actions .btn { padding: 6px 10px; font-size: 13px; }

/* ---------- 媒体表单（与记录表单同款） ---------- */
#media-form { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
#media-form h3 { margin: 0 0 4px; }
#media-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
#media-form label.checkbox { flex-direction: row; align-items: center; color: var(--text); }
#media-form input[type="text"], #media-form input:not([type]),
#media-form input[type="number"], #media-form input[type="date"], #media-form select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
  background: var(--input-bg);
  width: 100%;
}



/* ---------- 全局微动画（克制灵动；尊重减少动态偏好） ---------- */
/* 视图切换：淡入 + 微微上滑 */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
main > section:not(.hidden) { animation: viewIn .3s ease both; }

/* 按钮 / 筛选片按压回弹 */
.btn, .chip, .preset-chip, .tag-chip {
  transition: transform .1s ease, background .15s, color .15s, border-color .15s;
}
.btn:active, .chip:active, .preset-chip:active, .tag-chip:active { transform: scale(.95); }

/* 卡片悬停轻抬（仅真鼠标设备） */
@media (hover: hover) and (pointer: fine) {
  .card, .tile, .wl-row, .visit-row, .stat-card {
    transition: transform .18s ease, box-shadow .18s ease;
  }
  .card:hover, .tile:hover, .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(180, 90, 40, .16);
  }
  [data-theme="dark"] .card:hover, [data-theme="dark"] .tile:hover, [data-theme="dark"] .stat-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, .45);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
