@charset "UTF-8";
/* 奇遇手记 — public diary styles (warm ivory, clay accent, serif reading text).
   Shared design tokens live here; manage.css only consumes them. */

/* ===== Tokens ===== */
:root {
  color-scheme: light dark;
  --paper: #faf9f5;
  --paper-raised: #ffffff;
  --paper-sunk: #f0eee6;
  --ink: #141413;
  --text: #3d3d3a;
  --muted: #6b6a64;
  --faint: #b0aea5; /* decorative only, never for readable text */
  --rule: #e8e6dc;
  --rule-strong: #d6d3c7;
  --accent: #ae5630; /* links, primary buttons (white text 5:1) */
  --accent-ink: #9a4a2c;
  --accent-soft: #f6e9e1;
  --clay: #c96442; /* decorative accents, focus rings */
  --marker: #f5dfcf;
  --margin-line: var(--rule);
  --danger: #a0453b;
  --danger-soft: #f6e6e1;
  --ok: #3f6b4c;
  --ok-soft: #e3eee4;
  --warn: #7d6118;
  --warn-soft: #f3ebd6;
  --on-accent: #ffffff;
  --shadow-sm: 0 1px 2px rgba(20, 20, 19, .04), 0 1px 1px rgba(20, 20, 19, .03);
  --shadow-md: 0 1px 2px rgba(20, 20, 19, .04), 0 8px 28px -6px rgba(20, 20, 19, .10);
  --serif: Georgia, "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --kai: var(--serif);
  --numeral: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 10px;
  --radius-lg: 18px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #262624;
    --paper-raised: #30302e;
    --paper-sunk: #1f1e1d;
    --ink: #faf9f5;
    --text: #d4d2c8;
    --muted: #a6a49b;
    --faint: #6f6d66;
    --rule: #3a3935;
    --rule-strong: #4a4944;
    --accent: #e08a68;
    --accent-ink: #f0b097;
    --accent-soft: #3a2a22;
    --clay: #d97757;
    --marker: #4a3226;
    --danger: #e39a8f;
    --danger-soft: #3a2421;
    --ok: #9cc7a6;
    --ok-soft: #1f3125;
    --warn: #d9bd78;
    --warn-soft: #352d19;
    --on-accent: #1f1e1d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -8px rgba(0, 0, 0, .45);
  }
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 15px/1.7 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a, button { touch-action: manipulation; } /* no double-tap zoom delay */
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
::selection { background: var(--marker); color: var(--ink); }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; z-index: 50; left: 16px; top: -60px; padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 14px; transition: top .2s var(--ease);
}
.skip-link:focus { top: 14px; }
main:focus { outline: none; }

/* Reading progress bar (pure CSS, scroll-driven where supported) */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 40; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--clay), var(--accent)); transform-origin: 0 50%; transform: scaleX(0); border-radius: 0 3px 3px 0; }
@supports (animation-timeline: scroll()) {
  .read-progress span { animation: progress linear both; animation-timeline: scroll(root); }
}
@keyframes progress { to { transform: scaleX(1); } }

/* ===== Shell & header ===== */
.site-shell { width: min(1120px, 100% - 64px); margin: 0 auto; }
@supports (padding: env(safe-area-inset-left)) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}
.site-header { position: relative; padding: 56px 0 0; animation: rise .7s var(--ease) both; }
.masthead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-title {
  font: 600 34px/1.25 var(--serif); letter-spacing: .06em; color: var(--ink);
  transition: color .2s;
}
.site-title .title-dot { color: var(--clay); display: inline-block; transition: transform .5s var(--ease-spring); }
.site-title:hover .title-dot { transform: translateY(-3px) rotate(-12deg); }
.header-note {
  font: 13px/1 var(--sans); color: var(--accent); background: var(--accent-soft);
  padding: 6px 12px; border-radius: 999px; letter-spacing: .04em;
}
.site-description { margin-top: 12px; max-width: 40em; color: var(--muted); font: 16px/1.75 var(--serif); }
.nav-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 28px; padding-bottom: 18px; border-bottom: 1px solid var(--rule);
}
.nav-row nav { display: flex; gap: 4px; padding: 4px; background: var(--paper-sunk); border-radius: 999px; }
.nav-row nav a {
  position: relative; padding: 7px 18px; border-radius: 999px; font-size: 14px; color: var(--muted);
  transition: color .2s, background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.nav-row nav a:hover { color: var(--ink); }
.nav-row nav a[aria-current="page"] { color: var(--ink); background: var(--paper-raised); box-shadow: var(--shadow-sm); }
.volume { font: italic 14px var(--numeral); color: var(--muted); }

/* ===== Layout ===== */
.page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; margin-top: 40px; align-items: start; }
main { min-width: 0; }

