/* ==========================================================================
   Aaron's Space · 个人数字书房 · Editorial Bento Stylesheet
   ========================================================================== */

:root,
[data-theme="light"] {
  --bg: #F7F4EE;
  --bg-subtle: #EFEAE0;
  --surface: #FFFFFF;
  --surface-muted: #F9F7F2;
  --ink: #1F2328;
  --ink-soft: #424852;
  --muted: #6C737F;
  --border: rgba(31, 35, 40, 0.10);
  --border-strong: rgba(31, 35, 40, 0.18);

  --accent-poetry: #A63429;
  --accent-poetry-soft: rgba(166, 52, 41, 0.08);
  --accent-english: #1E3A5F;
  --accent-english-soft: rgba(30, 58, 95, 0.08);
  --accent-arcade: #C45D3E;
  --accent-arcade-soft: rgba(196, 93, 62, 0.10);

  --shadow-sm: 0 1px 3px rgba(31, 35, 40, 0.04), 0 1px 2px rgba(31, 35, 40, 0.03);
  --shadow-card: 0 10px 30px rgba(31, 35, 40, 0.05), 0 2px 6px rgba(31, 35, 40, 0.03);
  --shadow-hover: 0 16px 38px rgba(31, 35, 40, 0.09), 0 4px 10px rgba(31, 35, 40, 0.04);
}

[data-theme="dark"] {
  --bg: #131518;
  --bg-subtle: #191C21;
  --surface: #1B1F25;
  --surface-muted: #22272F;
  --ink: #EAE6DF;
  --ink-soft: #C7C1B8;
  --muted: #939AA6;
  --border: rgba(234, 230, 223, 0.10);
  --border-strong: rgba(234, 230, 223, 0.18);

  --accent-poetry: #DF6B5E;
  --accent-poetry-soft: rgba(223, 107, 94, 0.14);
  --accent-english: #7AA7E0;
  --accent-english-soft: rgba(122, 167, 224, 0.14);
  --accent-arcade: #E07A5F;
  --accent-arcade-soft: rgba(224, 122, 95, 0.16);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 14px 36px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 20px 48px rgba(0, 0, 0, 0.48);
}

:root {
  --font-serif: "Newsreader", "Noto Serif SC", Georgia, "Songti SC", serif;
  --font-sans: "Plus Jakarta Sans", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(196, 93, 62, 0.05) 0%, transparent 38%),
    radial-gradient(circle at 88% 14%, rgba(30, 58, 95, 0.05) 0%, transparent 40%);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  transition: background-color 0.2s ease, color 0.2s ease;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent-arcade);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
  flex-shrink: 0;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-arcade);
}

.site-brand__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.site-brand__subtitle {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

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

.nav-jump {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav-jump:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}

.btn-theme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.btn-theme:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

/* ---------- Hero Intro Strip ---------- */
.hero-strip {
  padding: 36px 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.hero-strip__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.hero-strip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-arcade);
}

.hero-strip__heading {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.hero-strip__desc {
  margin: 8px 0 0;
  font-size: 0.96rem;
  color: var(--ink-soft);
}

.stat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-pill__num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.stat-pill__label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Bento Grid ---------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding-bottom: 44px;
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.bento-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

.card--poetry {
  border-top: 3px solid var(--accent-poetry);
}

.card--english {
  border-top: 3px solid var(--accent-english);
}

.card--arcade {
  grid-column: 1 / -1;
  border-top: 3px solid var(--accent-arcade);
}

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

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

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

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

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

.card-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 3px;
}

/* ---------- Poetry Card ---------- */
.poetry-cover-link {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.poetry-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.poetry-cover-link:hover .poetry-cover-img {
  transform: scale(1.03);
}

.poetry-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.48rem;
  font-weight: 700;
  line-height: 1.3;
}

.poetry-meta {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.poetry-quote {
  margin: 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent-poetry);
  background: var(--surface-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--ink);
}

.recent-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.recent-strip__label {
  font-size: 0.78rem;
  color: var(--muted);
}

.recent-chip {
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  transition: border-color 0.16s ease, color 0.16s ease;
}

.recent-chip:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

/* ---------- English Card ---------- */
.english-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}

.english-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

.english-subtitle {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.word-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-pill {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.16s ease;
}

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

.word-pill.is-active {
  background: var(--accent-english);
  border-color: var(--accent-english);
  color: #FFFFFF;
}

[data-theme="dark"] .word-pill.is-active {
  color: #101824;
}

.word-preview-box {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  min-height: 108px;
}

.word-preview-box__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.word-preview-box__headword {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
}

.word-preview-box__phonetic {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: 6px;
}

.word-preview-box__cefr {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-english);
  background: var(--accent-english-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.word-preview-box__meaning {
  margin: 7px 0 0;
  font-size: 0.92rem;
  color: var(--ink);
}

.word-preview-box__collocations {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

/* ---------- Card Actions ---------- */
.card-actions {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--ink);
  transition: transform 0.16s ease, opacity 0.16s ease;
}

[data-theme="dark"] .btn-primary {
  color: #131518;
}

.btn-primary:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.btn-primary--poetry {
  background: var(--accent-poetry);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-primary--poetry {
  color: #1B1211;
}

.btn-primary--english {
  background: var(--accent-english);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-primary--english {
  color: #0F1722;
}

.btn-primary--arcade {
  background: var(--accent-arcade);
  color: #FFFFFF;
}

[data-theme="dark"] .btn-primary--arcade {
  color: #1A1210;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  transform: translateY(-1px);
}

/* ---------- Arcade Card ---------- */
.arcade-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.arcade-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.48rem;
  font-weight: 700;
}

.arcade-desc {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.arcade-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.arcade-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.game-mini-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-left: 4px solid var(--game-accent, var(--accent-arcade));
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.game-mini-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.game-mini-card__icon {
  font-size: 1.65rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.game-mini-card__body {
  min-width: 0;
  flex: 1;
}

.game-mini-card__title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-mini-card__cat {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--muted);
}

.lucky-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-arcade-soft);
  border: 1px dashed var(--accent-arcade);
}

.lucky-banner.hidden {
  display: none;
}

.lucky-banner__info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

/* ---------- Empty State ---------- */
.empty-note {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 36px;
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }

  .card--arcade {
    grid-column: auto;
  }

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

@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  .nav-jump {
    display: none;
  }

  .bento-card {
    padding: 20px;
  }

  .arcade-grid {
    grid-template-columns: 1fr;
  }
}
