:root { color-scheme: light; --bg: #f7f8f4; --panel: #ffffff; --line: #dde4d7; --line-strong: #c6d0bf; --ink: #223024; --muted: #617063; --accent: #2f6b47; --accent-soft: #edf5ef; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Noto Serif SC", "Source Han Serif SC", "PingFang SC", serif; color: var(--ink); background: linear-gradient(180deg, #fbfcf8 0%, var(--bg) 100%); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.page { max-width: 1120px; margin: 0 auto; padding: 28px 18px 48px; }
.hero { padding: 24px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 28px rgba(34, 48, 36, 0.05); }
.hero h1 { margin: 0 0 10px; font-size: 32px; letter-spacing: 0.02em; }
.hero p { margin: 0; color: var(--muted); line-height: 1.7; }
.crumbs { margin: 20px 0 24px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs span { color: #9aac99; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 24px 0 28px; }
.stat, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: 0 8px 22px rgba(34, 48, 36, 0.04); }
.stat strong { display: block; font-size: 26px; margin-top: 8px; }
.panel h2, .panel h3 { margin-top: 0; }
.muted { color: var(--muted); }
.surname-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.surname-nav a, .surname-nav span { padding: 8px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.search-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; width: 100%; }
.search-form input { min-width: 260px; max-width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdf9; color: var(--ink); font: inherit; text-align: center; }
.search-form input::placeholder { text-align: center; }
.search-form select { min-width: 180px; max-width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdf9; color: var(--ink); font: inherit; }
.search-form button, .search-form .reset-link { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--accent-soft); color: var(--ink); font: inherit; }
.search-form button { cursor: pointer; }
.search-form .reset-link { display: inline-flex; align-items: center; }
.search-actions { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; white-space: nowrap; }
.hero-search { display: grid; gap: 14px; }
.hero-search .search-form { width: 100%; }
.hero-search .search-form-home { display: grid; grid-template-columns: auto minmax(150px, 0.95fr) minmax(180px, 1fr) minmax(360px, 2.2fr) auto; gap: 10px; align-items: start; }
.hero-search .search-form-home input { width: 100%; min-width: 0; }
.search-field { min-width: 0; }
.search-actions-home { justify-content: flex-end; }
.hero-quick-stats { display: flex; justify-content: center; align-items: baseline; gap: 12px; color: var(--muted); font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; opacity: 0.88; }
.hero-quick-stats .divider { color: #aeb9ae; }
.surname-section + .surname-section { margin-top: 20px; }
.author-list, .work-list { list-style: none; padding: 0; margin: 0; }
.author-list li, .work-list li { padding: 12px 0; border-top: 1px solid rgba(217, 201, 168, 0.65); }
.author-list li:first-child, .work-list li:first-child { border-top: none; padding-top: 0; }
.count { color: var(--muted); font-size: 14px; }
.pager { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 22px; }
.pager a, .pager strong { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fbfdf9; }
.empty { color: var(--muted); padding: 16px 0 4px; }
.work-header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.meta div { background: #fbfdf9; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.content { white-space: pre-wrap; line-height: 1.95; font-size: 18px; background: #fbfdf9; border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.home-note { margin: -8px 0 20px; color: var(--muted); }
.tree-board { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: 0 8px 22px rgba(34, 48, 36, 0.04); }
.era-group + .era-group { margin-top: 22px; }
.era-title { margin: 0; font-size: 18px; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.fold-group { border: 1px solid var(--line); border-radius: 14px; background: #fcfefb; overflow: hidden; }
.fold-group + .fold-group { margin-top: 14px; }
.fold-summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; font-size: 16px; font-weight: 600; text-align: left; }
.fold-summary::-webkit-details-marker { display: none; }
.fold-heading { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.fold-marker { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 7px 10px; border-radius: 999px; background: #e3eef8; color: #245a92; font-size: 14px; font-weight: 700; line-height: 1; flex: 0 0 auto; }
.fold-marker-era { min-width: 64px; }
.fold-meta { color: var(--muted); font-size: 14px; font-weight: 400; }
.fold-inline-meta { color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.5; }
.fold-inline-number { color: #9aac99; }
.fold-inline-sep { color: #c2cdc0; }
.fold-content { padding: 0 16px 14px; }
.fold-nested { background: #fff; box-shadow: none; }
.tree-list { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; }
.tree-list::before { content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 1px; background: var(--line-strong); }
.tree-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.tree-row:first-child { border-top: none; }
.tree-row::before { content: ""; position: absolute; left: -18px; top: 50%; width: 14px; height: 1px; background: var(--line-strong); }
.tree-name a { font-size: 17px; color: var(--ink); }
.tree-meta { color: var(--muted); font-size: 14px; white-space: nowrap; }
.home-dynasty-list { display: grid; grid-template-columns: 1fr; gap: 14px; }
.home-initial-block + .home-initial-block { margin-top: 12px; }
.home-author-list, .home-work-list { list-style: none; padding: 0; margin: 0; }
.home-author-list li + li, .home-work-list li + li { margin-top: 10px; }
.home-author-name { font-size: 16px; color: var(--ink); }
.home-work-list { border-top: 1px solid var(--line); margin-top: 4px; }
.home-work-list li { padding-top: 6px; }
.home-work-title { font-size: 15px; color: var(--ink); }
.home-work-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.home-work-content { margin-top: 10px; color: var(--ink); line-height: 1.85; background: #fbfdf9; border: 1px solid var(--line); border-radius: 14px; padding: 44px 16px 16px; }
.home-work-content p { margin: 0; }
.home-work-content p + p { margin-top: 6px; }
.home-work-content-poem { text-align: center; }
.home-work-detail { border-color: transparent; background: transparent; }
.home-work-detail > .fold-summary { padding: 8px 10px; border-radius: 10px; gap: 10px; transition: background-color 160ms ease; }
.home-work-detail > .fold-summary:hover { background: #f3f7f2; }
.home-work-detail[open] > .fold-summary { background: #f6faf5; }
.home-work-detail > .fold-content { padding: 2px 10px 10px; }
.home-async-placeholder { padding-top: 6px; }
.home-async-loading, .home-async-empty, .home-async-error { color: var(--muted); font-size: 14px; padding: 8px 0 2px; }
.home-async-error { color: #9a4b34; }
.initial-list { list-style: none; padding: 0; margin: 0; }
.initial-list li { padding: 10px 0; border-top: 1px solid var(--line); }
.initial-list li:first-child { border-top: none; }
.search-section + .search-section { margin-top: 18px; }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.result-list li:first-child { border-top: none; }
.result-title { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.result-title a { color: var(--ink); font-size: 17px; }
.result-work-detail { border-color: transparent; background: transparent; }
.result-work-detail > .fold-summary { padding: 0; gap: 10px; transition: background-color 160ms ease; }
.result-work-detail > .fold-summary:hover { background: transparent; }
.result-work-detail > .fold-content { padding: 8px 0 0; }
.result-snippet { color: var(--muted); margin-top: 6px; line-height: 1.7; }
.result-work-content { margin-top: 10px; color: var(--ink); line-height: 1.85; background: #fbfdf9; border: 1px solid var(--line); border-radius: 14px; padding: 44px 16px 16px; }
.result-work-content p { margin: 0; }
.result-work-content p + p { margin-top: 6px; }
.result-work-content-poem { text-align: center; }
.copyable-work-box { position: relative; margin-top: 10px; }
.copyable-work-box-poem { width: fit-content; max-width: min(100%, 22em); margin-left: auto; margin-right: auto; }
.copyable-work-box > .result-work-content, .copyable-work-box > .home-work-content, .copyable-work-box > .content { margin-top: 0; }
.copyable-work-body-poem { text-align: center; }
.copyable-work-box-poem .copyable-work-body { width: 100%; }
.copyable-work-box-poem .copyable-work-body p { white-space: nowrap; }
.copy-work-actions { position: absolute; top: 10px; right: 10px; z-index: 1; display: flex; gap: 8px; }
.copy-work-button, .top-work-button { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #f4f8f1; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.copy-work-button:hover, .top-work-button:hover { color: var(--ink); background: #edf6ea; }
.copy-work-button.is-copied { background: #dff0dc; color: #315e36; }
.copy-work-text { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
mark { background: #dbeafe; color: #1e40af; padding: 0 0.14em; border-radius: 4px; }
.error { border-color: #cb7b5a; background: #fff0ea; }
@media (max-width: 720px) and (orientation: portrait) { .page { padding: 20px 14px 40px; } .hero { padding: 22px 18px; } .hero h1 { font-size: 28px; } .content { font-size: 17px; padding: 18px; } .tree-row { grid-template-columns: 1fr; gap: 4px; } .tree-meta { white-space: normal; } .tree-board { padding: 18px; } .tree-board .fold-group { overflow: visible; } .tree-board .fold-content { padding-left: 10px; padding-right: 10px; } .fold-summary { align-items: flex-start; flex-direction: column; } .fold-heading { width: 100%; } .search-actions { width: 100%; justify-content: flex-start; } .hero-search .search-form-home { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero-search .search-form-home .search-home-link { grid-column: 1; grid-row: 1; justify-content: center; } .hero-search .search-form-home .search-field { grid-column: 1 / -1; } .hero-search .search-form-home .search-actions-home { grid-column: 2; grid-row: 1; width: auto; justify-content: stretch; } .search-actions-home button { width: 100%; } .home-dynasty-list { grid-template-columns: 1fr; gap: 12px; } .home-work-detail > .fold-content { padding-left: 0; padding-right: 0; } .copyable-work-box-poem { position: relative; left: 50%; transform: translateX(-50%); width: min(20em, calc(100vw - 32px)); max-width: min(20em, calc(100vw - 32px)); margin-left: 0; margin-right: 0; } .copyable-work-box-poem .copyable-work-body { font-size: 16px; } .hero-quick-stats { font-size: 18px; gap: 8px; } }