/* ===== Journal ===== */
.journal, .secondary-view { animation: view-in .55s var(--ease) both; }
.journal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.journal-head h1 { font: 600 15px var(--sans); letter-spacing: .08em; color: var(--muted); }
.journal-head p { font-size: 13px; color: var(--muted); }
.plain-button {
  border: 0; background: none; padding: 0; color: var(--accent); font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.plain-button:hover { color: var(--accent-ink); }
.empty-diary { padding: 64px 0; text-align: center; font: 17px var(--serif); color: var(--muted); }
.entry-list { display: grid; gap: 28px; }

.diary-entry {
  position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 28px;
  padding: 36px 44px 32px 28px; background: var(--paper-raised); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); scroll-margin-top: 24px;
  transition: box-shadow .35s var(--ease), transform .35s var(--ease), border-color .35s;
}
.diary-entry:hover { box-shadow: var(--shadow-md); border-color: var(--rule-strong); transform: translateY(-2px); }
.diary-entry::before { /* clay ribbon that grows on hover */
  content: ""; position: absolute; left: -1px; top: 34px; width: 3px; height: 28px; border-radius: 0 3px 3px 0;
  background: var(--clay); transform: scaleY(.5); opacity: .55; transition: transform .4s var(--ease-spring), opacity .3s;
}
.diary-entry:hover::before, .diary-entry:target::before { transform: scaleY(1.4); opacity: 1; }
.entry-date { text-align: center; padding-top: 4px; }
.date-stamp { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.date-day { font: 400 44px/1 var(--numeral); color: var(--clay); letter-spacing: -.02em; }
.date-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.date-inline { display: none; }
.date-same { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.date-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--clay); opacity: .6; }
.entry-body { min-width: 0; }
.entry-label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.entry-category { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.entry-header h2 { margin: 12px 0 18px; font: 600 27px/1.4 var(--serif); color: var(--ink); letter-spacing: .01em; }
.entry-header h2 a {
  background: linear-gradient(var(--marker), var(--marker)) 0 88% / 0 .38em no-repeat;
  transition: background-size .45s var(--ease);
}
.entry-header h2 a:hover { background-size: 100% .38em; }

/* ===== Prose (also used by the editor preview) ===== */
.entry-prose { font: 17.5px/1.95 var(--serif); color: var(--text); overflow-wrap: anywhere; }
.entry-prose > * + *, .entry-rest > * + *, .entry-prose > .entry-rest { margin-top: 1.05em; }
.entry-prose strong { color: var(--ink); font-weight: 600; background: linear-gradient(transparent 62%, var(--marker) 62%); }
.entry-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); transition: text-decoration-color .2s; }
.entry-prose a:hover { text-decoration-color: var(--accent); }
.entry-prose h3 { margin-top: 1.6em; font: 600 20px/1.5 var(--serif); color: var(--ink); }
.entry-prose blockquote {
  margin: 1.4em 0; padding: 14px 20px; border-left: 3px solid var(--clay); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--paper-sunk); color: var(--ink); font-size: 19px;
}
.entry-prose ul, .entry-prose ol { padding-left: 0; list-style: none; }
.entry-prose li { position: relative; padding-left: 1.6em; }
.entry-prose li + li { margin-top: .35em; }
.entry-prose ul > li::before { content: ""; position: absolute; left: .35em; top: .82em; width: 7px; height: 7px; border-radius: 50%; background: var(--clay); }
.entry-prose ol { counter-reset: item; }
.entry-prose ol > li { counter-increment: item; }
.entry-prose ol > li::before { content: counter(item) "."; position: absolute; left: 0; color: var(--clay); font-family: var(--numeral); }
.entry-prose code { font: .86em var(--mono); background: var(--paper-sunk); padding: .15em .45em; border-radius: 6px; }
.entry-prose pre { overflow: auto; padding: 16px 18px; background: var(--paper-sunk); border-radius: var(--radius); font-size: 14px; line-height: 1.7; }
.entry-prose pre code { background: none; padding: 0; }
.post-image { margin: 1.6em 0; }
.post-image a { display: block; width: fit-content; max-width: min(100%, 420px); border-radius: 14px; overflow: hidden; border: 1px solid var(--rule); box-shadow: var(--shadow-sm); transition: box-shadow .35s var(--ease), transform .35s var(--ease); }
.post-image a:hover { box-shadow: var(--shadow-md); transform: translateY(-3px) rotate(-.4deg); }
.post-image img { transition: transform .6s var(--ease); }
.post-image a:hover img { transform: scale(1.025); }
.post-image figcaption { margin-top: 10px; font: 13px/1.6 var(--sans); color: var(--muted); }
.entry-rest:not([hidden]) { animation: unfold .5s var(--ease) both; }

