:root {
  color-scheme: light;
  --bg: #f5f3ef;
  --paper: #fffdfa;
  --ink: #2f2d2a;
  --muted: #8a8580;
  --line: #e2ded7;
  --accent: #6e8fa0;
  --resonate: #a66f66;
  --shadow: 0 18px 48px rgba(47, 45, 42, .08);
}
[data-theme="night"] {
  --bg: #252727;
  --paper: #303232;
  --ink: #ece9e3;
  --muted: #aaa7a2;
  --line: #444646;
  --accent: #8eabb8;
  --resonate: #c18e84;
  --shadow: 0 18px 48px rgba(0, 0, 0, .18);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 220px; padding: 48px 28px 30px; background: color-mix(in srgb, var(--paper) 92%, transparent); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 10; }
.brand { color: var(--ink); text-decoration: none; font: 600 28px/40px "Noto Serif SC", SimSun, serif; margin: 0 16px 64px; }
.nav-list { display: grid; gap: 8px; }
.nav-list a { height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 14px; color: var(--muted); text-decoration: none; border-radius: 6px; transition: background .18s, color .18s; }
.nav-list a:hover { background: color-mix(in srgb, var(--accent) 8%, var(--paper)); color: var(--ink); }
.nav-list a.active { background: color-mix(in srgb, var(--accent) 14%, var(--paper)); color: var(--accent); }
.nav-icon { width: 22px; text-align: center; font-size: 21px; }
.quiet-button { margin-top: auto; border: 0; background: transparent; color: var(--muted); text-align: left; padding: 12px 16px; cursor: pointer; }
main { grid-column: 2; min-width: 0; padding: 0 56px 80px; }
.view { display: none; max-width: 1140px; margin: 0 auto; }
.view.active { display: block; animation: appear .22s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.page-header { padding: 54px 0 30px; }
.home-header, .discover-header, .collection-header { min-height: 178px; padding: 50px 0 34px; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; border-bottom: 1px solid var(--line); }
.home-header p, .discover-header p { margin: 0 0 10px; color: var(--accent); font-size: 13px; }
.home-header span, .discover-header > div > span { color: var(--muted); font-size: 14px; }
.icon-button { width: 46px; height: 46px; flex: 0 0 46px; border: 1px solid var(--accent); border-radius: 50%; background: var(--accent); color: white; font-size: 25px; cursor: pointer; }
.home-layout { display: grid; grid-template-columns: minmax(520px, 760px) 280px; gap: 48px; padding-top: 34px; align-items: start; }
.feed, .discover-feed, .profile-list { display: grid; gap: 24px; }
.feed-card { overflow: hidden; background: var(--paper); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 6px; box-shadow: var(--shadow); cursor: pointer; transition: transform .18s, box-shadow .18s; }
.feed-card:hover { transform: translateY(-2px); box-shadow: 0 22px 52px rgba(47,45,42,.1); }
.feed-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.feed-card > img { width: 100%; aspect-ratio: 16/7; display: block; object-fit: cover; }
.feed-card-copy { padding: 34px 38px 22px; }
.feed-card-copy > p { margin: 4px 0 24px; font: 400 23px/42px "Noto Serif SC", SimSun, serif; }
.feed-card-copy > span { color: var(--muted); font: 400 13px/22px "Noto Serif SC", SimSun, serif; }
.feed-card .preview-tags { margin-top: 24px; }
.preview-tags em { padding: 6px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--paper)); color: var(--accent); font: normal 12px/18px "Noto Sans SC", "Microsoft YaHei", sans-serif; }
.feed-card.compact .feed-card-copy { padding: 26px 30px 20px; }
.feed-card.compact .feed-card-copy > p { font-size: 19px; line-height: 36px; }
.feed-card .card-actions button { border: 0; background: transparent; color: inherit; cursor: pointer; }
.feed-card .card-actions button[aria-pressed="true"] { color: var(--resonate); }
.home-rail { display: grid; gap: 18px; position: sticky; top: 30px; }
.home-rail section { padding: 24px; background: color-mix(in srgb, var(--paper) 66%, transparent); border-top: 1px solid var(--line); }
.rail-quote { margin: 18px 0 4px; font: 400 18px/31px "Noto Serif SC", SimSun, serif; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag-cloud button { border: 0; border-radius: 999px; padding: 7px 10px; background: color-mix(in srgb, var(--accent) 12%, var(--paper)); color: var(--accent); cursor: pointer; }
.rail-music { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.rail-music > span { width: 36px; height: 36px; display: grid; place-items: center; background: #b7c7cb; border-radius: 4px; }
.rail-music div { display: grid; gap: 3px; }
.rail-music small { color: var(--muted); }
.search-box { width: min(330px, 34vw); height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.search-box input { height: auto; padding: 0; margin: 0; border: 0; background: transparent; }
.filter-row { padding: 22px 0; display: flex; gap: 8px; overflow-x: auto; }
.filter-row button, .profile-tabs button { flex: 0 0 auto; padding: 9px 15px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.filter-row button.active, .profile-tabs button.active { background: var(--paper); color: var(--ink); box-shadow: 0 4px 14px rgba(47,45,42,.05); }
.theme-banner { min-height: 220px; margin-bottom: 26px; padding: 34px 38px; display: grid; grid-template-columns: 1fr 42%; align-items: center; gap: 30px; background: #dfe8ea; border-radius: 6px; overflow: hidden; }
.theme-banner span { color: #607987; font-size: 12px; }
.theme-banner h2 { margin: 12px 0; font: 600 25px/38px "Noto Serif SC", SimSun, serif; color: #33444c; }
.theme-banner p { color: #667a82; font-size: 13px; }
.theme-banner img { width: 100%; height: 152px; object-fit: cover; border-radius: 4px; }
.empty-state { min-height: 200px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); }
.empty-state strong { color: var(--ink); font: 600 18px/30px "Noto Serif SC", SimSun, serif; }
.page-header p, .collection-header p { margin: 0 0 10px; color: var(--accent); font-size: 13px; }
h1 { margin: 0 0 10px; font: 600 32px/44px "Noto Serif SC", SimSun, serif; }
.page-header > span, .collection-header span { color: var(--muted); font-size: 14px; }
.compose-layout { display: grid; grid-template-columns: minmax(560px, 720px) 320px; gap: 48px; align-items: start; }
.paper { background: var(--paper); border: 1px solid rgba(226,222,215,.72); border-radius: 6px; box-shadow: var(--shadow); }
.editor { min-height: 780px; padding: 38px 40px; }
.editor > label { display: flex; justify-content: space-between; color: #625f5b; font-size: 13px; }
.editor label span { color: #aaa49e; }
textarea { width: 100%; display: block; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; }
#quote { height: 168px; padding: 24px 0; font: 400 24px/42px "Noto Serif SC", SimSun, serif; }
.reflection { height: 128px; padding: 18px 0; font-size: 15px; line-height: 28px; }
textarea::placeholder, input::placeholder { color: #bbb5af; }
.rule, .detail-rule { height: 1px; background: var(--line); margin: 4px 0 28px; }
.field-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; }
.field-grid label { color: var(--muted); font-size: 12px; }
input, select { width: 100%; height: 42px; margin-top: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--paper) 88%, var(--bg)); color: var(--ink); outline: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.tag-row { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
.tag-row span, .preview-tags span { padding: 6px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--paper)); color: var(--accent); font-size: 12px; }
.tag-row button, .attach-row button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.attach-row { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; gap: 26px; }
.attach-button { color: var(--muted); cursor: pointer; }
.attach-row .selected { color: var(--accent); }
.form-error { min-height: 22px; margin: 16px 0 0; color: var(--resonate); font-size: 12px; }
.preview-rail { position: sticky; top: 96px; }
.rail-heading { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 14px; }
.rail-heading small { color: #a67f73; }
.quote-preview { min-height: 410px; padding: 42px 30px 24px; display: flex; flex-direction: column; }
.preview-quote { margin: 30px 0 26px; text-align: center; font: 400 20px/38px "Noto Serif SC", SimSun, serif; }
.preview-source { text-align: center; color: #6f6a65; font: 400 13px/22px "Noto Serif SC", SimSun, serif; }
.preview-tags { display: flex; gap: 6px; margin-top: auto; }
.card-actions { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: #9c9690; font-size: 13px; }
.save-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; margin-top: 16px; }
.primary, .secondary { height: 44px; padding: 0 18px; border-radius: 6px; cursor: pointer; }
.primary { border: 1px solid var(--accent); background: var(--accent); color: white; }
.secondary { border: 1px solid var(--line); background: var(--paper); }
.detail-top { height: 80px; display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.detail-top button { border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.detail-owner-actions { margin-left: auto; display: flex; gap: 6px; }
.detail-owner-actions button { padding: 8px 10px; color: var(--muted); font-size: 13px; }
.detail-owner-actions button:hover { color: var(--ink); }
.detail-layout { display: grid; grid-template-columns: minmax(600px, 760px) 280px; gap: 48px; align-items: start; }
.detail-paper { overflow: hidden; }
.detail-paper > img { width: 100%; height: 340px; display: block; object-fit: cover; }
.detail-copy { padding: 44px 48px 48px; }
.detail-quote { margin: 12px 0 28px; text-align: center; font: 400 28px/52px "Noto Serif SC", SimSun, serif; }
.detail-source { text-align: center; color: var(--muted); font: 400 13px/22px "Noto Serif SC", SimSun, serif; }
.detail-rule { margin: 42px 0 34px; }
.detail-copy h2 { margin: 0 0 14px; font: 600 17px/28px "Noto Serif SC", SimSun, serif; }
.reflection-copy { margin: 0 0 24px; color: color-mix(in srgb, var(--ink) 82%, var(--muted)); font-size: 15px; line-height: 29px; }
.music-bar { height: 62px; margin-top: 28px; padding: 0 14px; display: flex; align-items: center; gap: 12px; background: color-mix(in srgb, var(--accent) 9%, var(--paper)); border-radius: 6px; }
.album { width: 36px; height: 36px; border-radius: 4px; background: #bac8cb; display: grid; place-items: center; }
.music-bar div { display: grid; gap: 4px; }
.music-bar strong { font-size: 13px; }
.music-bar small { color: var(--muted); font-size: 11px; }
.mood { margin-left: auto; color: var(--accent); font-size: 12px; }
.music-bar button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: white; cursor: pointer; }
.detail-actions { margin-top: 32px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4,1fr); }
.detail-actions button { border: 0; background: transparent; display: grid; justify-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.detail-actions button span { font-size: 12px; }
.detail-actions .resonated { color: var(--resonate); }
.detail-actions .selected { color: #b99b5f; }
.comments { margin-top: 38px; }
.comments > p { padding: 15px 0; margin: 0; color: color-mix(in srgb, var(--ink) 78%, var(--muted)); border-bottom: 1px solid var(--line); font-size: 13px; }
.comments strong { margin-right: 14px; color: var(--ink); }
.comment-input { margin-top: 20px; height: 44px; padding-left: 14px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); color: #aaa49e; border-radius: 6px; font-size: 13px; }
.comment-input button { height: 100%; border: 0; padding: 0 18px; background: transparent; color: var(--accent); cursor: pointer; }
.detail-rail { display: grid; gap: 18px; }
.detail-rail section { padding: 24px; background: color-mix(in srgb, var(--paper) 66%, transparent); border-top: 1px solid var(--line); }
.eyebrow { color: var(--accent); font-size: 12px; }
.detail-rail h3 { margin: 14px 0 10px; font: 600 21px/32px "Noto Serif SC", SimSun, serif; }
.detail-rail p { color: color-mix(in srgb, var(--ink) 78%, var(--muted)); font-size: 13px; line-height: 23px; }
.detail-rail small { color: var(--muted); }
.related { font: 400 16px/29px "Noto Serif SC", SimSun, serif; }
.collection-header { padding: 50px 0 34px; }
.collection-header .primary { min-width: 126px; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 28px 24px; }
.collection-card, .new-collection { position: relative; aspect-ratio: 4/5; border-radius: 6px; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.collection-card { padding: 28px; display: flex; flex-direction: column; border: 1px solid rgba(47,45,42,.06); box-shadow: 0 10px 30px rgba(47,45,42,.06); }
.collection-card:hover, .new-collection:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(47,45,42,.09); }
.collection-card h2 { margin: auto 0; text-align: center; font: 600 23px/34px "Noto Serif SC", SimSun, serif; z-index: 2; }
.collection-card footer { display: flex; justify-content: space-between; align-items: end; z-index: 2; font-size: 12px; }
.collection-card small { color: rgba(47,45,42,.56); }
.gray { background: #e9e7e3; }
.green { background: #c9d0c4; }
.blue { background: #bdccd2; }
.mauve { background: #ccc6cf; }
.image-cover { color: white; }
.image-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.72); }
.image-cover small { color: rgba(255,255,255,.72); }
.new-collection { border: 1px dashed #c9c4bc; background: transparent; display: grid; place-content: center; justify-items: center; gap: 10px; cursor: pointer; }
.new-collection span { font-size: 30px; font-weight: 300; color: var(--accent); }
.new-collection small { color: var(--muted); }
.auth-loading { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.auth-guest { min-height: calc(100dvh - 80px); display: grid; grid-template-columns: minmax(340px, 1fr) 420px; gap: 84px; align-items: center; padding: 54px 0; }
.auth-intro { align-self: center; }
.auth-intro > p { margin: 0 0 12px; color: var(--accent); font-size: 13px; }
.auth-intro h1 { max-width: 520px; margin-bottom: 22px; font-size: 44px; line-height: 1.45; }
.auth-intro > span { color: var(--muted); font-size: 14px; }
.auth-intro blockquote { max-width: 440px; margin: 92px 0 0; padding: 18px 0 18px 22px; border-left: 2px solid var(--accent); color: color-mix(in srgb, var(--ink) 78%, var(--muted)); font: 400 18px/32px "Noto Serif SC", SimSun, serif; }
.auth-panel { min-height: 500px; padding: 30px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: color-mix(in srgb, var(--bg) 76%, var(--paper)); border-radius: 6px; }
.auth-switch button { height: 38px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.auth-switch button.active { background: var(--paper); color: var(--ink); box-shadow: 0 3px 12px rgba(47,45,42,.06); }
.auth-panel form { display: grid; gap: 20px; padding-top: 34px; }
.auth-panel form h2 { margin: 0 0 6px; font: 600 25px/36px "Noto Serif SC", SimSun, serif; }
.auth-panel form > div > p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-panel label { color: var(--muted); font-size: 12px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-submit:disabled { opacity: .58; cursor: wait; }
.auth-error { min-height: 20px; margin: -4px 0; color: var(--resonate); font-size: 12px; }
.profile-header { padding: 54px 0 34px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.avatar { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: #bdccd2; color: white; font: 600 28px/1 "Noto Serif SC", SimSun, serif; }
.profile-identity { min-width: 0; }
.profile-header h1 { margin-bottom: 7px; font-size: 28px; }
.profile-header p { margin: 0; color: var(--muted); }
.logout-button { margin-left: auto; }
.profile-stats { padding: 28px 0; display: grid; grid-template-columns: repeat(4, 120px); border-bottom: 1px solid var(--line); }
.profile-stats div { display: grid; gap: 5px; }
.profile-stats strong { font: 600 22px/30px "Noto Serif SC", SimSun, serif; }
.profile-stats span { color: var(--muted); font-size: 12px; }
.profile-tabs { padding: 24px 0; display: flex; gap: 8px; }
.profile-list { max-width: 760px; }
dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.18); }
dialog::backdrop { background: rgba(47,45,42,.28); backdrop-filter: blur(3px); }
dialog form { padding: 26px; display: grid; gap: 20px; }
.migration-content { padding: 26px; display: grid; gap: 20px; }
.migration-content > p { margin: 0; color: color-mix(in srgb, var(--ink) 78%, var(--muted)); font-size: 14px; line-height: 26px; }
.migration-content > small { color: var(--accent); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { margin: 0; font: 600 22px/32px "Noto Serif SC", SimSun, serif; }
.dialog-heading button { border: 0; background: transparent; font-size: 24px; cursor: pointer; }
dialog label { color: var(--muted); font-size: 12px; }
dialog textarea { height: 86px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--paper) 85%, var(--bg)); font-size: 14px; line-height: 24px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.danger-button { height: 44px; padding: 0 18px; border: 1px solid var(--resonate); border-radius: 6px; background: var(--resonate); color: white; cursor: pointer; }
.toast { position: fixed; left: calc(50% + 110px); bottom: 34px; transform: translate(-50%,18px); opacity: 0; pointer-events: none; padding: 11px 18px; background: #3d3a36; color: white; border-radius: 6px; font-size: 13px; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
@media (max-width: 1180px) {
  main { padding-inline: 36px; }
  .compose-layout, .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .preview-rail, .detail-rail { position: static; max-width: 720px; }
  .preview-rail { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
  .rail-heading { grid-column: 1/-1; }
  .home-layout { grid-template-columns: minmax(0, 760px); }
  .home-rail { display: none; }
  .auth-guest { grid-template-columns: minmax(280px, 1fr) 390px; gap: 44px; }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; width: auto; height: 68px; padding: 0 12px; border: 0; border-top: 1px solid var(--line); flex-direction: row; align-items: center; }
  .brand, .quiet-button { display: none; }
  .nav-list { width: 100%; display: grid; grid-template-columns: repeat(5,1fr); }
  .nav-list a { height: 58px; padding: 4px; display: grid; place-items: center; gap: 0; font-size: 11px; }
  main { padding: 0 18px 96px; }
  .page-header, .home-header, .discover-header, .collection-header { min-height: 0; padding-top: 34px; }
  .home-layout { padding-top: 22px; }
  .home-header, .discover-header { align-items: flex-start; }
  .discover-header { display: grid; }
  .search-box { width: 100%; }
  .theme-banner { min-height: auto; padding: 24px; grid-template-columns: 1fr; }
  .theme-banner img { height: 150px; }
  .feed-card-copy { padding: 26px 22px 18px; }
  .feed-card-copy > p { font-size: 20px; line-height: 37px; }
  .editor { min-height: auto; padding: 28px 22px; }
  .field-grid { grid-template-columns: 1fr; }
  .preview-rail { display: block; }
  .quote-preview { max-width: 360px; }
  .detail-paper > img { height: 220px; }
  .detail-copy { padding: 28px 22px 36px; }
  .detail-quote { font-size: 23px; line-height: 42px; }
  .collection-header { align-items: start; gap: 24px; }
  .collection-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 12px; }
  .collection-card { padding: 18px; }
  .collection-card h2 { font-size: 18px; }
  .collection-card footer { display: grid; gap: 5px; }
  .profile-header { padding-top: 34px; }
  .auth-guest { min-height: auto; grid-template-columns: 1fr; gap: 36px; padding: 34px 0; }
  .auth-intro h1 { font-size: 32px; line-height: 1.45; }
  .auth-intro blockquote { margin-top: 36px; }
  .auth-panel { min-height: 0; padding: 22px; }
  .profile-header { align-items: flex-start; flex-wrap: wrap; }
  .profile-identity { flex: 1; }
  .profile-header p { overflow-wrap: anywhere; }
  .logout-button { width: 100%; margin: 4px 0 0; }
  .profile-stats { grid-template-columns: repeat(4,1fr); }
  .toast { left: 50%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
