:root {
  --paper: #f6f1e8;
  --paper-strong: #fffdf8;
  --ink: #1c2d2d;
  --ink-soft: #516566;
  --line: rgba(24, 131, 131, 0.18);
  --teal: #188383;
  --teal-deep: #0f5e5e;
  --teal-mist: #e3f0ef;
  --gold: #c68b58;
  --shadow: 0 28px 60px rgba(15, 40, 40, 0.12);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max-width: 1240px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(198, 139, 88, 0.15), transparent 34%),
    radial-gradient(circle at top right, rgba(24, 131, 131, 0.16), transparent 30%),
    linear-gradient(180deg, #fbf8f2 0%, #f4efe6 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
}

body.is-modal-open {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

.page-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.app-notice {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(24, 131, 131, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  line-height: 1.7;
}

.app-notice code {
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(24, 131, 131, 0.08);
  color: var(--teal-deep);
}

.app-notice[data-variant="success"] {
  display: none;
}

.app-notice[data-variant="warning"] {
  border-color: rgba(198, 139, 88, 0.24);
  background: rgba(255, 248, 238, 0.84);
  color: #7a5739;
}

.app-notice[data-variant="error"] {
  border-color: rgba(217, 83, 79, 0.22);
  background: rgba(255, 243, 242, 0.9);
  color: #8d4743;
}

.hero {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 24px 28px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.88), rgba(255, 251, 246, 0.74)),
    linear-gradient(130deg, rgba(24, 131, 131, 0.12), rgba(198, 139, 88, 0.1));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--teal);
}

.hero h1,
.section-heading h2,
.preview-shell h2,
.timeline-card h3 {
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 4.2vw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: none;
  white-space: nowrap;
}

.hero-stats {
  margin-top: 18px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1.6fr) minmax(160px, 0.9fr);
}

.stat-card {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(24, 131, 131, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

.stat-value {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.1rem, 1.9vw, 1.55rem);
  line-height: 1.22;
  word-break: break-word;
}

.stat-card:first-child .stat-value {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.layout {
  display: block;
  margin-top: 22px;
}

.subpage-header,
.discussion-panel {
  position: relative;
  padding: 26px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.subpage-header {
  display: grid;
  gap: 18px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  text-decoration: none;
  color: var(--teal-deep);
  font-size: 0.95rem;
}

.back-link::before {
  content: "<";
  opacity: 0.72;
}

.subpage-header-main {
  display: grid;
  gap: 22px;
}

.subpage-meta {
  display: grid;
  gap: 12px;
}

.subpage-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
}

.timeline-panel,
.discussion-sheet {
  position: relative;
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.section-heading {
  display: flex;
  justify-content: flex-start;
  gap: 18px;
  align-items: flex-end;
}

.section-heading h2,
.preview-shell h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
}

.timeline {
  position: relative;
  margin-top: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 13px;
  width: 2px;
  background:
    linear-gradient(180deg, rgba(24, 131, 131, 0.6), rgba(24, 131, 131, 0.14));
}

.month-group + .month-group {
  margin-top: 26px;
}

.month-header {
  position: sticky;
  top: 10px;
  z-index: 2;
  margin-bottom: 14px;
  padding-left: 36px;
}

.month-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(15, 94, 94, 0.1);
  color: var(--teal-deep);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.month-items {
  display: grid;
  gap: 14px;
}

.timeline-item {
  position: relative;
  padding-left: 36px;
  display: grid;
  gap: 14px;
}

.timeline-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 18px 18px 20px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 248, 242, 0.92));
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.timeline-card:hover,
.timeline-card:focus-visible {
  transform: translateX(4px);
  border-color: rgba(24, 131, 131, 0.26);
  box-shadow: 0 14px 28px rgba(15, 40, 40, 0.1);
  outline: none;
}

.timeline-card.is-disabled {
  pointer-events: none;
  opacity: 0.6;
}

.item-dot {
  position: absolute;
  left: -29px;
  top: 22px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  box-shadow: 0 0 0 6px rgba(24, 131, 131, 0.12);
}

.item-topline,
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.item-topline {
  align-items: baseline;
}

.item-date {
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--teal-deep);
}

.item-relative {
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.item-cover-shell {
  margin: 14px 0 18px;
  aspect-ratio: 900 / 383;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15, 94, 94, 0.14), rgba(198, 139, 88, 0.14));
  border: 1px solid rgba(24, 131, 131, 0.08);
}

.item-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-card h3 {
  margin: 0;
  font-size: clamp(1.72rem, 3.2vw, 2.28rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.item-subtitle {
  margin: 2px 0 0;
  color: rgba(28, 45, 45, 0.52);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-size: clamp(1.72rem, 3.2vw, 2.28rem);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
}

.discussion-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(24, 131, 131, 0.18);
  background:
    linear-gradient(180deg, rgba(229, 245, 245, 0.78), rgba(255, 255, 255, 0.92));
  color: var(--teal-deep);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.discussion-trigger::after {
  content: ">";
  font-size: 0.92rem;
  opacity: 0.72;
}

.discussion-trigger:hover,
.discussion-trigger:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(24, 131, 131, 0.28);
  box-shadow: 0 10px 20px rgba(15, 40, 40, 0.08);
  outline: none;
}

.discussion-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.discussion-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 38, 38, 0.42);
  backdrop-filter: blur(8px);
}

.discussion-sheet {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(calc(100% - 28px), 760px);
  max-height: min(86vh, 920px);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.discussion-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.discussion-topbar h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
}

.discussion-date {
  margin: 0;
  font-size: 0.96rem;
  color: var(--ink-soft);
}

.discussion-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.close-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(24, 131, 131, 0.16);
  background: rgba(255, 255, 255, 0.7);
  color: var(--teal-deep);
  cursor: pointer;
}

