:root {
    --ink: #241c16;
    --ink-soft: #4a3c30;
    --muted: #8a7660;
    --line: rgba(108, 73, 47, 0.2);
    --line-strong: rgba(108, 73, 47, 0.38);
    --xuan: #f3ebe0;
    --xuan-soft: #faf6ef;
    --panel: #fbf8f2;
    --chenxiang: #6c492f;
    --chenxiang-soft: #8a6548;
    --coffee: #a8866e;
    --coffee-deep: #8f6d55;
    --cinnabar: #c23531;
    --cinnabar-deep: #9e2c28;
    --seal: rgba(194, 53, 49, 0.09);
    --header-h: 92px;
    --radius: 10px;
    --radius-sm: 6px;
    --max: 1320px;
    --glow:
        0 1px 0 rgba(255, 252, 247, 0.85) inset,
        0 10px 28px rgba(60, 40, 20, 0.08),
        0 2px 6px rgba(60, 40, 20, 0.04);
    --glow-sm:
        0 1px 0 rgba(255, 252, 247, 0.7) inset,
        0 4px 14px rgba(60, 40, 20, 0.06);
    --fs-display: 1.25rem;
    --fs-title: 1.125rem;
    --font-display: "Noto Serif SC", "Songti SC", "STSong", serif;
    --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
    background-color: #e6ddd0;
    background-image:
        radial-gradient(ellipse 90% 50% at 50% -5%, rgba(255, 250, 242, 0.7), transparent 55%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(108, 73, 47, 0.012) 3px,
            rgba(108, 73, 47, 0.012) 4px
        ),
        linear-gradient(180deg, rgba(246, 240, 230, 0.82), rgba(230, 221, 208, 0.92)),
        url("../image/background.webp");
    background-attachment: scroll;
    background-size: auto, auto, auto, cover;
}

.site-header {
    background:
        linear-gradient(180deg, #b3967c 0%, #a8866e 38%, #94725a 100%);
    border-bottom: 2px solid #6c492f;
    box-shadow:
        0 1px 0 rgba(255, 250, 243, 0.22) inset,
        0 10px 28px rgba(60, 40, 20, 0.18);
}

.site-header__inner {
    max-width: var(--max);
    min-height: var(--header-h);
    padding: 10px 24px;
    gap: 20px;
    align-items: center;
}

.site-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 6px 14px 6px 10px;
    border-radius: 8px;
    background: rgba(255, 250, 243, 0.14);
    border: 1px solid rgba(255, 250, 243, 0.22);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    filter: none;
    transition: background 0.2s var(--ease);
}

.site-brand:hover {
    background: rgba(255, 250, 243, 0.22);
}

.site-brand img {
    height: 64px !important;
    width: auto !important;
    max-width: min(280px, 42vw);
    object-fit: contain;
}

.product-nav {
    gap: 4px;
    align-items: stretch;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.product-nav__link {
    min-width: 68px;
    padding: 8px 10px;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 8px;
    color: rgba(255, 250, 243, 0.95);
}

.product-nav__icon {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.product-nav__link:hover {
    background: rgba(253, 252, 243, 0.96);
    color: var(--chenxiang);
    transform: none;
}

.product-nav__link.is-current {
    background: rgba(253, 252, 243, 0.2);
    box-shadow:
        inset 0 -3px 0 var(--cinnabar),
        0 0 0 1px rgba(255, 250, 243, 0.12);
}

.hero-search {
    position: relative;
    z-index: 50;
    min-height: clamp(240px, 32vw, 340px);
    padding: 24px 20px 36px;
    align-items: flex-end;
    overflow: visible;
}

.hero-search::before {
    z-index: 0;
    background:
        linear-gradient(180deg, transparent 42%, rgba(36, 24, 14, 0.22) 78%, rgba(36, 24, 14, 0.4) 100%);
}

.hero-search__stage {
    width: min(760px, 100%);
    overflow: visible;
    position: relative;
    z-index: 2;
}

.hero-search.is-search-open {
    z-index: 80;
}

.hero-search.is-search-open::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 8px;
    pointer-events: none;
}

.search-bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: stretch;
    border-radius: 12px;
    background: rgba(255, 252, 247, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow:
        0 18px 48px rgba(40, 28, 18, 0.28),
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 0 0 1px rgba(108, 73, 47, 0.12);
    overflow: visible;
    backdrop-filter: blur(12px);
}

.hero-search.is-search-open .search-bar {
    z-index: 5;
}

.search-bar__select {
    min-width: 100px;
    padding: 0 14px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--chenxiang);
    background: rgba(243, 235, 224, 0.55);
    border-right: 1px solid var(--line);
    letter-spacing: 0.04em;
}

