/* Seiun 官网：纸与墨（和游戏同一套设计语言） */
:root {
  --paper: #f3efe7;
  --paper-deep: #e8e2d6;
  --card: #ffffff;
  --ink: #232327;
  --ink-soft: #76716a;
  --ink-faint: #b7b0a5;
  --line: #e2dbcd;
  --water: #d2e3e7;
  --star: #e0954a;
  --red: #c8463a;
  --serif: 'Noto Serif SC', 'Noto Serif JP', 'Songti SC', 'STSong', serif;
  --num: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(0.215, 0.61, 0.355, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #1b1b1e;
    --paper-deep: #26262a;
    --card: #232327;
    --ink: #efeae1;
    --ink-soft: #a9a399;
    --ink-faint: #6d6860;
    --line: #34343a;
    --water: #2c3b40;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #1b1b1e;
  --paper-deep: #26262a;
  --card: #232327;
  --ink: #efeae1;
  --ink-soft: #a9a399;
  --ink-faint: #6d6860;
  --line: #34343a;
  --water: #2c3b40;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
img { max-width: 100%; display: block; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.wrap { max-width: 68rem; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* 顶栏 */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand b { font-family: 'Lora', var(--serif); font-weight: 500; letter-spacing: 0.24em; font-size: 20px; }
.brand i { font-style: normal; color: var(--star); font-size: 14px; }
.brand span { color: var(--ink-soft); font-size: 13px; letter-spacing: 0.3em; }
.nav nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.nav nav a { text-decoration: none; color: var(--ink-soft); }
.nav nav a.on, .nav nav a:hover { color: var(--ink); }

/* 首页 */
.hero { padding: 96px 0 72px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-family: 'Lora', var(--serif); font-weight: 500; font-size: clamp(48px, 9vw, 104px); letter-spacing: 0.18em; line-height: 1; margin: 0; }
.hero h1 sup { color: var(--star); font-size: 0.32em; vertical-align: 1.6em; margin-left: -0.1em; }
.hero .cn { font-size: 18px; letter-spacing: 0.8em; color: var(--ink-soft); margin: 18px 0 28px; }
.hero p { font-size: 18px; max-width: 30em; margin: 0 0 32px; text-wrap: pretty; }
.hero .art { aspect-ratio: 1; max-width: 360px; justify-self: center; width: 100%; border-radius: 28%; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45); animation: rise 900ms var(--ease) both; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 24px; border-radius: 23px; border: 1.5px solid var(--ink-faint); background: transparent; color: var(--ink); font: inherit; font-size: 15px; text-decoration: none; cursor: pointer; transition: background 220ms var(--ease), transform 160ms var(--ease); }
.btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); }
.btn.small { height: 36px; padding: 0 16px; font-size: 14px; }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--star); outline-offset: 2px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin: 24px 0 80px; }
.features > div { background: var(--paper); padding: 28px 26px; }
.features h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.features p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.features .k { font-family: var(--num); font-size: 13px; color: var(--star); letter-spacing: 0.08em; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
.section-head h2 { margin: 0; font-size: 26px; font-weight: 600; }
.section-head a { font-size: 15px; color: var(--ink-soft); }

/* 谱面卡片 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 16px; }
.pack { display: flex; gap: 14px; padding: 14px; background: var(--card); border-radius: 18px; text-decoration: none; border: 1px solid transparent; transition: border-color 220ms var(--ease), transform 220ms var(--ease); min-width: 0; animation: rise 520ms var(--ease) both; }
.pack:hover { border-color: var(--ink-faint); transform: translateY(-2px); }
.cover { width: 76px; height: 76px; flex: none; border-radius: 14px; background: var(--paper-deep); object-fit: cover; }
.cover.big { width: 100%; height: auto; aspect-ratio: 1; border-radius: 24px; }
.pack .meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pack .t { font-weight: 600; font-size: 17px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack .a { color: var(--ink-soft); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-family: var(--num); font-size: 12px; padding: 1px 9px; border-radius: 10px; background: var(--paper-deep); color: var(--ink); white-space: nowrap; }
.chip.src { font-family: var(--serif); background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }

/* 列表页 */
.page { padding-block: 48px 96px; }
.page h1 { font-size: 34px; margin: 0 0 6px; font-weight: 600; }
.page .lead { color: var(--ink-soft); margin: 0 0 28px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.search { flex: 1 1 18rem; height: 46px; border-radius: 23px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); padding: 0 20px; font: inherit; font-size: 15px; min-width: 0; }
select { height: 46px; border-radius: 23px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); padding: 0 16px; font: inherit; font-size: 15px; }
.empty { text-align: center; color: var(--ink-soft); padding: 64px 0; }
.more { display: flex; justify-content: center; margin-top: 28px; }

