:root {
  color-scheme: light;
  --page: #edf2f4;
  --ink: #202a37;
  --muted: #576978;
  --accent: #426777;
  --line: #cbd6dc;
  --white: #fff;
  --serif: "Noto Serif CJK SC", "Songti SC", STSong, SimSun, Georgia, serif;
  --sans: system-ui, "Microsoft YaHei", sans-serif;
  --brand-serif: "Noto Serif SC", "Songti SC", STSong, SimSun, Georgia, serif;
  --shadow: 0 18px 40px #2a3c4e12;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.65 var(--sans); }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.archive-embers { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.archive-embers span {
  position: absolute;
  bottom: 0;
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 1.5);
  border-radius: 50%;
  background: #ffb35e;
  box-shadow: 0 0 5px #ff6a31;
  animation: ember-rise var(--duration) var(--delay) linear infinite;
}
@keyframes ember-rise {
  0% { opacity: 0; transform: translate(0, 2vh) scale(.65); }
  16% { opacity: .82; }
  32% { transform: translate(calc(var(--drift) * -.22), calc(var(--rise) * -.29)) scale(.9) rotate(-12deg); }
  61% { opacity: .55; transform: translate(calc(var(--drift) * .6), calc(var(--rise) * -.58)) scale(.8) rotate(22deg); }
  100% { opacity: 0; transform: translate(var(--drift), calc(-1 * var(--rise))) scale(.35) rotate(48deg); }
}
@media (prefers-reduced-motion: reduce) { .archive-embers { display: none; } }

.snow-journal {
  --snow-ground: #e9eaf2;
  background: var(--snow-ground);
}

.hero {
  position: relative;
  display: grid;
  min-height: clamp(540px, 71svh, 740px);
  isolation: isolate;
  overflow: hidden;
  background: var(--snow-ground);
  color: #222b3c;
}

.hero-media, .hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-media {
  z-index: -2;
  overflow: hidden;
  background: var(--snow-ground) url("assets/snow.jpg") center / cover no-repeat;
}
.hero-media video {
  object-fit: cover;
  object-position: 27% 48%;
  transform: scaleX(-1);
}
@media (min-width: 2200px) { .hero-media video { object-position: 27% 70%; } }

.header-wrap {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  padding: 15px 24px 11px;
  background: #202c441c;
  backdrop-filter: blur(16px);
}