.search-bar__input {
    padding: 16px 40px 16px 18px;
    font-size: 1rem;
}

.search-bar__submit {
    min-width: 118px;
    margin: 6px;
    padding: 0 22px;
    border-radius: 8px;
    background: linear-gradient(180deg, #d24843, var(--cinnabar));
    letter-spacing: 0.12em;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(194, 53, 49, 0.28);
}

.search-bar__submit:hover {
    background: linear-gradient(180deg, #c23531, var(--cinnabar-deep));
    filter: none;
}

.search-bar__clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9a8874;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    display: none;
    z-index: 6;
    padding: 0;
}

.search-bar__clear.is-visible {
    display: grid;
    place-items: center;
}

.search-bar__clear:hover {
    color: #6b4530;
    background: rgba(140, 112, 84, 0.12);
}

.search-bar__field {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.search-bar__field .search-bar__input {
    width: 100%;
    padding-right: 40px;
}

.hero-search__meta {
    margin-top: 10px;
    font-size: 0.75rem;
    opacity: 0.9;
}

.page-shell {
    position: relative;
    z-index: 1;
    max-width: var(--max);
    margin: 0 auto;
    padding: 22px 24px 56px;
    width: 100%;
}

.layout-home,
.layout-list,
.layout-detail {
    display: grid;
    gap: 20px;
    align-items: start;
    width: 100%;
}

.layout-home,
.layout-list {
    grid-template-columns: 228px minmax(0, 1fr);
}

.layout-detail {
    grid-template-columns: 228px minmax(240px, 300px) minmax(0, 1fr);
}

.home-main {
    display: grid;
    gap: 20px;
    min-width: 0;
    align-self: start;
}

.surname-panel,
.surname-panel.paper-frame {
    position: sticky;
    top: calc(var(--header-h, 92px) + 12px);
    align-self: start;
    justify-self: stretch;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    max-height: min(640px, calc(100vh - var(--header-h, 92px) - 48px));
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 14px 12px 12px;
    overflow: hidden !important;
    z-index: 1;
    transform: none !important;
    opacity: 1 !important;
}

.surname-panel.reveal,
.surname-panel.reveal.is-in {
    transform: none !important;
    opacity: 1 !important;
}

.surname-panel .frame-title {
    flex: 0 0 auto;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.surname-panel .frame-title h2 {
    font-size: 1.12rem;
}

.surname-panel .frame-title p {
    font-size: 0.74rem;
}

.surname-toolbar {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: flex;
    margin: 0 0 10px;
}

.surname-filter {
    width: 100%;
    height: 36px;
    margin: 0;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(140, 112, 84, 0.28);
    background: #fffdf9;
    color: var(--ink);
    font: inherit;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.surname-filter:focus {
    border-color: rgba(194, 53, 49, 0.45);
    outline: none;
    box-shadow: 0 0 0 3px rgba(194, 53, 49, 0.12);
}

.hot-surname-scroll {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.surname-chip-list {
    list-style: none;
    margin: 0;
    padding: 0 0 4px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.surname-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 4px 2px;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    border-radius: 6px;
    background: linear-gradient(180deg, #fffdf9, #f3ebe0);
    border: 1px solid rgba(140, 112, 84, 0.28);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.surname-chip:hover {
    color: var(--cinnabar);
    border-color: rgba(194, 53, 49, 0.45);
    background: #fff8f0;
}

.surname-chip.is-dimmed {
    opacity: 0.22;
    pointer-events: none;
}

.surname-chip.is-match {
    border-color: rgba(194, 53, 49, 0.55);
    background: rgba(194, 53, 49, 0.08);
    color: var(--cinnabar);
}

.paper-frame {
    position: relative;
    border-radius: var(--radius);
    padding: 22px 20px 20px;
    background:
        linear-gradient(165deg, #fffdf9 0%, #f7f0e6 55%, #f3ebe0 100%);
    border: 1px solid var(--line-strong);
    box-shadow: var(--glow);
    overflow: hidden;
}

.paper-frame::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(168, 134, 110, 0.28);
    border-radius: calc(var(--radius) - 3px);
    pointer-events: none;
    box-shadow: none;
}

.paper-frame::after {
    display: none !important;
    content: none !important;
}

.frame-title {
    margin-bottom: 16px;
    padding: 0 0 12px 6px;
    gap: 10px;
    border-bottom: 1px solid rgba(140, 112, 84, 0.22);
}

.frame-title__mark {
    width: 3px;
    height: 1.1em;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--cinnabar), #8a2a26);
}

.frame-title h2,
.frame-title .frame-title__h1,
.section-title {
    font-size: var(--fs-display);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--chenxiang);
}

.frame-title p {
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0;
}

.alpha-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    padding: 8px 10px;
    gap: 4px;
    border-radius: 8px;
    background:
        linear-gradient(180deg, #efe6d8, #e8dece);
    border: 1px solid rgba(140, 112, 84, 0.25);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.letter-link {
    flex: 1 1 0;
    min-width: 28px;
    width: auto;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 252, 247, 0.75);
    border: 1px solid transparent;
}

.letter-link:hover,
.letter-link.is-active {
    background: var(--chenxiang);
    color: #fffaf3;
    border-color: var(--chenxiang);
    transform: none;
    box-shadow: 0 4px 10px rgba(108, 73, 47, 0.2);
}

.letter-link.is-reset {
    flex: 0 0 auto;
    width: auto;
    min-width: 48px;
    padding: 0 10px;
    font-size: 0.8rem;
}

.breadcrumb {
    margin: 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(252, 248, 241, 0.72);
    border: 1px solid rgba(140, 112, 84, 0.16);
    font-size: 0.82rem;
}

.book-list-meta {
    margin-bottom: 14px;
    padding-bottom: 12px;
    align-items: center;
}

.book-list {
    grid-template-columns: 1fr;
    gap: 12px;
}

.book-item {
    position: relative;
    grid-template-columns: auto minmax(0, 1fr) 28px;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #fffdf9 0%, #f8f1e7 100%);
    border: 1px solid rgba(140, 112, 84, 0.28);
    box-shadow: var(--glow-sm);
}

.book-item::after {
    content: "›";
    grid-column: 3;
    justify-self: end;
    font-size: 1.4rem;
    line-height: 1;
    color: rgba(138, 118, 96, 0.55);
    font-family: var(--font-display);
    transition: color 0.2s ease, transform 0.2s ease;
}

.book-item:hover {
    transform: translateY(-2px);
    border-color: rgba(108, 73, 47, 0.45);
    background: #fffdf9;
    box-shadow:
        0 12px 28px rgba(70, 45, 25, 0.12),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.book-item:hover::after {
    color: var(--cinnabar);
    transform: translateX(2px);
}

.book-item img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 2px;
    border: 0;
    box-shadow: none;
    object-fit: contain;
}

.book-info h2,
.book-info h3 {
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.35;
}

.book-meta {
    gap: 8px;
}

.book-meta__tag {
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    letter-spacing: 0;
    background: rgba(168, 134, 110, 0.14);
    border: 1px solid rgba(140, 112, 84, 0.22);
    color: var(--ink-soft);
}

.book-list.is-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 16px;
}

.book-list.is-grid .book-item {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 12px;
}

.book-list.is-grid .book-item::after { display: none; }

.book-list.is-grid .book-item img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto;
    margin: 0;
    object-fit: contain;
}

.detail-cover {
    width: min(100%, 280px);
    border-radius: 0;
    box-shadow: none;
}

.info-block {
    padding: 12px 14px;
    border-radius: 6px;
    background: linear-gradient(180deg, #fffdf9, #f3ebe0);
    border: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.info-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: none;
}

.info-value {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.volume-list {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
}

.volume-item .volume-number {
    min-height: 52px;
    border-radius: 6px;
    background: linear-gradient(180deg, #fffdf9, #f1e8db);
    border: 1px solid rgba(140, 112, 84, 0.28);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
    font-weight: 600;
}

.volume-item .volume-number:hover {
    background: linear-gradient(180deg, #7a5640, var(--chenxiang));
    color: #fffaf3;
    border-color: var(--chenxiang);
    box-shadow: 0 8px 18px rgba(108, 73, 47, 0.22);
}

.volume-hint {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--muted);
}

.empty-state {
    padding: 36px 16px;
    border-radius: 8px;
    background: rgba(243, 235, 224, 0.45);
    border: 1px dashed rgba(140, 112, 84, 0.28);
}

.empty-state__title {
    letter-spacing: 0.06em;
    font-size: 1.05rem;
}

.empty-state__cta {
    border-radius: 8px;
    min-height: 42px;
    padding: 0 20px;
    background: linear-gradient(180deg, #7a5640, var(--chenxiang));
    letter-spacing: 0.08em;
    box-shadow: 0 6px 14px rgba(108, 73, 47, 0.2);
}

.site-footer {
    margin-top: auto;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    position: relative;
    z-index: 20;
}

.site-footer__surface {
    width: 100%;
    border-top: 2px solid rgba(194, 53, 49, 0.92);
    background:
        linear-gradient(180deg, #7a5640 0%, #6c492f 46%, #52361f 100%);
    box-shadow: 0 -6px 24px rgba(60, 40, 20, 0.12);
}

.site-footer__inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 32px 28px 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1.1fr);
    gap: 28px 40px;
    align-items: end;
    color: rgba(255, 250, 243, 0.9);
    background: transparent;
    border: 0;
    box-shadow: none;
}

.site-footer__brand {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.site-footer__title {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #fffaf3;
    line-height: 1.35;
}

.site-footer__desc {
    margin: 0 0 16px;
    font-size: 0.8rem;
    opacity: 0.72;
    letter-spacing: 0.06em;
    line-height: 1.5;
}

.site-footer__social {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-end;
    padding: 0 8px;
}

.site-footer__social figure {
    margin: 0;
    text-align: center;
}

.site-footer__social img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    margin: 0 auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 250, 243, 0.32);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: #fffdf9;
}

.site-footer__social figcaption {
    margin-top: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    opacity: 0.8;
    white-space: nowrap;
}

.site-footer__info {
    text-align: right;
    justify-self: end;
    min-width: 0;
}

.site-footer__info p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.7;
    opacity: 0.82;
}

.site-footer__copy {
    margin-bottom: 4px !important;
    font-weight: 600;
    opacity: 0.95 !important;
    letter-spacing: 0.04em;
}

.site-footer__info a {
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 250, 243, 0.28);
}

.site-footer__info a:hover {
    color: #ffe8d8;
    border-bottom-color: rgba(255, 232, 216, 0.7);
}

.site-footer__links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin: 0;
}

.site-footer__links a {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 6px 14px;
    color: #fffaf3;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    border: 1px solid rgba(255, 250, 243, 0.28);
    background: rgba(255, 250, 243, 0.06);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.site-footer__links a:first-child {
    border-radius: 6px 0 0 6px;
}

.site-footer__links a:last-child {
    border-radius: 0 6px 6px 0;
    margin-left: -1px;
}

.site-footer__links a:only-child {
    border-radius: 6px;
    margin-left: 0;
}

.site-footer__links a:hover {
    background: rgba(255, 250, 243, 0.14);
    border-color: rgba(255, 250, 243, 0.5);
    color: #fffaf3;
    z-index: 1;
}

.site-footer a {
    color: #fffaf3;
}

.back-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    left: auto;
    z-index: 950;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(108, 73, 47, 0.35);
    background: linear-gradient(160deg, #fffdf9, #f3ebe0);
    color: var(--chenxiang);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 10px 24px rgba(60, 40, 20, 0.18);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    display: grid;
    place-items: center;
}

.back-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.back-top:hover {
    background: linear-gradient(160deg, #7a5640, var(--chenxiang));
    color: #fffaf3;
    border-color: var(--chenxiang);
}

.family-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.family-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    text-decoration: none;
    color: var(--ink);
    border-radius: 8px;
    background: linear-gradient(180deg, #fffdf9, #f3ebe0);
    border: 1px solid rgba(140, 112, 84, 0.28);
    box-shadow: var(--glow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.family-member:hover {
    color: var(--cinnabar);
    border-color: rgba(194, 53, 49, 0.4);
    box-shadow: 0 8px 20px rgba(70, 45, 25, 0.12);
}

.family-member img {
    width: 56px !important;
    height: 56px !important;
    border-radius: 50%;
    border: 2px solid rgba(168, 134, 110, 0.45);
    object-fit: cover;
}

.section-title {
    font-weight: 700;
}

.book-list-toolbar,
.book-list-meta {
    gap: 12px;
}

.view-toggle button.is-active {
    background: var(--chenxiang);
    color: #fffaf3;
}

.view-toggle {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fffdf9;
}

.book-list.is-grid .book-item::after {
    display: none;
}

.cmdk-hint {
    border-radius: 6px;
    font-size: 0.7rem;
}

.cmdk-panel {
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(40, 28, 18, 0.28);
}

@media (max-width: 1100px) {
    .site-brand img {
        height: 54px !important;
        max-width: min(240px, 40vw);
    }

    .site-header__inner {
        min-height: 80px;
    }

    :root { --header-h: 80px; }
}

@media (max-width: 900px) {
    .layout-home,
    .layout-list,
    .layout-detail {
        grid-template-columns: 1fr;
    }

    .surname-panel,
    .surname-panel.paper-frame {
        position: static;
        max-height: none;
        overflow: visible !important;
    }

    .hot-surname-scroll {
        max-height: 240px;
        height: auto;
    }

    .site-brand {
        padding: 4px 8px;
    }

    .site-brand img {
        height: 46px !important;
        max-width: min(200px, 55vw);
    }

    :root { --header-h: 64px; }

    .book-item {
        grid-template-columns: auto minmax(0, 1fr) 20px;
        gap: 12px;
        padding: 12px;
    }

    .book-item img {
        width: 100% !important;
        height: 100% !important;
    }

    .alpha-bar {
        gap: 3px;
        padding: 6px 8px;
    }

    .letter-link {
        min-width: 26px;
        height: 34px;
        font-size: 0.75rem;
    }

    .letter-link.is-reset {
        min-width: 44px;
        padding: 0 8px;
    }
}

@media (max-width: 600px) {
    .site-brand img {
        height: 42px !important;
        max-width: min(180px, 58vw);
    }

    .search-bar__submit span { display: none; }
    .search-bar__submit { min-width: 52px; }

    .site-header__meta {
        order: 3;
        width: auto;
        margin-left: auto;
        padding: 0;
        gap: 8px;
    }
}

.site-header__inner {
    flex-wrap: wrap;
}

.site-header__meta {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    margin-left: 10px;
}

.site-header__ip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 210px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 250, 243, 0.14);
    border: 1px solid rgba(255, 250, 243, 0.28);
    color: rgba(255, 250, 243, 0.95);
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
}

.site-header__ip-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 250, 243, 0.22);
    border: 1px solid rgba(255, 250, 243, 0.28);
    color: rgba(255, 250, 243, 0.95);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.site-header .cmdk-hint,
.cmdk-hint {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(255, 250, 243, 0.16);
    border: 1px solid rgba(255, 250, 243, 0.32);
    color: rgba(255, 250, 243, 0.95);
    font-size: 0.72rem;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.site-header .cmdk-hint:hover,
.cmdk-hint:hover {
    background: rgba(255, 250, 243, 0.28);
    transform: translateY(-1px);
}

.hero-search__meta {
    display: none !important;
}

.search-bar {
    align-items: stretch;
    gap: 0;
}

.search-bar__select--native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.nice-select {
    position: relative;
    flex: 0 0 auto;
    z-index: 3;
    align-self: stretch;
    display: flex;
}

.nice-select.is-open {
    z-index: 90;
}

.nice-select__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 108px;
    height: 100%;
    padding: 0 14px;
    border: 0;
    border-right: 1px solid rgba(140, 112, 84, 0.22);
    border-radius: 12px 0 0 12px;
    background: linear-gradient(180deg, rgba(243, 235, 224, 0.75), rgba(236, 226, 212, 0.9));
    color: var(--chenxiang);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.nice-select__trigger:hover,
.nice-select.is-open .nice-select__trigger {
    background: linear-gradient(180deg, #fff8ef, #efe4d4);
    color: var(--cinnabar);
}

.nice-select__caret {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.nice-select.is-open .nice-select__caret {
    transform: rotate(225deg) translateY(-1px);
}

.nice-select__menu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    min-width: 100%;
    width: 132px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 10px;
    background: #fffdf9;
    border: 1px solid rgba(108, 73, 47, 0.22);
    box-shadow:
        0 18px 44px rgba(60, 40, 20, 0.22),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;
    z-index: 100;
    box-sizing: border-box;
}

.nice-select__menu[hidden] {
    display: none !important;
}

.nice-select__option {
    display: grid;
    grid-template-columns: 1fr 1em;
    align-items: center;
    column-gap: 6px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 7px;
    color: var(--ink-soft);
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-align: left;
    cursor: pointer;
    outline: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.nice-select__option:hover,
.nice-select__option:focus {
    background: rgba(168, 134, 110, 0.16);
    color: var(--chenxiang);
}

.nice-select__option.is-selected {
    background: linear-gradient(90deg, rgba(194, 53, 49, 0.12), rgba(168, 134, 110, 0.1));
    color: var(--cinnabar);
    font-weight: 700;
}

.nice-select__option::after {
    content: "";
    grid-column: 2;
    justify-self: end;
    width: 1em;
    font-size: 0.78rem;
    line-height: 1;
    opacity: 0;
}

.nice-select__option.is-selected::after {
    content: "✓";
    opacity: 0.85;
    float: none;
    margin: 0;
}

input[type="text"],
input[type="search"],
.surname-filter input,
.surname-filter {
    accent-color: var(--chenxiang);
}

.surname-filter,
.surname-filter input {
    border-radius: 8px !important;
    border-color: rgba(140, 112, 84, 0.28) !important;
    background: #fffdf9 !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.surname-filter input:focus,
.search-bar__input:focus {
    outline: none;
}

.search-bar:focus-within {
    box-shadow:
        0 18px 48px rgba(40, 28, 18, 0.28),
        0 0 0 3px rgba(194, 53, 49, 0.18);
}

.cmdk-panel select {
    accent-color: #6c492f;
    color: #6c492f;
    background: #f3ebe0;
}

.cmdk-panel select option:checked,
.cmdk-panel select option:hover {
    background: #efe4d4;
    color: #6c492f;
}

@media (max-width: 900px) {
    .site-footer__inner {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
        align-items: center;
        gap: 24px;
        padding: 28px 20px 32px;
    }

    .site-footer__brand {
        align-items: center;
    }

    .site-footer__info {
        text-align: center;
        justify-self: center;
    }

    .site-footer__links {
        justify-content: center;
    }

    .site-footer__social {
        order: 0;
        padding: 0;
    }

    .site-header__meta {
        margin-left: auto;
    }

    .back-top {
        right: 16px;
        bottom: 16px;
    }
}

.page-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 16px;
}

.page-nav .breadcrumb {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.page-nav__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid rgba(108, 73, 47, 0.32);
    background: linear-gradient(180deg, #fffdf9, #f3ebe0);
    color: #6c492f !important;
    text-decoration: none !important;
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.btn-home:hover {
    background: linear-gradient(180deg, #7a5640, #6c492f);
    border-color: #6c492f;
    color: #fffaf3 !important;
    transform: translateY(-1px);
}

.btn-home--ghost {
    background: transparent;
    box-shadow: none;
}

.btn-home__icon {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.85;
}

.cover-frame {
    display: grid;
    place-items: center;
    width: 104px;
    height: 140px;
    flex-shrink: 0;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid rgba(108, 73, 47, 0.28);
    background:
        linear-gradient(160deg, #fffdf9 0%, #f3ebe0 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.75) inset,
        0 6px 16px rgba(70, 45, 25, 0.1);
    overflow: hidden;
}

.cover-frame img,
.book-item .cover-frame img,
.book-item img {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: contain !important;
    object-position: center center;
    border: 0 !important;
    border-radius: 2px;
    background: transparent !important;
    box-shadow: none !important;
}

.book-item:hover .cover-frame {
    border-color: rgba(108, 73, 47, 0.45);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 10px 22px rgba(70, 45, 25, 0.14);
}

.book-item:hover .cover-frame img,
.book-item:hover img {
    transform: none;
    filter: none;
}

.detail-cover {
    width: min(100%, 280px) !important;
    margin: 4px auto 24px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.cover-frame--detail {
    width: 100%;
    height: auto;
    min-height: 320px;
    aspect-ratio: 3 / 4;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(108, 73, 47, 0.32);
    background:
        radial-gradient(ellipse 70% 50% at 50% 20%, rgba(255, 252, 247, 0.95), transparent 70%),
        linear-gradient(165deg, #fffdf9, #efe4d4);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 18px 40px rgba(70, 45, 25, 0.16),
        0 0 0 1px rgba(168, 134, 110, 0.12);
    position: relative;
}

.cover-frame--detail::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(180deg, rgba(108, 73, 47, 0.35), rgba(108, 73, 47, 0.12));
    pointer-events: none;
}

.cover-frame--detail img,
.detail-cover img {
    width: 100% !important;
    height: 100% !important;
    max-height: 100%;
    object-fit: contain !important;
    object-position: center center;
    border-radius: 3px;
    filter: drop-shadow(0 4px 12px rgba(60, 40, 20, 0.12));
}

.book-list.is-grid .cover-frame {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    margin: 0 auto 10px;
}

.book-list.is-grid .book-item img,
.book-list.is-grid .cover-frame img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto;
    margin: 0;
    object-fit: contain !important;
}

.book-list.is-grid .book-item {
    grid-template-columns: 1fr !important;
}

@media (max-width: 900px) {
    .page-nav {
        gap: 10px;
    }

    .btn-home {
        min-height: 38px;
        padding: 0 12px;
        font-size: 0.82rem;
    }

    .cover-frame {
        width: 88px;
        height: 118px;
        padding: 5px;
    }

    .cover-frame--detail {
        min-height: 260px;
        padding: 10px;
    }
}
