:root {
  --paper: #f6f1e7;
  --paper-deep: #ece4d5;
  --surface: #fffdf8;
  --ink: #242a26;
  --muted: #6f7169;
  --line: #d9d1c3;
  --red: #d94b35;
  --red-dark: #b93a27;
  --blue: #244b91;
  --yellow: #edc85b;
  --green: #44644d;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(53, 43, 27, .12);
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", SimSun, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.7; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }

.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 16px; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 16px; }
.site-header { width: min(1280px, calc(100% - 64px)); height: 92px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 23px; font-weight: 700; letter-spacing: .06em; }
.brand-mark { width: 31px; height: 31px; position: relative; display: inline-block; }
.brand-mark i { position: absolute; bottom: 2px; width: 8px; border: 2px solid var(--ink); border-radius: 2px 2px 0 0; background: var(--yellow); transform-origin: bottom; }
.brand-mark i:nth-child(1) { left: 1px; height: 22px; transform: rotate(-10deg); }
.brand-mark i:nth-child(2) { left: 11px; height: 28px; background: var(--red); }
.brand-mark i:nth-child(3) { left: 21px; height: 19px; background: var(--blue); transform: rotate(12deg); }
.header-nav { display: flex; align-items: center; gap: 34px; font-size: 14px; }
.header-nav a { position: relative; }
.header-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -5px; height: 2px; background: var(--red); transition: right .2s; }
.header-nav a:hover::after { right: 0; }
.text-button { border: 0; padding: 0; background: none; cursor: pointer; }
.header-nav .text-button { border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

.hero { width: min(1280px, calc(100% - 64px)); min-height: 650px; margin: auto; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 36px; padding: 54px 0 70px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 23px; color: var(--red-dark); font-size: 13px; font-weight: 700; letter-spacing: .14em; }
.eyebrow > span { width: 22px; height: 2px; background: currentColor; }
h1 { margin: 0; font-family: var(--serif); font-size: clamp(50px, 6.3vw, 86px); line-height: 1.15; letter-spacing: -.045em; font-weight: 700; }
.hero-lead { margin: 28px 0 32px; color: #555b53; font-size: 18px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { min-height: 50px; padding: 12px 23px; border: 1px solid transparent; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; cursor: pointer; font-size: 15px; font-weight: 700; transition: transform .18s, background .18s, color .18s; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--red); color: white; }
.button-primary:hover { background: var(--red-dark); }
.button-quiet { border-color: var(--line); background: transparent; }
.button-quiet:hover { background: var(--surface); }
.button-paper { background: var(--paper); color: var(--ink); }
.hero-note { display: flex; gap: 13px; align-items: flex-start; margin-top: 38px; max-width: 450px; color: var(--muted); font-size: 13px; }
.hero-note p { margin: 0; }
.note-line { flex: 0 0 28px; height: 1px; background: var(--muted); margin-top: 12px; }

.hero-still-life { position: relative; height: 500px; border-radius: 48% 48% 18px 18px; background: #dfd5bf; overflow: hidden; isolation: isolate; }
.hero-still-life::before { content: ""; position: absolute; width: 430px; height: 430px; left: 50%; top: 34px; transform: translateX(-50%); border-radius: 50%; background: #efe7d6; z-index: -2; }
.hero-still-life::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 128px; background: #bda887; transform: skewY(-2deg); transform-origin: left; z-index: -1; }
.lamp { position: absolute; right: 63px; top: 37px; width: 150px; height: 255px; }
.lamp-shade { position: absolute; top: 0; left: 4px; width: 142px; height: 79px; background: var(--red); clip-path: polygon(23% 0, 77% 0, 100% 100%, 0 100%); }
.lamp-stem { position: absolute; width: 7px; height: 150px; background: var(--ink); top: 76px; left: 72px; transform: rotate(7deg); transform-origin: top; }
.lamp-base { position: absolute; width: 102px; height: 14px; border-radius: 50%; background: var(--ink); bottom: 13px; left: 28px; }
.book { position: absolute; width: 154px; height: 207px; border: 3px solid var(--ink); border-radius: 4px 13px 13px 4px; box-shadow: 8px 12px 0 rgba(36,42,38,.12); display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--serif); font-weight: 700; font-size: 23px; line-height: 1.4; }
.book::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: rgba(36,42,38,.25); }
.book-one { background: var(--yellow); left: 65px; bottom: 66px; transform: rotate(-11deg); z-index: 3; }
.book-two { background: var(--blue); color: white; left: 197px; bottom: 51px; transform: rotate(5deg); z-index: 4; width: 169px; height: 226px; }
.book-three { background: #f8f4e8; left: 347px; bottom: 73px; transform: rotate(13deg); z-index: 2; }
.still-caption { position: absolute; left: 26px; bottom: 18px; color: #443b2d; font-size: 11px; letter-spacing: .08em; }

.section-kicker { display: flex; align-items: baseline; gap: 12px; }
.section-kicker > span { color: var(--red); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.section-kicker h2 { margin: 0; font-family: var(--serif); font-size: 30px; line-height: 1.3; }
.age-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 38px max(32px, calc((100vw - 1280px) / 2)); display: grid; grid-template-columns: 180px 1fr; gap: 30px; align-items: center; }
.age-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.age-grid button { border: 0; border-left: 1px solid var(--line); background: transparent; padding: 6px 14px; text-align: left; cursor: pointer; transition: background .2s, transform .2s; }
.age-grid button:hover { background: var(--surface); transform: translateY(-3px); }
.age-grid strong { display: block; font-family: var(--serif); font-size: 26px; line-height: 1.2; }
.age-grid span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; white-space: nowrap; }

.section-shell { width: min(1280px, calc(100% - 64px)); margin: auto; }
.library { padding: 84px 0 96px; }
.library-heading { display: flex; justify-content: space-between; gap: 32px; align-items: end; }
.result-summary { color: var(--muted); margin: 12px 0 0; font-size: 14px; }
.search-box { width: 340px; flex-shrink: 0; }
.search-box > label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.search-field { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--ink); padding: 8px 0; }
.search-field svg { width: 19px; height: 19px; fill: none; stroke: var(--ink); stroke-width: 1.7; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 15px; }
.filter-row { margin-top: 38px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.filter-group { display: flex; gap: 7px; flex-wrap: wrap; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; background: transparent; font-size: 12px; cursor: pointer; }
.filter-chip:hover { border-color: var(--ink); }
.filter-chip.is-active { background: var(--ink); border-color: var(--ink); color: white; }
.favorite-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; cursor: pointer; }
.favorite-toggle input { accent-color: var(--red); width: 16px; height: 16px; }
.category-row { display: flex; gap: 18px; flex-wrap: wrap; padding: 18px 0 4px; }
.category-button { padding: 3px 0; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.category-button.is-active { color: var(--red-dark); border-color: var(--red); font-weight: 700; }

.book-grid { margin-top: 30px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 42px 28px; }
.book-card { min-width: 0; position: relative; }
.book-cover-button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.cover-stage { position: relative; aspect-ratio: 4 / 4.7; background: var(--paper-deep); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cover-stage::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(36,42,38,.05); border-radius: inherit; pointer-events: none; }
.cover-stage img { width: 100%; height: 100%; object-fit: contain; background: #f2eee6; transition: transform .3s; }
.book-card:hover .cover-stage img { transform: scale(1.025); }
.cover-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; background: var(--cover-color, #e8c85f); color: var(--ink); font-family: var(--serif); font-size: 26px; font-weight: 700; }
.cover-fallback small { margin-top: 16px; font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: .12em; }
.age-badge { position: absolute; left: 12px; top: 12px; z-index: 2; padding: 4px 9px; background: var(--surface); border-radius: 999px; font-size: 11px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.favorite-button { position: absolute; right: 11px; top: 11px; z-index: 3; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,253,248,.92); cursor: pointer; display: grid; place-items: center; font-size: 18px; color: var(--muted); }
.favorite-button[aria-pressed="true"] { color: var(--red); }
.book-info { padding: 16px 2px 0; }
.book-info h3 { margin: 0; font-family: var(--serif); font-size: 20px; line-height: 1.45; }
.book-author { margin: 5px 0 10px; color: var(--muted); font-size: 12px; }
.book-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.book-meta span + span::before { content: "·"; margin-right: 8px; }
.empty-state { padding: 80px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 30px; }
.empty-state > span { font-size: 34px; color: var(--red); }
.empty-state h3 { font-family: var(--serif); font-size: 26px; margin: 10px 0; }
.empty-state p { color: var(--muted); margin: 0 0 24px; }

.how-section { background: var(--ink); color: var(--paper); padding: 78px max(32px, calc((100vw - 1280px) / 2)); display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; }
.section-kicker.light > span { color: var(--yellow); }
.how-intro h2 { font-family: var(--serif); font-size: clamp(34px, 4vw, 52px); line-height: 1.3; margin: 22px 0; letter-spacing: -.03em; }
.how-intro > p { color: #c4c6bc; max-width: 460px; margin: 0 0 30px; }
.method-list { list-style: none; padding: 0; margin: 0; }
.method-list li { display: flex; gap: 22px; padding: 22px 0; border-bottom: 1px solid #4a4f47; }
.method-list li:first-child { padding-top: 0; }
.method-list li > span { color: var(--yellow); font-size: 12px; font-weight: 700; padding-top: 5px; }
.method-list h3 { margin: 0 0 6px; font-size: 17px; }
.method-list p { margin: 0; color: #b9bdb3; font-size: 13px; }

.contribute { padding: 88px 0; display: grid; grid-template-columns: 1fr 390px; gap: 80px; align-items: center; }
.contribute h2 { margin: 0; font-family: var(--serif); font-size: clamp(32px, 4vw, 48px); line-height: 1.35; letter-spacing: -.03em; }
.contribute-action p { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.contribute-action small { display: block; color: var(--muted); margin-top: 10px; font-size: 11px; }

.site-footer { border-top: 1px solid var(--line); padding: 40px max(32px, calc((100vw - 1280px) / 2)) 22px; }
.footer-main { display: flex; align-items: center; gap: 28px; padding-bottom: 34px; }
.footer-main > p { color: var(--muted); font-size: 13px; }
.footer-links { margin-left: auto; display: flex; gap: 24px; font-size: 13px; }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 18px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 11px; }

dialog { color: var(--ink); border: 0; border-radius: 20px; padding: 0; box-shadow: var(--shadow); max-height: calc(100dvh - 48px); }
dialog::backdrop { background: rgba(24,28,24,.58); backdrop-filter: blur(4px); }
.book-dialog { width: min(850px, calc(100% - 32px)); background: var(--surface); }
.dialog-close { position: absolute; top: 16px; right: 16px; z-index: 5; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--paper); cursor: pointer; font-size: 25px; line-height: 1; }
.detail-layout { display: grid; grid-template-columns: 310px 1fr; min-height: 480px; }
.detail-cover { background: var(--paper-deep); display: flex; align-items: center; justify-content: center; padding: 44px; position: relative; }
.detail-cover img { max-height: 370px; width: 100%; object-fit: contain; box-shadow: 8px 12px 24px rgba(0,0,0,.13); }
.detail-copy { padding: 48px 42px 38px; }
.detail-copy h2 { font-family: var(--serif); font-size: 34px; line-height: 1.3; margin: 8px 0; }
.detail-author { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.detail-edition { color: var(--muted); font-size: 12px; margin: 0 0 20px; }
.detail-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 24px; }
.detail-tags span { padding: 4px 9px; background: var(--paper); border-radius: 999px; font-size: 11px; }
.detail-copy h3 { font-size: 13px; margin: 22px 0 6px; color: var(--red-dark); }
.detail-copy p { font-size: 14px; margin: 0; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.detail-source { margin-top: 22px !important; color: var(--muted); font-size: 11px !important; }
.detail-source a { text-decoration: underline; }

.submit-dialog, .method-dialog { width: min(650px, calc(100% - 32px)); background: var(--surface); padding: 42px; }
.submit-dialog h2, .method-dialog h2 { font-family: var(--serif); font-size: 32px; margin: 0; }
.dialog-lead { color: var(--muted); margin: 10px 0 26px; font-size: 14px; }
#submit-form label { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 700; }
#submit-form input, #submit-form select, #submit-form textarea { display: block; width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; background: var(--paper); color: var(--ink); font-weight: 400; }
.form-row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-status { min-height: 22px; color: var(--green); font-size: 12px; margin-bottom: 0; }
.method-prose h3 { margin: 24px 0 5px; font-size: 15px; }
.method-prose p { margin: 0; color: var(--muted); font-size: 14px; }
.method-note { margin: 28px 0 0; padding: 15px; background: var(--paper); border-radius: 10px; font-size: 12px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 12px 20px; border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.admin-shell { width: min(980px, calc(100% - 48px)); margin: 50px auto 80px; }
.admin-shell h1 { font-size: 48px; }
.admin-lead { color: var(--muted); max-width: 700px; }
.admin-panel { margin-top: 32px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-panel h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 24px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.submission-list { display: grid; gap: 12px; }
.submission-item { border-top: 1px solid var(--line); padding-top: 14px; }
.submission-item h3 { margin: 0; font-size: 16px; }
.submission-item p { margin: 4px 0; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.submission-item small { color: var(--muted); }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr 420px; gap: 18px; }
  .hero-still-life { height: 450px; transform: scale(.9); transform-origin: right center; }
  .age-strip { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .how-section { gap: 40px; }
  .contribute { gap: 40px; }
}

@media (max-width: 800px) {
  .site-header, .hero, .section-shell { width: calc(100% - 40px); }
  .site-header { height: 76px; }
  .header-nav { gap: 18px; }
  .header-nav a:first-child { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 30px; gap: 24px; }
  .hero-still-life { width: 100%; max-width: 520px; height: 430px; transform: none; justify-self: center; }
  .hero-lead { font-size: 16px; }
  .age-strip { padding: 30px 20px; }
  .age-grid { grid-template-columns: repeat(3, 1fr); gap: 14px 0; }
  .library { padding: 60px 0; }
  .library-heading { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .filter-row { align-items: flex-start; flex-direction: column; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 18px; }
  .how-section { grid-template-columns: 1fr; padding: 60px 20px; }
  .contribute { grid-template-columns: 1fr; padding: 60px 0; gap: 26px; }
  .footer-main { flex-wrap: wrap; gap: 18px; }
  .footer-links { margin-left: 0; width: 100%; }
  .detail-layout { grid-template-columns: 220px 1fr; }
  .detail-cover { padding: 28px; }
  .detail-copy { padding: 44px 28px 30px; }
}

@media (max-width: 520px) {
  .brand { font-size: 20px; }
  .header-nav { font-size: 12px; }
  .header-nav .text-button { display: none; }
  .hero { min-height: auto; padding-bottom: 48px; }
  h1 { font-size: 48px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-still-life { height: 340px; }
  .hero-still-life::before { width: 310px; height: 310px; }
  .hero-still-life { overflow: hidden; }
  .lamp { right: 17px; top: 20px; transform: scale(.7); transform-origin: top right; }
  .book { width: 112px; height: 155px; font-size: 18px; }
  .book-one { left: 35px; bottom: 45px; }
  .book-two { left: 125px; bottom: 35px; width: 126px; height: 175px; }
  .book-three { left: 235px; bottom: 52px; }
  .still-caption { font-size: 9px; left: 18px; }
  .section-kicker h2 { font-size: 27px; }
  .age-grid button { padding: 5px 9px; }
  .age-grid strong { font-size: 22px; }
  .age-grid span { font-size: 10px; }
  .filter-group { gap: 6px; }
  .filter-chip { padding: 6px 11px; }
  .book-grid { gap: 28px 13px; }
  .book-info h3 { font-size: 17px; }
  .book-author { font-size: 11px; }
  .cover-fallback { font-size: 20px; padding: 18px; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-cover { padding: 38px; max-height: 300px; }
  .detail-cover img { max-height: 225px; }
  .detail-copy { padding: 28px 24px 32px; }
  .detail-copy h2 { font-size: 28px; }
  .submit-dialog, .method-dialog { padding: 34px 24px 26px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .footer-bottom { flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