.read-toggle {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; padding: 8px 16px;
  border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--paper-raised);
  font-size: 14px; color: var(--accent); transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.read-toggle:hover { background: var(--accent-soft); border-color: transparent; }
.read-toggle:active { transform: scale(.97); }
.read-toggle small { font-size: 12px; color: var(--muted); }
.read-toggle span { display: inline-block; transition: transform .3s var(--ease); }
.read-toggle:hover span { transform: translateY(2px); }
.read-toggle[aria-expanded="true"]:hover span { transform: translateY(-2px); }
.entry-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--rule-strong); font-size: 13px; color: var(--muted); }
.entry-tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.entry-tags li { padding: 2px 10px; border-radius: 999px; background: var(--paper-sunk); }
.signature { font: italic 15px var(--serif); color: var(--muted); }
.journal-end { padding: 48px 0 24px; text-align: center; color: var(--muted); }
.journal-end span { display: block; font: 20px var(--numeral); letter-spacing: .5em; color: var(--clay); }
.journal-end p { margin-top: 10px; font: 15px var(--serif); }

/* ===== Archive & about ===== */
.secondary-view { padding: 4px 0 64px; }
.small-label { font-size: 13px; letter-spacing: .08em; color: var(--accent); }
.secondary-view > h1 { margin: 8px 0 12px; font: 600 34px/1.35 var(--serif); color: var(--ink); }
.view-intro { font: 17px/1.8 var(--serif); color: var(--muted); }
.archive-month { margin-top: 36px; }
.archive-month-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 10px; }
.archive-month-head h2 { font: 600 19px var(--serif); color: var(--ink); }
.archive-month-head span { font-size: 13px; color: var(--muted); }
.archive-list { list-style: none; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.archive-list li { position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 16px 22px; transition: background-color .2s; }
.archive-list li + li { border-top: 1px solid var(--rule); }
.archive-list li:hover { background: var(--paper-sunk); }
.archive-list time { font: 15px var(--numeral); color: var(--clay); }
.archive-list time span { display: block; font: 12px var(--sans); color: var(--muted); }
.archive-list a::after { content: ""; position: absolute; inset: 0; } /* the whole row is the link */
.archive-list a { font: 17px/1.6 var(--serif); color: var(--ink); transition: color .2s, padding-left .3s var(--ease); }
.archive-list li:hover a { color: var(--accent); padding-left: 4px; }
.archive-category { font-size: 12px; color: var(--muted); padding: 2px 10px; border-radius: 999px; background: var(--paper-sunk); }
.about-prose { margin-top: 28px; padding: 32px 36px; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.about-contact { margin-top: 20px; color: var(--text); }
.about-contact span { display: block; font-size: 13px; color: var(--muted); }
.about-view .signature { display: block; margin-top: 18px; }
.quiet-link { display: inline-flex; margin-top: 32px; font-size: 14px; color: var(--accent); transition: transform .25s var(--ease); }
.quiet-link:hover { transform: translateX(-4px); }

/* ===== Sidebar ===== */
.sidebar { display: grid; gap: 18px; position: sticky; top: 24px; animation: rise .7s .15s var(--ease) both; }
.sidebar-follow { display: grid; gap: 18px; }
.notebook-sketch { display: grid; justify-items: center; padding: 6px 0 0; }
.notebook-sketch svg { width: 132px; height: 88px; fill: none; stroke: var(--clay); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transform: rotate(-6deg); animation: float 6s ease-in-out infinite; }
.notebook-sketch span { margin-top: 6px; font: italic 13px var(--serif); color: var(--muted); }
.side-block { padding: 20px 22px; background: var(--paper-sunk); border-radius: var(--radius-lg); }
.side-block h2 { margin-bottom: 12px; font: 600 13px var(--sans); letter-spacing: .08em; color: var(--ink); }
.side-about p { white-space: pre-line; font: 15px/1.9 var(--serif); color: var(--text); }
.side-about a { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--accent); transition: transform .25s var(--ease); }
.side-about a:hover { transform: translateX(3px); }
.side-recent ol { list-style: none; counter-reset: recent; display: grid; gap: 2px; }
.side-recent li { counter-increment: recent; }
.side-recent a {
  display: flex; gap: 10px; padding: 7px 10px; margin: 0 -10px; border-radius: var(--radius);
  font-size: 14px; line-height: 1.55; color: var(--text); transition: background-color .2s, color .2s;
}
.side-recent a::before { content: counter(recent, decimal-leading-zero); font: italic 13px/1.7 var(--numeral); color: var(--clay); }
.side-recent a:hover { background: var(--paper-raised); color: var(--ink); }
.side-months ul { list-style: none; display: grid; gap: 2px; }
.month-link {
  display: flex; justify-content: space-between; width: 100%; padding: 7px 10px; margin: 0 -10px; width: calc(100% + 20px);
  border: 0; border-radius: var(--radius); background: none; font-size: 14px; color: var(--text); text-align: left;
  transition: background-color .2s, color .2s;
}
.month-link:hover { background: var(--paper-raised); }
.month-link[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.month-count { color: var(--muted); font-size: 13px; }
.side-months .plain-button { margin-top: 8px; }
.side-empty { font-size: 14px; color: var(--muted); }
.margin-note { padding: 4px 6px; font: italic 15px/1.9 var(--serif); color: var(--muted); }
.margin-note span { display: block; font-size: 14px; color: var(--clay); }

/* ===== Footer ===== */
.site-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  margin-top: 64px; padding: 24px 0 40px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted);
}
.footer-info, .footer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.site-footer a { transition: color .2s; }
.site-footer a:hover { color: var(--accent); }
.owner-link {
  position: fixed; right: 24px; bottom: 24px; z-index: 30; padding: 12px 20px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent) !important; font-size: 14px; box-shadow: var(--shadow-md);
  transition: transform .25s var(--ease-spring), background-color .2s;
  animation: pop .6s .6s var(--ease-spring) both;
}
.owner-link::before { content: "＋ "; }
.owner-link:hover { transform: translateY(-3px); background: var(--accent-ink); }