.masthead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  width: min(100%, 1260px);
  min-height: 68px;
  margin-inline: auto;
  padding: 8px 19px;
  border-radius: 21px;
  background: var(--reader-glass, #1a274547);
  font-family: var(--sans);
}
.brand { display: inline-flex; flex: none; align-items: center; justify-self: start; gap: 11px; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #f8e4af;
  border-radius: 50%;
  background: #29334e;
  color: #f9e6b0;
  font-size: 17px;
}
.brand strong { display: block; font: 700 23px/1.05 var(--brand-serif); letter-spacing: .08em; transform: translateY(2px); }
.brand small { display: block; margin-top: 5px; color: #f2f3f8; font-size: 8px; font-weight: 750; letter-spacing: .09em; }
.nav {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: safe end;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #f1f4fb;
  font-size: 13px;
  font-weight: 680;
}
.nav-item.current, a.nav-item:hover { border-color: #ffffff6b; background: #ffffff26; color: #fff; }
.nav-item:focus-visible { outline-offset: -2px; }
.snow-journal .header-wrap { background: transparent; backdrop-filter: none; }
.snow-journal .header-row { --reader-glass: #ffffff68; }
.snow-journal .brand small, .snow-journal .nav-item { color: #3f4759; }
.snow-journal .nav-item.current, .snow-journal a.nav-item:hover { border-color: #30395335; background: #3039531a; color: #222b3c; }
.motion {
  display: grid;
  flex: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #303953;
  color: #fff;
  font-size: 16px;
}
.motion {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgb(66 82 117 / 27%);
  background: rgb(237 240 250 / 76%);
  backdrop-filter: blur(8px);
  color: #364462;
  cursor: pointer;
}
.motion:hover { border-color: #667594; background: #edf0fa; }
.snow-journal[data-theme="night"] .motion {
  border-color: rgb(199 214 244 / 34%);
  background: rgb(35 48 73 / 80%);
  color: #e1e6f2;
}
.snow-journal[data-theme="night"] .motion:hover { border-color: #d4def2; background: #253149; }
.play-icon, .is-paused .pause-icon { display: none; }
.is-paused .play-icon { display: inline; }

.hero-content {
  position: relative;
  display: flex;
  width: min(calc(100% - 64px), 1096px);
  align-items: center;
  margin-inline: auto;
  padding: 116px 0 78px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  padding: 6px 13px;
  border: 1px solid #30395340;
  border-radius: 99px;
  background: #ffffff52;
  font-size: 13px;
  font-weight: 700;
}
.hero-copy h1 { font: 700 clamp(70px, 7.8vw, 114px)/1.05 var(--serif); letter-spacing: .07em; }
.hero-description { margin-top: 19px; color: #384255; font: 17px/1.7 var(--serif); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 13px 20px; margin-top: 27px; }
.hero-actions > span { color: #414b5d; font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.read-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 17px;
  border-radius: 99px;
  background: #fff;
  color: #2d3650;
  font-size: 13px;
  font-weight: 800;
  transition: background-color .18s;
}
.read-link:hover { background: #e1edf1; }
.journal-shell {
  --ink: #263044;
  --muted: #535e73;
  --accent: #455471;
  --frost: rgb(125 140 174 / 5%);
  --shadow: 0 12px 28px #3645631a, inset 0 1px #ffffffc9;
  position: relative;
  isolation: isolate;
  padding: 8px 0 30px;
  color: var(--ink);
  background: var(--snow-ground);
}
.snow-continuation {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.snow-continuation canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.container { width: min(calc(100% - 48px), 1176px); margin-inline: auto; }
.journal-clock, .profile, .story-card, .side-section, .motto {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.journal-clock {
  display: grid;
  place-items: center;
  min-height: 65px;
  margin-bottom: 28px;
  border-radius: 22px;
}
.journal-clock time { font: 650 clamp(22px, 3vw, 30px)/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: .12em; }
.journal-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr) 236px; align-items: start; gap: 24px; }
.journal { scroll-margin-top: 18px; }

.profile {
  padding: 18px;
  border-radius: 17px;
  text-align: center;
}
.profile-image {
  aspect-ratio: 1;
  border-radius: 13px;
  background: #526478 url("/api/about/avatar") 89% 42% / cover no-repeat;
}
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.profile > .eyebrow { margin-top: 17px; }
.profile h2 { margin-top: 5px; font: 700 26px/1.3 var(--serif); }
.profile-bio { margin-top: 10px; color: var(--muted); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.chips li { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--frost); color: var(--accent); font-size: 10px; font-weight: 720; }
.profile-chips { justify-content: center; margin-top: 15px; }
.profile-bio, .profile-chips li { overflow-wrap: anywhere; }
.profile-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.featured-carousel { position: relative; border-radius: 20px; }
.featured {
  --ink: #f5f6fc;
  --muted: #d9ddea;
  --accent: #e7eaf5;
  position: relative;
  isolation: isolate;
  display: grid;
  width: 100%;
  min-height: 335px;
  aspect-ratio: 1.86;
  overflow: hidden;
  border-radius: inherit;
  background: #343e53;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.featured-outgoing {
  position: absolute;
  z-index: 1;
  inset: 0;
  min-height: 0;
  aspect-ratio: auto;
  box-shadow: none;
  pointer-events: none;
}
.featured-link { display: flex; align-items: end; min-width: 0; }
.featured-link:focus-visible { outline-offset: -4px; border-radius: inherit; }
.featured::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(0deg, #1d2536f0, #28334b80 38%, transparent 78%),
    var(--cover, none) center 44% / cover no-repeat;
}
.featured-copy { padding: 24px 27px; }
.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid #ffffff70;
  background: #303a53c9;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
}
.featured h2 { margin-top: 10px; font: 700 clamp(28px, 3.2vw, 40px)/1.18 var(--serif); }
.featured p { margin: 9px 0 12px; color: var(--muted); font-size: 13px; }
.date { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.featured .date { color: var(--muted); }
.featured-carousel[data-rotating] .featured { touch-action: pan-y pinch-zoom; }

.latest { margin-top: 39px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; color: #263044; text-shadow: 0 1px 5px #fffd; }
.section-heading h2 { font: 700 30px/1.15 var(--serif); }
.latest-more { flex: none; font-size: 13px; font-weight: 750; }
.latest-status { color: var(--ink); font-size: 14px; }
.story-list { display: grid; gap: 12px; }
.story-card {
  display: grid;
  grid-template-columns: minmax(0, 30%) minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 16px;
  padding: 13px;
  border-radius: 17px;
}
.story-cover { min-height: 126px; border-radius: 11px; background-color: #334259; }
.cover-feature { background: #3b4f65 var(--cover, none) center / cover; }
.cover-snow { background: #d9e1ee url("assets/snow.jpg") 29% center / cover; }
.story-copy { min-width: 0; align-self: center; }
.story-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-top: 10px; color: var(--muted); }
.story-categories { display: flex; flex-wrap: wrap; gap: 4px; }
.category { padding: 3px 7px; border: 1px solid var(--line); border-radius: 99px; background: var(--frost); color: var(--accent); font-size: 10px; font-weight: 750; }
.story-copy h3 { margin: 0 0 4px; font: 700 clamp(17px, 2vw, 22px)/1.3 var(--serif); }
.featured h2, .story-copy h3, .story-copy p { overflow-wrap: anywhere; }
.story-copy p { color: var(--muted); font-size: 12px; }
.story-arrow { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--frost); color: var(--accent); }
.story-arrow:hover { border-color: var(--accent); }

.sidebar { display: grid; gap: 16px; }
.side-section { padding: 17px; border-radius: 16px; }
.side-section h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 15px; }
.side-section h2::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: #8b98b5; }
.stats > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; color: var(--muted); font-size: 12px; }
.stats > div + div { border-top: 1px solid var(--line); }
.stats dt { display: flex; align-items: center; gap: 8px; }
.stats dt .icon { color: var(--accent); }
.stats dd { color: var(--ink); font: 700 16px var(--serif); }
.theme-card { display: flex; align-items: center; gap: 12px; min-height: 94px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.theme-icon { display: grid; flex: none; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--frost); color: var(--accent); font-size: 17px; }
.theme-copy :is(strong, small) { display: block; }
.theme-copy strong { font-size: 15px; }
.theme-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.theme-moon, .snow-journal[data-theme="night"] .theme-sun { display: none; }
.snow-journal[data-theme="night"] .theme-moon { display: inline; }
.motto {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 19px 20px;
  border-radius: 16px;
}
.motto::after { content: ""; position: absolute; z-index: -1; right: -26px; bottom: -37px; width: 117px; aspect-ratio: 1; border: 14px solid var(--frost); border-radius: 50%; }
.motto .icon { color: var(--accent); font-size: 20px; }
.motto p { margin: 12px 0 6px; font: 700 15px var(--serif); white-space: nowrap; }

.snow-journal[data-theme="night"] {
  --snow-ground: #323a4d;
  --night-tint: linear-gradient(90deg, #1b2539df, #253147b8 35%, #36405475 68%, #40485a66);
  color-scheme: dark;
}
.snow-journal[data-theme="night"] :is(.hero-media, .snow-continuation)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--night-tint);
  pointer-events: none;
}
.snow-journal[data-theme="night"] .hero { color: #f4f6fc; }
.snow-journal[data-theme="night"] .header-row { --reader-glass: #19243f59; }
.snow-journal[data-theme="night"] :is(.brand small, .nav-item, .hero-description, .hero-actions > span) { color: #e1e6f2; }
.snow-journal[data-theme="night"] :is(.nav-item.current, a.nav-item:hover, .hero-kicker) { border-color: #ffffff65; background: #ffffff1f; color: #fff; }
.snow-journal[data-theme="night"] .journal-shell {
  --ink: #edf1fb;
  --muted: #c7cfe0;
  --accent: #d4def2;
  --line: rgb(199 214 244 / 20%);
  --frost: rgb(190 208 242 / 10%);
  --shadow: 0 12px 28px #11192d42, inset 0 1px #ffffff1c;
}
.snow-journal[data-theme="night"] .section-heading { color: var(--ink); text-shadow: 0 1px 5px #1c2537; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .journal-shell :is(.journal-clock, .profile, .featured-carousel, .story-card, .side-section, .motto) {
    transition: transform 260ms ease, border-color 260ms ease, box-shadow 260ms ease;
  }
  .journal-shell :is(.journal-clock, .profile, .featured-carousel, .story-card, .side-section, .motto):hover {
    transform: translateY(-4px);
    border-color: #7788ae70;
    box-shadow: 0 18px 35px #36456330, inset 0 1px #ffffffd9;
  }
  .featured::before, .story-cover { transition: transform 460ms cubic-bezier(.2, .65, .3, 1); }
  .featured-carousel:hover .featured::before, .story-card:hover .story-cover { transform: scale(1.04); }
  .story-card:hover .story-arrow .icon { animation: snow-arrow-nudge 320ms ease-out; }
  .theme-card:hover .theme-icon .icon { animation: theme-icon-hop 360ms ease-out; }
}

@keyframes snow-arrow-nudge {
  35% { transform: translateX(3px); }
  70% { transform: translateX(-1px); }
}

@keyframes theme-icon-hop {
  40% { transform: translateY(-2px); }
  72% { transform: translateY(0.5px); }
}

@media (max-width: 1120px) {
  .journal-grid { grid-template-columns: 175px minmax(0, 1fr) 185px; gap: 18px; }
  .profile, .side-section { padding-inline: 13px; }
  .motto { padding-inline: 13px; }
  .motto p { font-size: 12px; }
}

@media (max-width: 960px) {
  .masthead { gap: 15px; }
  .nav-item { padding-inline: 7px; }
}

@media (max-width: 860px) {
  .journal-grid { grid-template-columns: minmax(0, 1fr) 185px; }
  .journal { grid-area: 1 / 1 / 3 / 2; }
  .profile { grid-area: 1 / 2; }
  .sidebar { grid-area: 2 / 2; }
}

@media (max-width: 820px) {
  .header-wrap { padding: 10px 14px; }
  .masthead { grid-template-columns: minmax(0, 1fr); gap: 9px; padding: 10px; border-radius: 17px; }
  .brand { padding-left: 3px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: 20px; }
  .nav-item { padding: 6px 8px; font-size: 12px; }
  .nav-item:not(.header-account) .icon { display: none; }
}

@media (max-width: 630px) {
  .hero { min-height: 535px; }
  .hero-content { width: calc(100% - 48px); padding: 150px 0 80px; }
  .hero-description { font-size: 15px; }
  .container { width: calc(100% - 28px); }
  .journal-clock { min-height: 54px; margin-bottom: 18px; border-radius: 16px; }
  .journal-grid { grid-template-columns: minmax(0, 1fr); gap: 23px; }
  .journal { grid-area: 1 / 1; }
  .profile { grid-area: 2 / 1; }
  .profile-image { max-width: 175px; margin-inline: auto; }
  .sidebar { grid-area: 3 / 1; }
  .motto p { font-size: 15px; }
  .featured-carousel { border-radius: 16px; }
  .featured:not(.featured-outgoing) { min-height: 264px; }
  .featured-copy { padding: 18px; }
  .story-card { grid-template-columns: minmax(0, 29%) minmax(0, 1fr); gap: 11px; padding: 10px; }
  .story-cover { min-height: 100px; }
  .story-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