/* 详情页 */
.detail { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 40px; align-items: start; }
.detail h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.2; margin: 0; text-wrap: balance; }
.detail .alt { color: var(--ink-soft); margin: 6px 0 0; }
.detail .by { margin: 16px 0 24px; color: var(--ink-soft); font-size: 15px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 24px; font-size: 14px; color: var(--ink-soft); }
.facts b { color: var(--ink); font-weight: 500; }
.card { background: var(--card); border-radius: 20px; padding: 20px 22px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 32px 0 14px; }
.tab { border: 0; background: var(--paper-deep); color: var(--ink-soft); height: 36px; padding: 0 16px; border-radius: 18px; font: inherit; font-size: 14px; cursor: pointer; transition: background 200ms var(--ease), color 200ms var(--ease); }
.tab.on { background: var(--ink); color: var(--paper); }
.diffs { width: 100%; border-collapse: collapse; font-size: 15px; }
.diffs td, .diffs th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.diffs th { font-weight: 500; color: var(--ink-soft); font-size: 13px; }
.diffs tr:last-child td { border-bottom: 0; }
.diffs .r { text-align: right; }
.board { width: 100%; border-collapse: collapse; font-size: 15px; }
.board td, .board th { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.board th { font-weight: 500; color: var(--ink-soft); font-size: 13px; }
.board .r { text-align: right; }
.board .pos { width: 2.5rem; color: var(--ink-soft); }
.board tr.me td { background: color-mix(in srgb, var(--star) 12%, transparent); }
.board .rank { font-family: var(--num); font-weight: 600; }
.scroll-x { overflow-x: auto; }
.note { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--ink-soft); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

.prose { max-width: 42rem; }
.prose h2 { font-size: 20px; margin: 32px 0 8px; }
.prose li { margin: 4px 0; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 56px 0 40px; }
  .hero .art { max-width: 220px; order: -1; justify-self: start; }
  .nav nav { gap: 14px; }
  .brand span { display: none; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail .cover.big { max-width: 220px; }
}

/* ---- 0.11：登录、表单、徽章、审核、比赛 ---- */
.nav nav a.me { color: var(--ink); border: 1.5px solid var(--line); border-radius: 16px; padding: 2px 12px; }
.nav nav { overflow-x: auto; scrollbar-width: none; }
.nav nav::-webkit-scrollbar { display: none; }
.muted { color: var(--ink-soft); }
.badge { font-size: 12px; padding: 1px 9px; border-radius: 10px; white-space: nowrap; border: 1px solid currentColor; }
.badge.pending { color: var(--ink-soft); }
.badge.nominated { color: #4f7f8c; }
.badge.qualified { color: var(--star); }
.badge.ranked { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.badge.featured { color: var(--star); background: color-mix(in srgb, var(--star) 14%, transparent); border-color: transparent; }
.badge.phase { color: var(--ink); background: var(--paper-deep); border-color: transparent; }
.msg { border-radius: 14px; padding: 10px 14px; font-size: 14px; margin: 12px 0; }
.msg.err { background: color-mix(in srgb, var(--red) 12%, var(--card)); color: var(--red); }
.msg.ok { background: color-mix(in srgb, #3c8a5a 12%, var(--card)); color: #2f7349; }
.msg.info { background: var(--paper-deep); color: var(--ink); }
.form { display: grid; gap: 14px; max-width: 30rem; }
.form.wide { max-width: 46rem; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.field > span { color: var(--ink); }
.field small { color: var(--ink-soft); font-size: 12px; }
input[type='text'], input[type='password'], input[type='number'], input[type='datetime-local'], input[type='search']:not(.search), textarea, .input {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 0; width: 100%;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
input[type='file'] { font: inherit; font-size: 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 16px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 16px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.checks li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; padding: 6px 0; border: 0; }
.checks .k { flex: none; font-family: var(--num); font-size: 12px; width: 3.2em; text-align: center; border-radius: 8px; }
.checks .error .k { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.checks .warn .k { background: color-mix(in srgb, var(--star) 18%, transparent); color: #a8641f; }
.checks .ok .k, .checks .info .k { background: var(--paper-deep); color: var(--ink-soft); }
.timeline li { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 12px; font-size: 14px; padding: 8px 0; }
.timeline time { color: var(--ink-soft); font-family: var(--num); font-size: 13px; }
.comment { display: grid; gap: 4px; }
.comment .head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 14px; }
.comment .head .muted { font-size: 13px; }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment.objection { border-left: 3px solid var(--star); padding-left: 12px; }
.comment.review { border-left: 3px solid #4f7f8c; padding-left: 12px; }
.replies { margin: 8px 0 0 18px; display: grid; gap: 10px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--ink-soft); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); }
.section { margin-top: 44px; }
.section > h2 { font-size: 22px; margin: 0 0 14px; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 10px; }
.score-grid label { display: grid; gap: 4px; font-size: 14px; }
.score-grid input { text-align: center; font-family: var(--num); }
.entry-card { display: grid; gap: 10px; }
.entry-card .code { font-family: var(--num); font-weight: 600; font-size: 18px; }
.bar { height: 6px; border-radius: 3px; background: var(--paper-deep); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); }
.podium td.pos { font-weight: 600; color: var(--ink); }
details.card > summary { cursor: pointer; font-weight: 600; }
.hidden { display: none !important; }
@media (max-width: 760px) {
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
.row > input:not([type='checkbox']), .row > select, .row > textarea { width: auto; flex: 1 1 10rem; }
.row > input[type='number'] { flex: 0 1 8rem; }

/* ---- 0.12：头像、动效、Wiki ---- */
/* 页面之间的过渡（支持 View Transitions 的浏览器）：旧页淡出，新页轻轻上浮 */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 180ms var(--ease) both; }
::view-transition-new(root) { animation: vt-in 340ms var(--ease) both; }
.nav { view-transition-name: site-nav; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* 页面内容进场：逐个浮现 */
main.page > *, main > section, .hero > div > * { animation: rise 560ms var(--ease) both; }
main.page > :nth-child(1), .hero > div > :nth-child(1) { animation-delay: 0ms; }
main.page > :nth-child(2), .hero > div > :nth-child(2) { animation-delay: 50ms; }
main.page > :nth-child(3), .hero > div > :nth-child(3) { animation-delay: 100ms; }
main.page > :nth-child(4), .hero > div > :nth-child(4) { animation-delay: 150ms; }
main.page > :nth-child(5), .hero > div > :nth-child(5) { animation-delay: 200ms; }
main.page > :nth-child(n + 6) { animation-delay: 240ms; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 620ms var(--ease), transform 620ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* 首页：Logo 轻轻浮动，星星闪 */
.hero .art { animation: rise 900ms var(--ease) both, float 7s ease-in-out 1s infinite; }
.hero h1 sup, .brand i { display: inline-block; animation: twinkle 3.6s ease-in-out infinite; }
.hero h1 { animation: track-in 1100ms var(--ease) both; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1) rotate(0); } 45% { opacity: 0.55; transform: scale(0.82) rotate(-12deg); } 55% { opacity: 1; transform: scale(1.12) rotate(8deg); } }
@keyframes track-in { from { opacity: 0; letter-spacing: 0.42em; } to { opacity: 1; } }
.features > div { transition: background 260ms var(--ease); }
.features > div:hover { background: var(--card); }
.features > div:hover .k { color: var(--ink); }

/* 顶栏：当前页下方的指示条，悬停时滑过去 */
.nav nav { position: relative; }
.nav-ind { position: absolute; left: 0; bottom: 10px; width: 100px; height: 2px; border-radius: 1px; background: var(--star); transform-origin: 0 50%; transition: transform 380ms var(--ease), opacity 200ms; pointer-events: none; opacity: 0; }
.nav nav a { transition: color 200ms var(--ease); }
.nav nav a.me { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px 2px 3px; transition: border-color 220ms var(--ease), background 220ms var(--ease); }
.nav nav a.me:not(:has(img)) { padding: 2px 12px; }
.nav nav a.me:hover { border-color: var(--ink-faint); background: var(--card); }

/* 头像 */
.avatar { border-radius: 50%; object-fit: cover; background: var(--paper-deep); flex: none; display: inline-block; vertical-align: middle; opacity: 0; transition: opacity 260ms var(--ease); }
.avatar.ok { opacity: 1; }
.who { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; vertical-align: middle; }
.who span { text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 3px; }
.who:hover span { text-decoration-color: var(--ink); }
.avatar-big { width: 96px; height: 96px; }
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 8px; }
.profile-head h1 { margin: 0; }

/* 封面图加载完再淡入 */
img.cover { opacity: 0; transition: opacity 360ms var(--ease); }
img.cover.ok { opacity: 1; }

/* 按钮、卡片、标签的触感 */
.btn { transition: background 220ms var(--ease), transform 160ms var(--ease), box-shadow 220ms var(--ease), border-color 220ms var(--ease); }
.btn.primary:hover { box-shadow: 0 8px 22px -12px color-mix(in srgb, var(--ink) 70%, transparent); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.tab { transition: background 260ms var(--ease), color 260ms var(--ease), transform 160ms var(--ease); }
.tab:active { transform: scale(0.95); }
.tab.on { animation: pop 300ms var(--ease); }
@keyframes pop { from { transform: scale(0.92); } to { transform: none; } }
.card { transition: box-shadow 300ms var(--ease), transform 300ms var(--ease); }
a.card:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -24px rgba(0, 0, 0, 0.4); }
.pack:hover .cover { transform: scale(1.03); }
.pack .cover { transition: transform 420ms var(--ease), opacity 360ms var(--ease); }
.board tbody tr, .diffs tbody tr { transition: background 180ms var(--ease); }
.board tbody tr:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.board tbody tr { animation: rise 420ms var(--ease) both; }
.board tbody tr:nth-child(2) { animation-delay: 30ms; } .board tbody tr:nth-child(3) { animation-delay: 60ms; } .board tbody tr:nth-child(4) { animation-delay: 90ms; }
.board tbody tr:nth-child(5) { animation-delay: 120ms; } .board tbody tr:nth-child(n + 6) { animation-delay: 150ms; }
.msg { animation: rise 320ms var(--ease) both; }
details > summary { transition: color 200ms var(--ease); }
details[open] > :not(summary) { animation: rise 360ms var(--ease) both; }
.badge.qualified { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--star) 18%, transparent); } }

/* 骨架屏 */
.skel { border-radius: 18px; background: linear-gradient(100deg, var(--paper-deep) 30%, color-mix(in srgb, var(--paper-deep) 55%, var(--card)) 50%, var(--paper-deep) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite, fadein 300ms var(--ease) both; }
.skel-card { height: 104px; }
.skel-row { height: 46px; border-radius: 12px; margin-bottom: 8px; }
.skel-line { height: 16px; border-radius: 8px; margin: 10px 0; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes fadein { from { opacity: 0; } }

/* Wiki */
.wiki { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 40px; align-items: start; }
.wiki-side { position: sticky; top: 84px; display: grid; gap: 18px; align-content: start; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 24px 0; scrollbar-width: thin; }
.wiki-side h3 { font-size: 13px; color: var(--ink-soft); font-weight: 500; letter-spacing: 0.08em; margin: 0 0 6px; }
.wiki-side a { display: block; text-decoration: none; padding: 5px 10px; border-radius: 10px; font-size: 15px; color: var(--ink-soft); transition: background 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease); }
.wiki-side a:hover { color: var(--ink); background: var(--paper-deep); transform: translateX(2px); }
.wiki-side a.on { color: var(--ink); background: var(--card); font-weight: 600; }
.wiki-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--ink-soft); font-size: 13px; margin: 6px 0 24px; }
.md { max-width: 46rem; overflow-wrap: anywhere; }
.md h2 { font-size: 24px; margin: 36px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 19px; margin: 28px 0 8px; }
.md h4, .md h5 { font-size: 16px; margin: 22px 0 6px; }
.md p, .md li { text-wrap: pretty; }
.md li { margin: 4px 0; }
.md code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.88em; background: var(--paper-deep); padding: 1px 6px; border-radius: 6px; }
.md pre { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 16px 0; padding: 8px 16px; border-left: 3px solid var(--star); background: color-mix(in srgb, var(--star) 7%, transparent); border-radius: 0 12px 12px 0; color: var(--ink); }
.md-table { border-collapse: collapse; font-size: 15px; margin: 14px 0; min-width: 100%; }
.md-table th, .md-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.md-table th { font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.md a.wikilink { text-decoration-style: dotted; }
.wiki-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 16px; }
.wiki-cat ul { list-style: none; padding: 0; margin: 8px 0 0; }
.wiki-cat li a { display: block; padding: 7px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding 220ms var(--ease), color 200ms; }
.wiki-cat li:last-child a { border-bottom: 0; }
.wiki-cat li a:hover { padding-left: 6px; }
.wiki-cat li small { display: block; color: var(--ink-soft); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.wiki-edit textarea { min-height: 62vh; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; line-height: 1.6; }
.wiki-preview { min-height: 62vh; max-height: 75vh; overflow-y: auto; }
.diff { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .add { background: color-mix(in srgb, #3c8a5a 16%, transparent); display: block; }
.diff .del { background: color-mix(in srgb, var(--red) 14%, transparent); display: block; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 50%, transparent); }
.diff .same { color: var(--ink-soft); display: block; }
.crop { position: relative; width: 240px; height: 240px; border-radius: 50%; overflow: hidden; background: var(--paper-deep); touch-action: none; cursor: grab; }
.crop canvas { width: 100%; height: 100%; display: block; }
@media (max-width: 760px) {
  .wiki { grid-template-columns: minmax(0, 1fr); }
  .wiki-side { position: static; max-height: none; }
  .wiki-edit { grid-template-columns: minmax(0, 1fr); }
  .wiki-edit textarea, .wiki-preview { min-height: 40vh; }
  .nav-ind { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .avatar, img.cover { opacity: 1; }
}

/* ---------- 星屑 ✦ ---------- */
.stars-chip { margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; color: var(--ink-soft); background: var(--paper-deep); white-space: nowrap; }
.stars-hero { display: flex; align-items: baseline; gap: 10px; }
.stars-hero .big { font-size: 40px; line-height: 1; letter-spacing: 0.01em; }
.stars-hero .unit { font-size: 22px; color: var(--star); }
.stars-meter { height: 6px; border-radius: 3px; background: var(--paper-deep); overflow: hidden; margin: 6px 0 2px; }
.stars-meter > i { display: block; height: 100%; background: var(--star); border-radius: 3px; transition: width 600ms var(--ease); }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ledger li:last-child { border-bottom: 0; }
.ledger .what { grid-column: 1; grid-row: 1; font-size: 15px; }
.ledger .note { grid-column: 1; grid-row: 2; margin: 0; font-size: 13px; color: var(--ink-soft); }
.ledger .delta { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 17px; }
.ledger .delta.plus { color: #3F7A55; }
.ledger .delta.minus { color: var(--red); }
@media (max-width: 640px) { .stars-chip { display: none; } }
/* 导航项多了以后手机上不要竖排：不换行，放不下就横向滑动；Logo 旁的「星雲」小字在窄屏隐藏 */
.nav nav a { white-space: nowrap; flex-shrink: 0; }
.nav nav { min-width: 0; }
@media (max-width: 480px) {
  .nav .wrap { gap: 14px; }
  .nav nav { gap: 12px; font-size: 14px; }
  .nav nav a.me span:not(.avatar):not(.stars-chip) { display: none; }
}