/* ===== Error / sign-in messages ===== */
.auth-message {
  max-width: 520px; margin: 16vh auto; padding: 40px; text-align: center; background: var(--paper-raised);
  border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); animation: rise .6s var(--ease) both;
}
.auth-message h1 { margin-bottom: 14px; font: 600 26px/1.4 var(--serif); color: var(--ink); }
.auth-message p { margin-bottom: 24px; color: var(--muted); }
.auth-message a, .auth-message button {
  display: inline-flex; margin: 4px 6px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--rule-strong);
  background: var(--paper-raised); font-size: 14px; color: var(--accent); transition: background-color .2s;
}
.auth-message a:first-of-type, .auth-message button { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.auth-message a:hover { background: var(--accent-soft); }

/* ===== Motion ===== */
/* Entries fade up as they scroll in. Only hidden once JS has marked the page (html.motion), so no-JS readers see everything. */
/* Scroll reveal states live in motion.css (.pending = below the fold, waiting to rise in). */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-6px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6) translateY(16px); } to { opacity: 1; transform: none; } }

/* ===== Touch screens =====
   Phones/tablets have no real hover: a tap would leave cards "stuck" lifted, so hover motion only runs with a
   mouse, touch gets pressed-state feedback instead, and every tap target is at least 44px tall. */
