/* ==========================================================================
   Xiaowen Redesign: Douban Minimalism × cc-our-story
   Light & Dark Theme CSS Variables, Responsive Layout & Components
   ========================================================================== */

:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-subtle: #f2f4f0;
  --border: #e5e8e2;
  --border-strong: #d2d7ce;
  --text: #1f2320;
  --text-secondary: #4a524d;
  --text-muted: #768079;
  --accent: #2e9b4b;
  --accent-hover: #25803d;
  --accent-soft: rgba(46, 155, 75, 0.1);
  --rose: #d46a6a;
  --rose-soft: rgba(212, 106, 106, 0.11);
  --highlight-bg: rgba(246, 211, 101, 0.35);
  --shadow-sm: 0 1px 2px rgba(20, 26, 22, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 26, 22, 0.07);
  --shadow-lg: 0 18px 42px rgba(20, 26, 22, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, Cambria, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #141715;
  --surface: #1d211e;
  --surface-subtle: #252b27;
  --border: #2e3530;
  --border-strong: #3e4741;
  --text: #e9eee9;
  --text-secondary: #c2cbc4;
  --text-muted: #8b968e;
  --accent: #47ba67;
  --accent-hover: #58c977;
  --accent-soft: rgba(71, 186, 103, 0.16);
  --rose: #e58585;
  --rose-soft: rgba(229, 133, 133, 0.16);
  --highlight-bg: rgba(230, 178, 60, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

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

img {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

/* ==========================================================================
   Layout Container & Header (Douban-minimal Top Bar)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.site-header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  min-width: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  flex-shrink: 0;
}

.brand-link:hover {
  color: var(--text);
  opacity: 0.9;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background-color: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
}

.brand-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.25rem 0;
  position: relative;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
  font-weight: 600;
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.search-form-inline {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 185px;
  padding: 0.4rem 2rem 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--surface-subtle);
  font-size: 0.82rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, width 0.2s ease, background-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--accent);
  background-color: var(--surface);
  width: 220px;
}

.search-submit {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.2rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.92rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

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

.mobile-nav {
  display: none;
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 0.5rem 1.25rem;
  gap: 1.1rem;
  overflow-x: auto;
  white-space: nowrap;
  background-color: var(--surface);
}

.page-container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 5.5rem;
}

.two-col-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 1.75rem;
  align-items: start;
}

.main-col {
  min-width: 0;
}

.side-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ==========================================================================
   Cards, Buttons, Badges, Typography
   ========================================================================== */

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-compact {
  padding: 1.05rem 1.2rem;
}

.card-hover {
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.card-hover:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.serif-heading {
  font-family: var(--font-serif);
  letter-spacing: 0.01em;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.section-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.48rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

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

.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

.btn-rose {
  background-color: var(--rose-soft);
  border-color: transparent;
  color: var(--rose);
}

.btn-rose:hover {
  border-color: var(--rose);
  color: var(--rose);
}

.btn-sm {
  padding: 0.32rem 0.78rem;
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.4;
}

.badge-green {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.badge-rose {
  background-color: var(--rose-soft);
  color: var(--rose);
}

.badge-muted {
  background-color: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--text-muted);
}

/* ==========================================================================
   Flash Messages
   ========================================================================== */

.messages-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.alert {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
}

.alert-success {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent);
}

.alert-error {
  border-color: var(--rose);
  background-color: var(--rose-soft);
  color: var(--rose);
}

/* ==========================================================================
   Home Hero & Stats (cc-our-story inspired, calm Douban feel)
   ========================================================================== */

.hero-card {
  margin-bottom: 1.5rem;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.couple-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar-pair {
  display: flex;
  align-items: center;
}

.avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  border: 2px solid var(--surface);
}

.avatar-circle + .avatar-circle {
  margin-left: -10px;
}

.avatar-green {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.avatar-rose {
  background-color: var(--rose-soft);
  color: var(--rose);
}

.hero-names {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.heart-icon {
  color: var(--rose);
  display: inline-block;
  animation: heartBeat 2.2s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.16); }
}

.hero-tagline {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.timer-box {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.05rem;
  text-align: right;
  min-width: 220px;
}

.timer-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.timer-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin: 0.1rem 0;
}

.timer-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.stat-tile {
  display: block;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.stat-tile:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

.stat-tile-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.stat-tile-value {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

/* ==========================================================================
   Post List & Post Reading Detail
   ========================================================================== */

.post-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card-title {
  margin: 0.45rem 0 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  line-height: 1.4;
}

.post-card-title a {
  color: var(--text);
}

.post-card-title a:hover {
  color: var(--accent);
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-excerpt {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.tag-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Post Detail Prose */
.article-shell {
  position: relative;
  overflow: hidden;
}

.article-header {
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.4rem;
}

.article-title {
  margin: 0.65rem 0 0.55rem;
  font-family: var(--font-serif);
  font-size: 1.65rem;
  line-height: 1.35;
}

.prose {
  font-size: 0.96rem;
  line-height: 1.85;
  color: var(--text);
  word-break: break-word;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-serif);
  margin: 1.6em 0 0.6em;
  line-height: 1.4;
}

.prose p {
  margin: 0 0 1.05em;
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--accent);
  background-color: var(--surface-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
  margin: 0 0 1.1em;
}

.prose img {
  display: block;
  border-radius: var(--radius-sm);
  margin: 1rem auto;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prose img:hover {
  box-shadow: var(--shadow-md);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.86rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border) !important;
  padding: 0.55rem 0.75rem !important;
  text-align: left;
}

.prose th {
  background-color: var(--surface-subtle);
  font-weight: 600;
}

.prose pre {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  overflow-x: auto;
  font-size: 0.84rem;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.toc-widget .toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.toc-widget .toc ul ul {
  padding-left: 0.85rem;
  margin-top: 0.25rem;
}

.toc-widget .toc a {
  color: var(--text-secondary);
}

.toc-widget .toc a:hover {
  color: var(--accent);
}

.highlighted {
  background-color: var(--highlight-bg);
  color: var(--text);
  padding: 0 0.15rem;
  border-radius: 3px;
  font-weight: 600;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn.is-current {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */

.widget-title {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.84rem;
}

.widget-list a {
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

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

/* ==========================================================================
   Timeline (点点滴滴)
   ========================================================================== */

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.78rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text-secondary);
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pill.is-active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.year-group {
  margin-top: 1.25rem;
}

.year-details {
  border-radius: var(--radius-md);
}

.year-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}

.year-summary::-webkit-details-marker {
  display: none;
}

.year-summary:hover {
  background-color: var(--surface-subtle);
}

.year-chevron {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.18s ease, color 0.15s ease;
}

.year-details[open] > .year-summary .year-chevron {
  transform: rotate(90deg);
  color: var(--accent);
}

.year-divider {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.year-details:not([open]) > .year-divider {
  margin-bottom: 0;
}

.year-label {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.year-line {
  flex: 1;
  height: 1px;
  background-color: var(--border);
}

.timeline-track {
  border-left: 2px solid var(--border);
  margin-left: 0.55rem;
  padding-left: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -1.72rem;
  top: 1.25rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-item-compact .timeline-dot {
  top: 0.35rem;
}

.timeline-title {
  margin: 0.3rem 0 0.25rem;
  font-size: 0.98rem;
  font-weight: 600;
}

.timeline-desc {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  white-space: pre-line;
  line-height: 1.7;
}

/* ==========================================================================
   Cash Jar Dashboard (储蓄罐)
   ========================================================================== */

.jar-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.1rem 0;
  overflow-x: auto;
  white-space: nowrap;
}

.jar-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.15rem;
}

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background-color: var(--surface-subtle);
  overflow: hidden;
  margin-top: 0.55rem;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background-color: var(--accent);
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-card-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th,
.data-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background-color: var(--surface-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background-color: var(--surface-subtle);
}

.text-right {
  text-align: right !important;
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
}

/* ==========================================================================
   Forms, Modal, Lightbox & Login
   ========================================================================== */

.form-field {
  margin-bottom: 0.9rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background-color: var(--surface-subtle);
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--accent);
  background-color: var(--surface);
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: rgba(12, 16, 14, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-panel {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

/* Lightbox */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background-color: rgba(10, 12, 11, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-backdrop.is-open {
  display: flex;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.85rem;
  box-shadow: var(--shadow-md);
}

.login-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-brand .brand-mark {
  width: 44px;
  height: 44px;
  font-size: 1.35rem;
  margin: 0 auto 0.7rem;
}

/* ==========================================================================
   Floating Mini BGM Bar
   ========================================================================== */

.bgm-bar {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.75rem 0.42rem 0.48rem;
  border-radius: 999px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 0.78rem;
}

.bgm-play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background-color: var(--accent);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.bgm-title {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.bgm-next-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 0.15rem 0.25rem;
}

.bgm-next-btn:hover {
  color: var(--accent);
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Quiet Douban-style Footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-sep {
  opacity: 0.45;
}

/* Confetti Canvas */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 80;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 860px) {
  .two-col-layout {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }

  .search-input {
    width: 135px;
  }

  .search-input:focus {
    width: 165px;
  }

  .timer-box {
    width: 100%;
    text-align: left;
  }

  .card {
    padding: 1.1rem 1.15rem;
  }

  .article-title {
    font-size: 1.38rem;
  }

  .bgm-title {
    max-width: 110px;
  }
}
