/* 奶白、鼠尾草绿与烟紫延续个人主页；两套主题共用相同布局与交互。 */
:root {
  color-scheme: light;
  --page: #f8f7f2; --surface: #fffefa; --ink: #30382e; --muted: #61695b;
  --line: #e1e3d9; --accent: #556848; --button: #3e5036; --button-text: #fffef7;
  --sage: #e5eadc; --sage-ink: #42573a; --lilac: #eee9f2; --lilac-ink: #6c587d;
  --peach: #f2e5dc; --peach-ink: #925b40; --note: #efeee6; --focus: #536e42;
  --shadow: 0 14px 38px #39462d0a; --overlay: #20271ee0; --disabled: #74766b;
  --radius: 16px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #191c22; --surface: #252a33; --ink: #e7e8e1; --muted: #afb4b5;
  --line: #333943; --accent: #b5c69f; --button: #c5d1b8; --button-text: #20271e;
  --sage: #29382f; --sage-ink: #b5c69f; --lilac: #302d40; --lilac-ink: #b5abd9;
  --peach: #3c3035; --peach-ink: #edc6b0; --note: #232a2a; --focus: #c6d8ac;
  --shadow: 0 8px 32px #0003; --overlay: #080d0be6; --disabled: #adb3a5;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; scrollbar-gutter: stable; }
body { margin: 0; color: var(--ink); background: var(--page); font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
body.dialog-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
img, svg { display: block; }
button, a, input, select { outline-offset: 5px; }
:focus-visible { outline: 2px solid var(--focus); }
::selection { color: #293621; background: #d1dfc0; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.page-shell { width: min(1200px, calc(100% - 112px)); margin: 0 auto; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.symbol-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { 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; left: 20px; top: 12px; padding: 10px 18px; background: var(--button); color: var(--button-text); border-radius: 8px; z-index: 20; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { height: 110px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 17px; white-space: nowrap; }
.brand > span:first-child { font-size: 22px; font-weight: 750; letter-spacing: .5px; }
.header-actions { display: flex; gap: 23px; align-items: center; }
.home-link { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.home-link .icon { width: 15px; height: 15px; }
.theme-toggle { width: 39px; height: 39px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; background: transparent; }
.theme-toggle:hover { background: var(--note); }
.theme-sun, [data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }
.hero { display: grid; grid-template-columns: 1.14fr 1fr; align-items: center; gap: 53px; padding: 78px 0 88px; }
.eyebrow { font-family: "Segoe UI", sans-serif; font-size: 10px; line-height: 1.6; font-weight: 600; letter-spacing: 2.3px; color: var(--accent); }
.hero .eyebrow { display: flex; align-items: center; gap: 10px; }
.hero .eyebrow > span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
h1 { font-size: clamp(38px, 4.1vw, 58px); line-height: 1.53; font-weight: 750; letter-spacing: -2.2px; margin: 22px 0 0; }
.button { display: inline-flex; gap: 22px; align-items: center; justify-content: center; border-radius: 8px; padding: 13px 20px; font-weight: 500; line-height: 1.6; transition: transform .18s, background .18s; }
.button:hover { transform: translateY(-2px); }
.button-outline { border: 1px solid var(--line); background: var(--surface); }
.hero-visual { position: relative; padding-bottom: 20px; }
.hero-visual > img { width: 100%; height: auto; border-radius: 18px 96px 18px 18px; }
.visual-label { position: absolute; right: 17px; bottom: 0; left: 25px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 15px 19px; display: flex; gap: 15px; align-items: center; box-shadow: var(--shadow); transform: rotate(-3deg); }
.visual-label > .icon { color: var(--accent); width: 28px; height: 28px; }
.visual-label strong { display: block; font-family: Georgia, serif; font-style: italic; font-weight: 400; font-size: 19px; }
.visual-label div > span { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 29px; }
h2 { font-size: 30px; font-weight: 700; letter-spacing: -.7px; margin-top: 9px; line-height: 1.5; }
.filter-panel { border: 1px solid var(--line); border-radius: 12px; padding: 21px 23px; background: var(--surface); }
.filter-top { display: flex; align-items: center; gap: 16px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 7px; min-width: 0; }
.search-field:focus-within { border-color: var(--focus); outline: 1px solid var(--focus); }
.search-field .icon { width: 17px; height: 17px; color: var(--muted); }
.search-field input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; font-size: 12px; }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.filter-bottom { display: flex; align-items: center; gap: 21px; margin-top: 18px; }
fieldset { display: flex; align-items: center; border: 0; padding: 0; margin: 0; min-width: 0; gap: 10px; }
legend { float: left; margin: 0 10px 0 0; padding: 5px 0; font-size: 11px; color: var(--muted); white-space: nowrap; }
.chip-group { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.chip > span { display: block; border: 1px solid transparent; border-radius: 5px; padding: 4px 10px; color: var(--muted); font-size: 11px; transition: background .15s; }
.chip:hover > span { background: var(--note); }
.chip input:checked + span { background: var(--sage); color: var(--sage-ink); border-color: var(--line); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }
.reset-button { flex-shrink: 0; padding: 8px 4px; background: transparent; color: var(--accent); font-size: 11px; }
.reset-button span { padding-left: 5px; }
.voicebank-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.voicebank-card { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.voicebank-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.bank-cover { height: 213px; position: relative; overflow: hidden; background: var(--art-page); color: var(--art-ink); }
.palette-sage { --art-page: #e2e7d8; --art-ink: #56684a; --art-paper: #f1f2e9; --art-disc: #7b8f67; }
.palette-lilac { --art-page: #e8e1ec; --art-ink: #796489; --art-paper: #f2edf4; --art-disc: #9a83ad; }
.palette-peach { --art-page: #f0dfd2; --art-ink: #795438; --art-paper: #f8ede1; --art-disc: #b78a65; }
/* 暗色封面使用导览页 GitHub、博客与声库卡片的原色，纸面文字独立保持对比度。 */
[data-theme="dark"] .palette-sage { --art-page: #29382f; --art-ink: #d1dfbe; --art-paper: #252a33; --art-disc: #728368; }
[data-theme="dark"] .palette-lilac { --art-page: #302d40; --art-ink: #f2edf4; --art-paper: #655776; --art-disc: #9a83ad; }
[data-theme="dark"] .palette-peach { --art-page: #3c3035; --art-ink: #edc6b0; --art-paper: #4a3b41; --art-disc: #b78a65; }
.cover-image { width: 100%; height: 100%; object-fit: cover; }
.cover-counter { position: absolute; top: 17px; left: 19px; font-family: monospace; font-size: 10px; letter-spacing: 1px; z-index: 1; }
.template-tag { position: absolute; right: 14px; top: 14px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px; font-size: 9px; color: var(--ink); background: var(--surface); z-index: 1; }
/* 原创纸质唱片图案作为空封面，不冒用未提供的角色立绘。 */
.record-disk { position: absolute; width: 166px; height: 166px; right: 14%; top: 31px; border-radius: 50%; background: repeating-radial-gradient(circle, var(--art-disc) 0px, var(--art-disc) 3px, color-mix(in srgb, var(--art-disc) 83%, white) 4px, var(--art-disc) 5px); }
.record-disk::after { content: ''; width: 47px; height: 47px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; background: var(--art-page); border: 16px solid var(--art-paper); }
.record-sleeve { position: absolute; width: 150px; height: 150px; left: 18%; top: 35px; transform: rotate(-10deg); background: var(--art-paper); box-shadow: 5px 5px 0 #00000008; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; }
.record-sleeve > span { font-family: monospace; font-size: 8px; letter-spacing: 1.2px; }
.record-sleeve strong { font-size: 58px; font-weight: 350; line-height: 1; align-self: center; }
.record-sleeve small { font-family: monospace; font-size: 7px; letter-spacing: .8px; }
.cover-flower { position: absolute; bottom: 14px; right: 20px; font-size: 28px; font-weight: 300; }
.card-body { padding: 22px 23px 18px; }
.card-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 13px; }
.engine-tag { color: var(--accent); background: var(--sage); border-radius: 3px; padding: 1px 6px; font-size: 9px; font-weight: 600; }
.language-tag { color: var(--muted); font-size: 9px; }
.card-body h3 { font-size: 21px; line-height: 1.5; letter-spacing: -.5px; overflow-wrap: anywhere; }
.card-description { color: var(--muted); font-size: 11px; line-height: 1.9; margin-top: 10px; min-height: 42px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 15px; margin-top: 18px; }
.version-label { font-size: 10px; color: var(--muted); }
.card-open { display: inline-flex; align-items: center; gap: 12px; padding: 4px 0; background: transparent; color: var(--ink); font-size: 11px; }
.card-open .icon { width: 16px; height: 16px; }
.empty-state { padding: 55px 20px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.empty-symbol { font-size: 48px; color: var(--accent); line-height: 1; }
.empty-state h3 { margin-top: 14px; font-size: 20px; }
.empty-state p { color: var(--muted); margin: 10px 0 21px; font-size: 13px; }
.empty-state .button { font-size: 12px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); margin-top: 36px; padding: 29px 0 35px; color: var(--muted); font-size: 10px; line-height: 2.1; }
.site-footer p + p { margin-top: 3px; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.back-to-top { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.back-to-top span { font-size: 17px; }
/* 原生对话框提供顶层遮罩；滚动区域在对话框内部，手机上保持关闭入口可见。 */
.voicebank-dialog { width: min(960px, calc(100% - 48px)); max-height: calc(100dvh - 56px); padding: 0; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 100px #0003; }
.voicebank-dialog::backdrop { background: var(--overlay); backdrop-filter: blur(4px); }
.dialog-close { position: sticky; top: 13px; float: right; margin: 13px 13px -53px 0; width: 36px; height: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; z-index: 3; }
.dialog-close:hover { background: var(--note); }
.detail-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.detail-sidebar { padding: 28px 20px; background: var(--note); }
.detail-sidebar .bank-cover { height: 235px; border-radius: 9px; }
.detail-sidebar .record-disk { width: 140px; height: 140px; top: 50px; right: 5%; }
.detail-sidebar .record-sleeve { width: 130px; height: 150px; left: 8%; top: 49px; }
.detail-sidebar .cover-counter { font-size: 8px; }
.detail-subtitle { font-family: monospace; font-size: 9px; letter-spacing: 1px; margin-top: 19px; color: var(--muted); overflow-wrap: anywhere; }
.detail-meta { margin: 18px 0 0; font-size: 11px; }
.detail-meta > div { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-meta dt { color: var(--muted); white-space: nowrap; }
.detail-meta dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.detail-share { display: inline-flex; justify-content: center; gap: 10px; margin-top: 22px; width: 100%; padding: 9px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; font-size: 11px; }
.detail-share .icon { width: 15px; height: 15px; }
.detail-main { padding: 35px 34px 35px; min-width: 0; }
.detail-main h2 { font-size: 26px; margin: 13px 0; padding-right: 12px; overflow-wrap: anywhere; }
.detail-main > .card-tags { margin: 0; }
.detail-description { color: var(--muted); font-size: 12px; line-height: 2; white-space: pre-line; overflow-wrap: anywhere; }
.detail-notice { padding: 10px 12px; border-radius: 6px; color: var(--muted); background: var(--note); font-size: 11px; margin-top: 18px; }
.detail-section { margin-top: 25px; }
.detail-section h3 { font-size: 14px; margin-bottom: 11px; }
.detail-section p, .detail-section li { color: var(--muted); font-size: 11px; line-height: 1.9; overflow-wrap: anywhere; }
.detail-section ul { padding-left: 18px; margin: 0; }
.sample-item { padding: 12px; border: 1px solid var(--line); border-radius: 7px; margin-top: 9px; }
.sample-item > span { font-size: 11px; display: block; margin-bottom: 7px; }
.sample-item audio { display: block; width: 100%; height: 35px; }
.sample-placeholder { padding: 15px; background: var(--note); border-radius: 7px; display: flex; gap: 13px; align-items: center; }
.sample-placeholder .icon { width: 22px; height: 22px; color: var(--muted); }
.sample-placeholder strong { font-weight: 500; font-size: 11px; }
.sample-placeholder span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.download-source { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; margin-top: 9px; }
.download-source > .icon { color: var(--accent); width: 18px; height: 18px; }
.source-name { font-size: 12px; font-weight: 500; }
.source-note { font-size: 10px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.source-action { font-size: 10px; padding: 7px 10px; border-radius: 5px; background: var(--button); color: var(--button-text); white-space: nowrap; }
.source-action:disabled { background: var(--note); color: var(--disabled); }
.source-code { padding: 0; margin-top: 5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 10px; color: var(--muted); }
.source-code code { user-select: all; color: var(--ink); }
.copy-code { padding: 0; background: none; font-size: 10px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.toast { position: fixed; z-index: 50; bottom: 24px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); padding: 12px 20px; border: 1px solid var(--line); background: var(--ink); color: var(--page); border-radius: 8px; font-size: 12px; box-shadow: var(--shadow); }

/* 中等屏幕：分类可换行，卡片保持两列，避免挤压中文说明。 */
@media (max-width: 1100px) {
  .page-shell { width: calc(100% - 80px); }
  .hero { gap: 35px; padding: 60px 0 70px; }
  h1 { font-size: clamp(36px, 4.2vw, 49px); letter-spacing: -1.5px; }
  .filter-bottom { flex-wrap: wrap; row-gap: 13px; }
  .voicebank-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-label strong { font-size: 15px; }
  .visual-label { padding: 12px 13px; left: 12px; right: 8px; gap: 10px; }
}
/* 手机：内容顺序与桌面一致；筛选可换行，详情变为单列，不使用横向隐藏溢出。 */
@media (max-width: 700px) {
  .page-shell { width: calc(100% - 40px); }
  .site-header { height: 84px; gap: 10px; }
  .brand > span:first-child { font-size: 20px; }
  .home-link { display: none; }
  .header-actions { gap: 0; }
  .theme-toggle { width: 35px; height: 35px; }
  .hero { grid-template-columns: 1fr; padding: 43px 0 54px; gap: 39px; }
  .hero .eyebrow { font-size: 8px; letter-spacing: 2px; }
  h1 { font-size: clamp(31px, 8vw, 46px); letter-spacing: -1.6px; margin: 18px 0 0; line-height: 1.55; }
  .button { font-size: 12px; padding: 11px 15px; gap: 15px; }
  .hero-visual { width: 100%; max-width: 450px; margin: auto; padding-bottom: 14px; }
  .hero-visual > img { border-radius: 14px 75px 14px 14px; }
  .visual-label { padding: 12px 17px; left: 15px; right: 13px; }
  .visual-label strong { font-size: 17px; }
  .visual-label div > span { font-size: 9px; }
  .visual-label > .icon { width: 23px; height: 23px; }
  .section-heading { margin-bottom: 21px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.9px; }
  h2 { font-size: 25px; letter-spacing: -.8px; }
  .filter-panel { padding: 14px; border-radius: 10px; }
  .filter-top { gap: 8px; }
  .search-field { padding: 10px; gap: 8px; }
  .search-field input { font-size: 11px; }
  .filter-bottom { gap: 11px; margin-top: 15px; }
  fieldset { display: block; width: 100%; }
  legend { float: none; margin: 0 0 5px; padding: 0; font-size: 10px; }
  .chip-group { gap: 3px; }
  .chip > span { font-size: 10px; padding: 5px 9px; }
  .voicebank-grid { grid-template-columns: 1fr; gap: 20px; }
  .bank-cover { height: 214px; }
  .record-disk { right: 16%; }
  .record-sleeve { left: 20%; }
  .card-body { padding: 21px 22px 17px; }
  .card-body h3 { font-size: 22px; }
  .card-description { font-size: 12px; }
  .card-open { font-size: 12px; }
  .site-footer { margin-top: 28px; padding: 23px 0 28px; font-size: 9px; gap: 10px; align-items: end; }
  .back-to-top { gap: 7px; font-size: 9px; margin-bottom: 3px; }
  .voicebank-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 24px); border-radius: 12px; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { padding: 20px; display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 0 15px; }
  .detail-sidebar .bank-cover { height: 115px; grid-row: 1 / 4; align-self: start; }
  .detail-sidebar .record-disk { width: 80px; height: 80px; top: 22px; right: -8px; }
  .detail-sidebar .record-disk::after { width: 28px; height: 28px; border-width: 10px; }
  .detail-sidebar .record-sleeve { width: 67px; height: 80px; left: 7px; top: 24px; padding: 7px; }
  .detail-sidebar .record-sleeve strong { font-size: 29px; }
  .detail-sidebar .record-sleeve span, .detail-sidebar .record-sleeve small { font-size: 4px; }
  .detail-sidebar .cover-counter { top: 7px; left: 7px; font-size: 6px; }
  .detail-sidebar .template-tag, .detail-sidebar .cover-flower { display: none; }
  .detail-subtitle { margin-top: 9px; font-size: 8px; padding-right: 15px; }
  .detail-meta { margin-top: 5px; font-size: 10px; }
  .detail-meta > div { padding: 6px 0; }
  .detail-share { grid-column: 1 / -1; margin-top: 17px; }
  .detail-main { padding: 23px 21px 28px; }
  .detail-main h2 { font-size: 23px; }
  .download-source { padding: 10px; gap: 8px; grid-template-columns: 20px minmax(0, 1fr) auto; }
  .source-action { padding: 7px 8px; }
  .detail-section { margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.script-notice { padding: 16px; margin-top: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--note); }