@media (hover: none), (pointer: coarse) {
  .diary-entry:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--rule); }
  .diary-entry:hover::before { transform: scaleY(.5); opacity: .55; }
  .diary-entry:target::before { transform: scaleY(1.4); opacity: 1; }
  .entry-header h2 a:hover { background-size: 0 .38em; }
  .post-image a:hover, .post-image a:hover img, .site-title:hover .title-dot, .quiet-link:hover, .side-about a:hover, .read-toggle:hover span, .owner-link:hover { transform: none; }
  .archive-list li:hover a { padding-left: 0; color: var(--ink); }
  .archive-list li:hover, .side-recent a:hover, .month-link:hover { background: none; }
  .read-toggle:hover { background: var(--paper-raised); border-color: var(--rule-strong); }

  .nav-row nav a:active, .side-recent a:active, .month-link:active, .archive-list li:active { background: var(--accent-soft); }
  .entry-header h2 a:active { background-size: 100% .38em; }
  .read-toggle:active, .owner-link:active, .quiet-link:active { transform: scale(.96); }
  .post-image a:active { transform: scale(.985); }

  .nav-row nav a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 18px; }
  .side-recent a, .month-link { align-items: center; min-height: 44px; }
  .read-toggle { min-height: 44px; padding-inline: 18px; }
  .plain-button { padding: 12px 6px; margin: -12px -6px; }
  .quiet-link, .side-about a, .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
  .entry-header h2 a { display: inline; padding-block: 4px; }
}

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .page-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; animation: none; }
  .notebook-sketch, .margin-note { display: none; }
  .sidebar-follow { display: contents; }
}
@media (max-width: 680px) {
  .site-shell { width: calc(100% - 32px); }
  .site-header { padding-top: 32px; }
  .site-title { font-size: 28px; }
  .site-description { font-size: 15px; }
  .nav-row { margin-top: 22px; }
  .nav-row nav a { padding: 6px 14px; }
  .volume { display: none; }
  .page-layout { margin-top: 28px; }
  .entry-list { gap: 18px; }
  .diary-entry { display: block; padding: 24px 20px 22px; border-radius: 16px; }
  .diary-entry::before { top: 26px; }
  .entry-date { text-align: left; padding: 0 0 8px; }
  .date-stamp { align-items: flex-start; }
  .date-day, .date-meta { display: none; }
  .date-inline { display: inline; font-size: 13px; color: var(--clay); font-weight: 500; }
  .date-same { flex-direction: row; }
  .entry-header h2 { font-size: 23px; margin: 10px 0 14px; }
  .entry-prose { font-size: 16.5px; line-height: 1.9; }
  .entry-prose blockquote { font-size: 17px; padding: 12px 16px; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .secondary-view > h1 { font-size: 27px; }
  .archive-list li { grid-template-columns: 58px minmax(0, 1fr); padding: 14px 16px; }
  .archive-category { display: none; }
  .about-prose { padding: 22px 20px; }
  .owner-link { right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .side-block { padding: 18px 18px; }
  .entry-tags li { padding: 4px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .motion .reveal.pending { opacity: 1; transform: none; }
  .read-progress { display: none; }
}

@media print {
  .read-progress, .nav-row, .sidebar, .site-footer, .read-toggle, .skip-link, .owner-link { display: none !important; }
  body { background: #fff; color: #000; }
  .diary-entry { box-shadow: none; border: 0; padding: 0; break-inside: avoid; }
  .entry-rest[hidden] { display: block !important; }
  .motion .reveal.pending { opacity: 1; transform: none; }
}

/* ===== Accounts: login / register / verify / reset, and legal pages ===== */
.auth-page, .legal-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 56px 16px 40px; }
.auth-brand { font: 600 26px/1.3 var(--serif); letter-spacing: .06em; color: var(--ink); margin-bottom: 28px; animation: rise .6s var(--ease) both; }
.auth-brand span { color: var(--clay); }
.auth-card, .legal-card {
  width: min(440px, 100%); padding: 36px 36px 32px; background: var(--paper-raised); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); animation: rise .6s .05s var(--ease) both;
}
.legal-card { width: min(720px, 100%); }
.auth-card h1, .legal-card h1 { font: 600 26px/1.4 var(--serif); color: var(--ink); }
.auth-intro { margin-top: 8px; color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.auth-form { display: grid; gap: 18px; margin-top: 26px; }
.auth-field { display: grid; gap: 6px; }
.auth-field > span:first-child { font-size: 14px; font-weight: 500; color: var(--ink); }
.auth-field small { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.auth-field input, .password-wrap input {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font: 16px/1.4 var(--sans); transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.auth-field input:focus, .password-wrap input:focus { outline: none; border-color: var(--clay); background: var(--paper-raised); box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 18%, transparent); }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 64px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 4px 10px; border: 0; border-radius: 8px; background: none; color: var(--accent); font-size: 13px; }
.password-toggle:hover { background: var(--accent-soft); }
.auth-check { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; font-size: 14px; color: var(--text); }
.auth-check label, label.auth-check { display: flex; align-items: flex-start; gap: 10px; line-height: 1.6; }
.auth-check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.auth-check a, .auth-aside a, .auth-footer a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.auth-aside { margin-top: -8px; text-align: right; font-size: 13px; }
.auth-error { padding: 10px 14px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-size: 14px; animation: shake .4s var(--ease); }
.auth-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font: 500 16px var(--sans); transition: background-color .2s, transform .15s var(--ease);
}
.auth-submit:hover:not(:disabled) { background: var(--accent-ink); }
.auth-submit:active:not(:disabled) { transform: scale(.98); }
.auth-submit:disabled { opacity: .7; cursor: progress; }
.auth-submit.as-link { margin-top: 18px; width: 100%; }
.auth-spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.auth-done { margin-top: 22px; text-align: center; animation: view-in .4s var(--ease) both; }
.auth-done > span { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 24px; margin-bottom: 12px; }
.auth-done.fail > span { background: var(--danger-soft); color: var(--danger); }
.auth-done p { color: var(--text); line-height: 1.8; }
.auth-footer { margin-top: 22px; font-size: 14px; color: var(--muted); }
.legal-updated { margin: 6px 0 22px; font-size: 13px; color: var(--muted); }
.legal-card h2 { margin: 26px 0 10px; font: 600 18px var(--serif); color: var(--ink); }
.legal-card p, .legal-card li { font: 16px/1.9 var(--serif); color: var(--text); }
.legal-card ul { padding-left: 1.2em; list-style: disc; }
.legal-card li::marker { color: var(--clay); }
.legal-card li + li { margin-top: 6px; }
.legal-card strong { color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (max-width: 520px) {
  .auth-page, .legal-page { padding-top: 32px; }
  .auth-card, .legal-card { padding: 26px 20px 24px; border-radius: 16px; }
}
.footer-user { color: var(--text); }
.footer-logout { border: 0; background: none; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.footer-logout:hover { color: var(--accent); }
@media (hover: none), (pointer: coarse) { .footer-logout { min-height: 44px; } }

/* ===== Multi-author: avatars, author chips, account corner, author pages, tags, pager ===== */
.avatar { display: inline-block; flex: none; border-radius: 50%; object-fit: cover; background: var(--paper-sunk); }
.avatar-initial { display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--serif); font-weight: 600; line-height: 1; }
.masthead-account { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.masthead-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; color: var(--text); transition: background-color .2s, color .2s; }
.masthead-link:hover { background: var(--paper-sunk); color: var(--ink); }
.masthead-link.primary { background: var(--accent); color: var(--on-accent); }
.masthead-link.primary:hover { background: var(--accent-ink); color: var(--on-accent); }
.account-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper-raised); font-size: 14px; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.account-chip:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-sm); }
.author-chip { display: inline-flex; align-items: center; gap: 7px; padding: 2px 10px 2px 2px; border-radius: 999px; background: var(--paper-sunk); color: var(--ink); font-weight: 500; transition: background-color .2s; }
.author-chip:hover { background: var(--accent-soft); color: var(--accent); }
.entry-visibility { padding: 3px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.entry-tags a { color: inherit; }
.entry-tags a:hover { color: var(--accent); }
.entry-tags li { transition: background-color .2s; }
.entry-tags li:hover { background: var(--accent-soft); }
.entry-banner { margin-bottom: 16px; padding: 12px 16px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.entry-banner.warn { background: var(--warn-soft); color: var(--warn); }
.single-actions { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.more-from { margin-top: 40px; }
.more-from h2 { margin-bottom: 12px; font: 600 17px var(--serif); color: var(--muted); }
.more-from h2 a { color: var(--ink); }
.more-from h2 a:hover { color: var(--accent); }
.pager { display: flex; justify-content: space-between; margin-top: 32px; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--paper-raised); color: var(--accent); font-size: 14px; transition: background-color .2s, transform .2s var(--ease); }
.pager a:hover { background: var(--accent-soft); }
.author-head { display: flex; gap: 22px; align-items: center; margin-bottom: 32px; padding: 28px 30px; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.author-head h1 { font: 600 30px/1.3 var(--serif); color: var(--ink); }
.author-handle { margin-top: 4px; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.author-badge { padding: 1px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.author-bio { margin-top: 10px; font: 16px/1.8 var(--serif); color: var(--text); white-space: pre-line; }
.author-stats { margin-top: 8px; font-size: 13px; color: var(--muted); }
.tag-cloud { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.tag-cloud a { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 16px; border-radius: 999px; background: var(--paper-raised); border: 1px solid var(--rule); color: var(--ink); font-family: var(--serif); transition: background-color .2s, border-color .2s, transform .25s var(--ease-spring); }
.tag-cloud a:hover { background: var(--accent-soft); border-color: transparent; color: var(--accent); transform: translateY(-2px); }
.tag-cloud span { font: 12px var(--sans); color: var(--muted); }
.side-authors ul { list-style: none; display: grid; gap: 2px; }
.side-authors a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; margin: 0 -10px; border-radius: var(--radius); font-size: 14px; color: var(--text); transition: background-color .2s; }
.side-authors a:hover { background: var(--paper-raised); color: var(--ink); }
.side-authors a span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 680px) {
  .masthead { row-gap: 10px; }
  .masthead { flex-wrap: nowrap; }
  .header-note { display: none; }
  .masthead-account { margin-left: auto; }
  .masthead-link { padding: 0 12px; }
  .account-chip span { max-width: 6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .author-head { flex-direction: column; align-items: flex-start; padding: 22px 20px; gap: 14px; }
  .author-head h1 { font-size: 25px; }
  .pager a { padding: 0 16px; }
}
@media (hover: none), (pointer: coarse) {
  .tag-cloud a:hover { transform: none; }
  .side-authors a, .masthead-link, .account-chip { min-height: 44px; }
  .entry-tags li a { display: inline-flex; min-height: 32px; align-items: center; }
}

/* ===== 社团近况（首页顶部）===== */
.club-board { margin-bottom: 40px; }
.club-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.club-head h2 { display: flex; align-items: center; gap: 10px; font: 600 15px var(--sans); letter-spacing: .08em; color: var(--muted); }
.club-spark { width: 14px; height: 14px; background: var(--clay); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
.club-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; }
.club-grid.single { grid-template-columns: minmax(0, 1fr); }
.club-card { position: relative; overflow: hidden; padding: 22px 24px; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--paper-raised); box-shadow: var(--shadow-sm); }
.club-notices { grid-column: 1 / -1; }
.club-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--muted); }
.club-private { padding: 1px 8px; border-radius: 999px; background: var(--paper-sunk); font-size: 11.5px; font-weight: 400; }
.club-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; text-align: center; }
.club-balance { background: linear-gradient(150deg, var(--paper-raised) 40%, color-mix(in srgb, var(--accent-soft) 70%, var(--paper-raised))); }
.club-amount { margin-top: 10px; font: 600 clamp(32px, 7vw, 40px)/1.1 var(--numeral); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.club-currency { margin-right: 4px; font-size: .55em; color: var(--clay); vertical-align: .35em; }
.club-note { margin-top: 10px; font: 14px/1.7 var(--serif); color: var(--text); max-width: 24em; }
.club-meta { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.club-deco { position: absolute; right: -10px; bottom: -12px; width: 92px; height: 92px; fill: none; stroke: var(--clay); stroke-width: 2; opacity: .18; }
.club-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.club-date { font: 600 15px var(--sans); color: var(--clay); }
.club-countdown { padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12.5px; font-weight: 500; }
.club-class h3 { margin-top: 8px; font: 600 20px/1.45 var(--serif); color: var(--ink); text-wrap: balance; }
.club-place { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.club-place svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--clay); stroke-width: 1.8; }
.club-summary { margin-top: 10px; font: 15px/1.75 var(--serif); color: var(--text); }
.club-notices ul { list-style: none; margin-top: 10px; display: grid; gap: 4px; }
.club-notices li { border-radius: 12px; transition: background-color .2s; }
.club-notices li.open { background: var(--paper-sunk); }
.club-notices li > button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 10px 12px; border: 0; border-radius: 12px; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.club-notices li > button:disabled { cursor: default; opacity: 1; }
.club-notices li > button:hover:not(:disabled) { background: var(--paper-sunk); }
.notice-badge { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-size: 12px; font-weight: 600; }
.notice-title { flex: 1; min-width: 0; font: 500 15.5px/1.5 var(--serif); }
.club-notices time { flex: none; font: 13px var(--sans); font-variant-numeric: tabular-nums; color: var(--muted); }
.notice-chevron { flex: none; width: 9px; height: 9px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); }
.club-notices li.open .notice-chevron { transform: rotate(225deg) translate(-2px, -2px); }
.club-notices .collapse p { padding: 0 12px 14px; font: 15px/1.8 var(--serif); color: var(--text); white-space: pre-line; }
.club-more { margin-top: 8px; padding: 8px 12px; border: 0; border-radius: 999px; background: none; color: var(--accent); font-size: 14px; cursor: pointer; }
.club-more:hover { background: var(--accent-soft); }
@media (max-width: 680px) {
  .club-board { margin-bottom: 30px; }
  .club-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .club-card { padding: 18px 18px; border-radius: 16px; }
  .club-class h3 { font-size: 18px; }
  .notice-title { font-size: 15px; }
}

/* ===== 中文排版细节（所有屏幕）===== */
.entry-prose, .about-prose, .club-summary, .club-note, .author-bio, .legal-card p, .legal-card li {
  line-break: strict;             /* 句号、逗号等不出现在行首 */
  hanging-punctuation: allow-end; /* 行末标点可以悬挂出去，右边更齐 */
  text-wrap: pretty;              /* 尽量避免最后一行只剩一个字 */
  font-kerning: normal;
}
.entry-prose p, .about-prose p, .club-summary, .legal-card p { text-align: justify; text-justify: inter-character; }
h1, h2, h3, .entry-header h2, .club-class h3, .notice-title { text-wrap: balance; }

/* ===== 手机排版 ===== */
@media (max-width: 680px) {
  .site-shell { width: calc(100% - 28px); }                 /* 两侧 14px，正文多出几个字的宽度 */
  .site-title { font-size: clamp(23px, 7vw, 27px); letter-spacing: .04em; }
  .site-description { font-size: 14.5px; line-height: 1.7; margin-top: 8px; }
  .nav-row { margin-top: 18px; padding-bottom: 14px; }
  .nav-row nav { flex: 1; }
  .nav-row nav a { flex: 1; justify-content: center; text-align: center; padding: 6px 0; }
  .page-layout { margin-top: 22px; }
  .journal-head { margin-bottom: 14px; }
  .journal-head h1 { font-size: 14px; }
  .diary-entry { padding: 22px 18px 20px; }
  .entry-label { gap: 6px; font-size: 12.5px; }
  .entry-header h2 { font-size: clamp(19px, 5.6vw, 22px); line-height: 1.42; margin: 8px 0 12px; }
  .entry-prose { font-size: 16px; line-height: 1.8; letter-spacing: .01em; }
  .entry-prose > * + *, .entry-rest.collapse > div > * + * { margin-top: .85em; }
  .entry-rest.collapse[data-open="true"] > div { padding-top: .85em; }
  .entry-prose h3 { font-size: 18px; margin-top: 1.3em; }
  .entry-prose blockquote { font-size: 16.5px; line-height: 1.75; padding: 10px 14px; margin: 1.1em 0; }
  .entry-prose li { padding-left: 1.3em; }
  .entry-footer { margin-top: 18px; padding-top: 14px; }
  .read-toggle { margin-top: 16px; }
  .secondary-view > h1 { font-size: clamp(23px, 6.6vw, 27px); }
  .view-intro { font-size: 15.5px; line-height: 1.75; }
  .about-prose { font-size: 16px; line-height: 1.8; }
  .archive-list a { font-size: 16px; line-height: 1.5; }
  .author-bio { font-size: 15px; }
}
@media (max-width: 360px) {
  .site-shell { width: calc(100% - 20px); }
  .diary-entry { padding: 18px 14px; }
  .entry-prose { font-size: 15.5px; }
  .masthead-link { padding: 0 10px; font-size: 13.5px; }
  .nav-row nav a { font-size: 13.5px; }
  .club-card { padding: 16px 14px; }
}
