:root {
  --page-bg: #f5eee0;
  --page-bg-deep: #eadcc5;
  --surface: rgba(255, 251, 244, 0.88);
  --surface-strong: #fffaf2;
  --ink: #2f241d;
  --muted: #6c5a4f;
  --border: rgba(101, 73, 53, 0.18);
  --accent: #a14c28;
  --accent-strong: #7e3517;
  --accent-soft: #ddc3a5;
  --shadow: 0 20px 45px rgba(73, 44, 18, 0.08);
  --serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 35%),
    radial-gradient(circle at 85% 20%, rgba(204, 150, 104, 0.18), transparent 20%),
    linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-deep) 100%);
  font-family: var(--sans);
}

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

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

.page-shell {
  position: relative;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 238, 224, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(101, 73, 53, 0.08);
}

.brand-mark {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.navbar {
  padding: 0.95rem 0;
}

.section-pad {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.hero-wrap {
  padding: 2rem 0 1rem;
}

.hero-panel,
.feature-card,
.poem-card,
.detail-panel,
.filter-panel,
.empty-state {
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 2rem;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -4rem -4rem auto;
  width: 14rem;
  height: 14rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(161, 76, 40, 0.18), transparent 70%);
}

.eyebrow,
.card-kicker {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-title,
.detail-title,
.poem-card-title,
.section-heading h1,
.section-heading h2 {
  font-family: var(--serif);
}

.hero-copy {
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.hero-pill-row,
.hero-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-status,
.fhl-side-note,
.session-objective-item,
.fhl-inline-note {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface-strong);
}

.hero-status,
.fhl-side-note {
  padding: 1rem 1.1rem;
}

.fhl-entry-card .fhl-guide-list {
  margin-bottom: 0;
}

.fhl-home-steps {
  display: grid;
  gap: 0.85rem;
}

.fhl-home-step {
  display: flex;
  align-items: start;
  gap: 0.85rem;
}

.fhl-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 1.9rem;
  border-radius: 50%;
  background: rgba(161, 76, 40, 0.12);
  color: var(--accent-strong);
  font-weight: 700;
}

.stats-grid .stat-card,
.future-card {
  height: 100%;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface-strong);
  padding: 1.25rem;
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

.feature-card,
.filter-panel,
.detail-panel,
.empty-state {
  padding: 1.5rem;
}

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

.btn-accent:hover,
.btn-accent:focus {
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.author-chip {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  font-weight: 500;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.poem-card {
  padding: 1.35rem;
}

.poem-meta,
.poem-submeta,
.detail-note,
.meta-list dt {
  color: var(--muted);
}

.poem-card-title a {
  color: var(--ink);
}

.poem-preview,
.poem-body {
  font-family: var(--serif);
}

.poem-preview {
  margin: 1rem 0 0;
  white-space: pre-wrap;
  font-size: 1rem;
  line-height: 1.9;
  background: transparent;
  color: var(--ink);
}

.detail-title {
  margin-bottom: 0.5rem;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.poem-body {
  font-size: 1.22rem;
  line-height: 2.2;
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 248, 239, 0.7));
}

.poem-line + .poem-line {
  margin-top: 0.35rem;
}

.meta-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.meta-list dt {
  font-weight: 700;
}

.meta-list dd {
  margin-bottom: 0;
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
}

.fhl-summary-card,
.fhl-turn {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface-strong);
  padding: 1.15rem;
}

.fhl-summary-card {
  height: 100%;
}

.difficulty-grid {
  display: grid;
  gap: 1rem;
}

.difficulty-option {
  display: block;
  cursor: pointer;
}

.difficulty-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.difficulty-option-body {
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface-strong);
  padding: 1.1rem;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.difficulty-option:hover .difficulty-option-body {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(73, 44, 18, 0.08);
}

.difficulty-option:has(.difficulty-radio:checked) .difficulty-option-body {
  border-color: rgba(126, 53, 23, 0.6);
  box-shadow: inset 0 0 0 1px rgba(126, 53, 23, 0.2);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(250, 241, 229, 0.96));
}

.difficulty-meta,
.fhl-guide-list {
  display: grid;
  gap: 0.5rem;
}

.fhl-start-grid,
.session-objective-grid {
  display: grid;
  gap: 1rem;
}

.fhl-start-card {
  display: block;
  height: 100%;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface-strong);
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.fhl-start-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(73, 44, 18, 0.08);
  color: inherit;
}

.fhl-start-card.is-primary {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(249, 238, 222, 0.98));
  border-color: rgba(126, 53, 23, 0.25);
}

.fhl-start-card.is-link {
  text-decoration: none;
}

.session-objective-item {
  padding: 1rem;
}

.difficulty-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.command-chip-button {
  display: inline-flex;
  flex-direction: column;
  align-items: start;
  gap: 0.2rem;
  min-width: 5.5rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.command-chip-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(126, 53, 23, 0.3);
}

.command-chip-button.is-selected {
  border-color: rgba(126, 53, 23, 0.6);
  background: rgba(161, 76, 40, 0.08);
}

.command-chip-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.command-chip-main {
  font-weight: 700;
}

.command-chip-sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.fhl-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.fhl-score-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(161, 76, 40, 0.12);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.fhl-timeline {
  display: grid;
  gap: 1rem;
}

.fhl-turn {
  position: relative;
}

.fhl-turn.is-ai {
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.95), rgba(252, 243, 233, 0.95));
}

.fhl-turn.is-rejected {
  border-style: dashed;
  background: rgba(255, 248, 244, 0.9);
}

.fhl-turn-line {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.8;
}

.fhl-details {
  padding: 0.95rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 1rem;
  background: rgba(255, 250, 242, 0.72);
}

.fhl-details summary {
  cursor: pointer;
  font-weight: 700;
}

.fhl-inline-note {
  padding: 0.85rem 1rem;
  color: var(--muted);
}

.dashboard-token {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent-strong);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.empty-state {
  text-align: center;
}

.app-notice-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  display: grid;
  gap: 0.75rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.app-notice {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: rgba(255, 250, 242, 0.96);
  box-shadow: var(--shadow);
  color: var(--ink);
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-notice.is-success {
  border-color: rgba(126, 53, 23, 0.28);
}

.site-footer {
  padding: 1.5rem 0 2rem;
  color: var(--muted);
}

@media (max-width: 991.98px) {
  .hero-panel {
    padding: 1.5rem;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .poem-body {
    font-size: 1.08rem;
    line-height: 2;
  }

  .hero-action-row .btn {
    width: 100%;
  }

  .fhl-turn-line {
    font-size: 1.12rem;
  }

  .app-notice-root {
    left: 1rem;
    width: auto;
  }
}

@media (min-width: 768px) {
  .difficulty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fhl-start-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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