.preview-link,
.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.preview-link,
.submit-button {
  background: var(--teal-deep);
  color: #fff;
}

.preview-link:hover,
.preview-link:focus-visible,
.submit-button:hover,
.submit-button:focus-visible {
  transform: translateY(-1px);
}

.preview-link.disabled {
  background: rgba(74, 74, 74, 0.1);
  color: rgba(74, 74, 74, 0.5);
  pointer-events: none;
}

.submit-button {
  border-color: transparent;
  cursor: pointer;
}

.submit-button:disabled {
  background: rgba(74, 74, 74, 0.2);
  color: rgba(255, 255, 255, 0.75);
  cursor: not-allowed;
}

.comment-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(24, 131, 131, 0.08);
  color: var(--teal-deep);
  font-size: 0.88rem;
}

.discussion-panel {
  margin-top: 22px;
}

.discussion-panel-top {
  display: grid;
  gap: 10px;
}

.discussion-panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.discussion-panel-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
}

.comment-inline-count {
  font-size: 1rem;
  color: var(--ink-soft);
}

.comment-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  max-height: 320px;
  overflow: auto;
  padding-right: 6px;
}

.comment-empty,
.comment-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 244, 238, 0.9));
  border: 1px solid rgba(24, 131, 131, 0.1);
}

.comment-empty p,
.comment-card p {
  margin: 0;
  line-height: 1.7;
}

.comment-empty p {
  color: var(--ink-soft);
}

.comment-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.comment-card-topline strong {
  color: var(--ink);
}

.comment-form {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.comment-field {
  display: grid;
  gap: 8px;
}

.comment-field span {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.comment-field input,
.comment-field textarea {
  width: 100%;
  border: 1px solid rgba(24, 131, 131, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 15px;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.comment-field input:focus,
.comment-field textarea:focus {
  outline: 2px solid rgba(24, 131, 131, 0.18);
  border-color: rgba(24, 131, 131, 0.3);
}

.comment-form-footer {
  display: grid;
  gap: 10px;
}

.comment-status {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.comment-status {
  min-height: 1.6em;
}

.comment-status[data-variant="success"] {
  color: var(--teal-deep);
}

.comment-status[data-variant="error"] {
  color: #b34f4b;
}

.comment-status[data-variant="neutral"] {
  color: var(--ink-soft);
}

.hidden {
  display: none;
}

.empty-state {
  margin-top: 20px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(229, 245, 245, 0.55);
  color: var(--ink-soft);
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-header-actions .submit-button,
.admin-header-actions .preview-link {
  min-height: 42px;
}

.admin-panel {
  margin-top: 22px;
}

.admin-section-heading {
  margin-bottom: 16px;
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(24, 131, 131, 0.14);
  background: rgba(255, 255, 255, 0.82);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(24, 131, 131, 0.1);
  font-size: 0.92rem;
}

.admin-table th {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.admin-table tbody tr:hover {
  background: rgba(229, 245, 245, 0.32);
}

.admin-link {
  color: var(--teal-deep);
  word-break: break-all;
}

.admin-muted {
  color: var(--ink-soft);
}

.admin-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(24, 131, 131, 0.2);
  background: rgba(229, 245, 245, 0.64);
  color: var(--teal-deep);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-action-button-neutral {
  border-color: rgba(24, 131, 131, 0.2);
  color: var(--teal-deep);
  background: rgba(229, 245, 245, 0.58);
}

.admin-action-button-danger {
  border-color: rgba(217, 83, 79, 0.28);
  color: #a2423f;
  background: rgba(255, 243, 242, 0.84);
}

.admin-action-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.admin-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.admin-status-chip-ok {
  background: rgba(24, 131, 131, 0.12);
  color: var(--teal-deep);
}

.admin-status-chip-error {
  background: rgba(217, 83, 79, 0.12);
  color: #a2423f;
}

.admin-status-chip-neutral {
  background: rgba(74, 74, 74, 0.12);
  color: #5f5f5f;
}

.admin-status-chip-info {
  background: rgba(24, 131, 131, 0.12);
  color: var(--teal-deep);
}

.admin-edit-layout {
  display: grid;
  gap: 18px;
}

.admin-form-panel {
  margin-top: 22px;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-field-hint {
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.6;
}

.admin-form-footer {
  gap: 12px;
}

.admin-readonly-panel {
  margin-top: 0;
}

.admin-readonly-grid {
  margin: 16px 0 0;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-readonly-grid div {
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(24, 131, 131, 0.14);
  background: rgba(255, 255, 255, 0.74);
}

.admin-readonly-grid dt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.admin-readonly-grid dd {
  margin: 8px 0 0;
  line-height: 1.6;
  word-break: break-word;
}

.admin-readonly-wide {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 14px;
  }

  .hero,
  .timeline-panel,
  .discussion-sheet,
  .subpage-header,
  .discussion-panel {
    padding: 20px 18px;
    border-radius: 24px;
  }

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

  .hero h1 {
    max-width: none;
    white-space: normal;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    left: 10px;
  }

  .timeline-item {
    padding-left: 28px;
  }

  .item-dot {
    left: -23px;
  }

  .timeline-card h3 {
    font-size: 1.42rem;
  }

  .item-subtitle {
    font-size: 1.42rem;
  }

  .discussion-sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 90vh;
    transform: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .discussion-topbar,
  .comment-card-topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .subpage-header-main,
  .discussion-panel-heading {
    gap: 14px;
  }

  .admin-header-actions {
    width: 100%;
  }

  .admin-header-actions .submit-button,
  .admin-header-actions .preview-link {
    flex: 1 1 0;
  }

  .admin-table {
    min-width: 880px;
  }

  .admin-readonly-grid {
    grid-template-columns: 1fr;
  }
}
