:root {
    --primary: #4d6357;
    --bg: #e4e8e7;
    --nav-text: #171717;
    --nav-hover-bg: #acd5bd;
    --nav-hover-text: #2a6241;
    --title: #111827;
    --body: #414141;
    --gray: #6a6a6a;
    --tag-bg: #a4d7b9;
    --tag-text: #2a6241;
    --warning-bg: #fee2e2;
    --warning-text: #991b1b;
}

* { box-sizing: border-box; }
html {
    scrollbar-gutter: stable;
    overflow-y: scroll;
}
body {
    margin: 0;
    font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--body);
    line-height: 1.7;
    font-size: 16px;
}

/* 导航 */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 20px;
    background: white;
    border-bottom: 1px solid #d5ddd8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 60px;
}
.logo-link { display: flex; align-items: center; text-decoration: none; }
.logo { height: 52px; width: auto; }
.nav-center { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.nav-center a.nav-link-pc,
.user-name-pc { font-weight: 600; }
.nav-center a.nav-link-pc {
    margin: 0 4px;
    color: var(--nav-text);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.nav-center a.nav-link-pc:hover {
    background: var(--nav-hover-bg);
    color: var(--nav-hover-text);
    transform: translateY(2px);
}
.nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.search-trigger {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--nav-text);
}
.search-trigger:hover { color: var(--nav-hover-text); }
.search-trigger-text { display: none; }

.lang-dropdown, .user-dropdown { position: relative; }
.lang-btn, .user-btn {
    background: transparent;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--nav-text);
    white-space: nowrap;
}
.caret { display: inline-flex; align-items: center; margin-left: 2px; transition: transform 0.2s ease; vertical-align: middle; }
.caret svg { display: block; }
.lang-dropdown:hover .caret,
.user-dropdown:hover .caret { transform: rotate(180deg); }

.lang-menu, .user-menu {
    display: block;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 140px;
    z-index: 200;
    padding-top: 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s;
}
.lang-dropdown::before, .user-dropdown::before {
    content: "";
    position: absolute;
    left: -8px;
    right: -8px;
    top: 100%;
    height: 12px;
}
.lang-dropdown:hover .lang-menu,
.user-dropdown:hover .user-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.lang-menu a, .user-menu a {
    display: block;
    padding: 8px 14px;
    text-decoration: none;
    color: var(--nav-text);
    font-size: 15px;
    font-weight: 400;
}
.lang-menu a:hover, .user-menu a:hover { background: var(--nav-hover-bg); }
.lang-menu a.active { background: var(--tag-bg); color: var(--tag-text); font-weight: 600; }
.logout-link { display: flex; align-items: center; gap: 6px; }
.menu-user-name {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 4px;
    font-size: 13px;
    color: var(--gray);
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
    text-decoration: none;
}
.user-name-pc {
    display: inline-block;
    max-width: 8em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.nav-login {
    color: var(--nav-text) !important;
    text-decoration: none !important;
    font-weight: 600;
    padding: 6px 8px;
    white-space: nowrap;
}
.nav-login:hover { color: var(--nav-hover-text) !important; }
.menu-mobile-only { display: none; }

@media (min-width: 901px) {
    .user-icon-mobile { display: none !important; }
    .menu-mobile-only { display: none !important; }
    .nav-link-pc { display: inline-block; }
}
@media (max-width: 900px) {
    .nav { padding: 8px 12px; gap: 6px; }
    .nav-left { order: 1; flex-shrink: 0; }
    .nav-center { order: 2; flex: 1; justify-content: flex-end; }
    .nav-right { order: 3; flex-shrink: 0; gap: 6px; }
    .user-name-pc { display: none; }
    .user-icon-mobile { display: inline-flex; align-items: center; }
    .user-btn .caret { display: none; }
    .lang-pc { display: none; }
    .logo { height: 40px; }
    .nav-link-pc { display: none; }
    .menu-mobile-only { display: block; }
}
@media (min-width: 340px) and (max-width: 399px) {
    .nav-link-pc:nth-child(1) { display: inline-block; }
    .menu-mobile-only a:nth-child(1) { display: none; }
}
@media (min-width: 360px) and (max-width: 399px) {
    .nav-link-pc:nth-child(-n+2) { display: inline-block; }
    .menu-mobile-only a:nth-child(-n+2) { display: none; }
}
@media (min-width: 400px) and (max-width: 900px) {
    .nav-link-pc:nth-child(-n+3) { display: inline-block; }
    .menu-mobile-only a:nth-child(-n+3) { display: none; }
}

.adv-search-wrap {
    background: #fff;
    max-width: 1060px;
    margin: 12px auto 0;
    padding: 16px 20px 12px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    box-sizing: border-box;
}
.adv-search {
    max-width: 1100px;
    margin: 0 auto;
}
.mode-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
}
.mode-tab {
    position: relative;
    background: transparent;
    border: none;
    padding: 8px 18px 10px;
    font-size: 15px;
    color: var(--gray);
    cursor: pointer;
}
.mode-tab.active {
    color: var(--nav-hover-text);
    font-weight: 600;
}
.mode-tab.active::before {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 2px;
    background: var(--nav-hover-text);
}
.mode-tab.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 7px solid var(--nav-hover-text);
}
.adv-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.adv-label {
    font-size: 14px;
    color: var(--gray);
    white-space: nowrap;
}
.adv-input {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid #c5d5cc;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    height: 48px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.adv-input:focus-within {
    border-color: #8fb89a;
    box-shadow: 0 0 0 3px rgba(143, 184, 154, 0.25);
}
.adv-input input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 16px;
    font-size: 17px;
    height: 100%;
    min-width: 0;
}
.adv-input select {
    border: none;
    border-left: 1px solid #e4e8e7;
    background: #f7f8f7;
    padding: 0 14px;
    height: 100%;
    font-size: 15px;
    color: var(--nav-text);
    cursor: pointer;
}
.adv-search button[type="submit"] {
    height: 48px;
    padding: 0 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;
}
.adv-search button[type="submit"]:hover { background: var(--nav-hover-text); }
.adv-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--gray);
}
@media (max-width: 768px) {
    .search-section .grid { grid-template-columns: 1fr; }
    .adv-label { display: none; }
    .adv-search-wrap { padding: 12px 12px 10px; }
    .adv-input { height: 44px; }
    .adv-search button[type="submit"] { height: 44px; padding: 0 16px; }
    .mode-tab { padding: 6px 12px 10px; font-size: 14px; }
}
footer {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 24px 16px;
    margin-top: 40px;
    clear: both;
}
footer p { margin: 8px 0 0; font-size: 14px; }
.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 6px;
}
.footer-links a:hover { text-decoration: underline; }
.ad-banner { display: none; }
.content { max-width: 1100px; margin: 0 auto; padding: 20px; }
.content h1 { font-size: 1.7rem; }
.content h2 { font-size: 1.35rem; }

.breadcrumb { font-size: 14px; color: var(--gray); margin-bottom: 16px; }
.breadcrumb a { color: var(--nav-hover-text); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; color: #aaa; }
.breadcrumb .current { color: var(--title); }

/* 详情 */
.detail-page { max-width: 100%; width: 100%; margin: 0 auto; }
.detail-head, .detail-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.detail-head {
    display: block;
    padding: 20px;
    margin-bottom: 16px;
}
.book-read h1 { margin: 0 0 6px; font-size: 1.7rem; color: var(--title); }
.book-meta { margin: 0; color: #c1c0c0; font-size: 15px; }
.book-divider { border: none; border-top: 1px solid #eee; margin: 14px 0 18px; }
.chapter-nav { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #eee; }
.chap-btn {
    padding: 8px 18px;
    border: 1px solid #c5d5cc;
    border-radius: 6px;
    color: var(--nav-hover-text);
    text-decoration: none;
    font-size: 15px;
}
.chap-btn:hover { background: var(--nav-hover-bg); }
.chap-btn.disabled { color: #ccc; border-color: #eee; }
.detail-card { padding: 18px 20px; margin-bottom: 14px; }
.detail-card h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: 10px;
}
.herb-head { display: block; }
.herb-head .detail-title { position: relative; padding: 0 0 14px; width: 100%; text-align: left; }
.herb-head .detail-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: #eee;
}
.herb-head .detail-title h1 { margin: 0 0 6px; font-size: 40px; line-height: 1.3; text-align: left; }
.herb-head .pinyin { font-size: 16px; color: var(--gray); font-weight: 400; margin-left: 8px; }
.herb-head .latin { margin: 2px 0; line-height: 1.4; font-size: 16px; text-align: left; }
.herb-head .detail-thumb { width: 260px; height: 260px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.herb-main { display: flex; gap: 32px; align-items: flex-start; margin-top: 18px; }
.herb-side { flex: 1; min-width: 0; padding-top: 4px; }
.consist-list { display: flex; flex-wrap: wrap; gap: 8px; }
.consist-chip {
    display: inline-flex;
    align-items: flex-end;
    background: #f1f6f0;
    border-radius: 6px;
    padding: 4px 10px;
    line-height: 1.4;
}
a.consist-chip { text-decoration: none; color: inherit; cursor: pointer; }
a.consist-chip:hover { background: #e3eee1; }
.consist-chip .rest { color: #70706f !important; font-size: 14px !important; margin-left: 2px; line-height: 1; }
.side-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; line-height: 1.6; font-size: 18px; }
.formula-side .side-row { padding: 10px 0; margin-bottom: 0; border-bottom: 1px solid #eee; }
.formula-side .side-row:last-child { border-bottom: none; }
.side-label { flex-shrink: 0; width: 5em; color: var(--gray); font-weight: 600; }
.latin { color: var(--gray); font-size: 16px; }

.toxic-tag, .odor-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 18px;
    line-height: 1.5;
    vertical-align: middle;
}
.odor-tag { background: #f5e6c8; color: #8a6a2f; }
.toxic-无毒 { background: #d8efe3; color: #2a6241; }
.toxic-微毒 { background: #e5e5e5; color: #555; }
.toxic-小毒 { background: #d0d0d0; color: #333; }
.toxic-有毒 { background: #4a4a4a; color: #fff; }
.toxic-大毒 { background: #2b2b2b; color: #fff; }
.toxic-剧毒 { background: #5c3317; color: #fff; }

.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
.action-left { display: flex; gap: 4px; }
.action-btn { background: transparent; border: none; padding: 6px; cursor: pointer; border-radius: 6px; }
.action-btn svg { fill: #969fa7; display: block; }
.action-btn .icon-on { display: none; }
.action-btn.active .icon-off { display: none; }
.action-btn.active .icon-on { display: block; }
.action-btn.active svg { fill: #2a6241; }
.action-btn.report svg { fill: none; stroke: #969fa7; stroke-width: 1.5; }
.action-btn.jelly { animation: jelly 0.45s ease; }
@keyframes jelly {
    0% { transform: scale(1); }
    30% { transform: scale(1.25, 0.85); }
    50% { transform: scale(0.9, 1.15); }
    70% { transform: scale(1.08, 0.95); }
    100% { transform: scale(1); }
}

.content-body, .detail section p, .detail section pre {
    font-family: "Noto Serif SC", serif;
    line-height: 1.9;
    font-size: 18px;
    color: var(--body);
}
.book-read .content-body,
.book-read .content-body * {
    font-size: 22px !important;
    letter-spacing: 0.08em !important;
}
.theme-float {
    position: fixed;
    right: 18px;
    bottom: 24px;
    z-index: 500;
}
.theme-icon { display: none; align-items: center; justify-content: center; }
.theme-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #888888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.theme-btn svg { fill: #fff; display: block; }
.theme-btn.active { outline: 2px solid #fff; }

body.book-dark { background: #707070; }
body.book-dark .nav { background: #444444; border-bottom-color: #555; }
body.book-dark .nav-center a.nav-link-pc,
body.book-dark .user-name-pc,
body.book-dark .nav-login,
body.book-dark .search-trigger,
body.book-dark .lang-btn,
body.book-dark .user-btn { color: #fcfcfc; }
body.book-dark .book-read { background: #2e2e2e; }
body.book-dark .book-read h1 { color: #fcfcfc; }
body.book-dark .book-meta { color: #c1c0c0; }
body.book-dark .book-divider,
body.book-dark .chapter-nav { border-color: #555; }
body.book-dark .book-read .content-body,
body.book-dark .book-read .content-body p,
body.book-dark .book-read .content-body span,
body.book-dark .book-read .content-body div { color: #e1e1d1 !important; }
body.book-dark .chap-btn { color: #e1e1d1; border-color: #666; }
body.book-dark .detail-card { background: #3a3a3a; color: #e1e1d1; }
body.book-dark .detail-card h2,
body.book-dark .chapter-list a { color: #fcfcfc; }

body.book-gold { background: #ecdfa9; }
body.book-gold .nav { background: #e5c77d; border-bottom-color: #d4b56a; }
body.book-gold .nav-center a.nav-link-pc,
body.book-gold .user-name-pc,
body.book-gold .nav-login,
body.book-gold .search-trigger,
body.book-gold .lang-btn,
body.book-gold .user-btn { color: #000; }
body.book-gold .book-read { background: #e5c77d; }
body.book-gold .book-read h1 { color: #000; }
body.book-gold .book-meta { color: #333; }
body.book-gold .book-read .content-body,
body.book-gold .book-read .content-body p,
body.book-gold .book-read .content-body span,
body.book-gold .book-read .content-body div { color: #000 !important; }
body.book-gold .chap-btn { color: #000; border-color: #b89a4a; }
body.book-gold .detail-card { background: #e5c77d; color: #000; }
body.book-dark .adv-search-wrap { background: #444444; }
body.book-dark .adv-input { background: #444444; border-color: #555; }
body.book-dark .adv-input input { background: #444444; color: #fcfcfc; }
body.book-dark .adv-input select { background: #3a3a3a; color: #fcfcfc; border-color: #555; }
body.book-dark .adv-search button[type="submit"] { background: #2e2e2e; color: #fcfcfc; }
body.book-dark .mode-tab { color: #ccc; }
body.book-dark .mode-tab.active { color: #fcfcfc; }
body.book-dark .adv-hint { color: #ccc; }

body.book-gold .adv-search-wrap { background: #e5c77d; }
body.book-gold .adv-input { background: #e5c77d; border-color: #d4b56a; }
body.book-gold .adv-input input { background: #e5c77d; color: #000; }
body.book-gold .adv-input select { background: #ecd48a; color: #000; border-color: #d4b56a; }
body.book-gold .adv-search button[type="submit"] { background: #e5c77d; color: #000; border: 1px solid #b89a4a; }
body.book-gold .mode-tab { color: #333; }
body.book-gold .mode-tab.active { color: #000; }
body.book-dark .breadcrumb,
body.book-dark .breadcrumb a,
body.book-dark .breadcrumb .current,
body.book-dark .breadcrumb .sep { color: #444444; }
body.book-dark footer { background: #2e2e2e; }

body.book-gold .breadcrumb,
body.book-gold .breadcrumb a,
body.book-gold .breadcrumb .current,
body.book-gold .breadcrumb .sep { color: #444444; }
body.book-gold footer { background: #e5c77d; color: #000; }
body.book-gold footer,
body.book-gold footer p,
body.book-gold .footer-links,
body.book-gold .footer-links a { color: #000; }
body.book-dark .mode-tab.active::before { background: #fcfcfc; }
body.book-dark .mode-tab.active::after { border-bottom-color: #fcfcfc; }
body.book-dark .chapter-list li { border-bottom-color: #5b5b5a; }
body.book-dark .book-divider,
body.book-dark .chapter-nav { border-color: #5b5b5a; }

body.book-gold .mode-tab.active::before { background: #444444; }
body.book-gold .mode-tab.active::after { border-bottom-color: #444444; }
body.book-gold .chapter-list li { border-bottom-color: #d3b875; }
body.book-dark .item-card { background: #2e2e2e; color: #e1e1d1; }
body.book-dark .item-card h3,
body.book-dark .content h1,
body.book-dark .detail h1 { color: #fcfcfc; }
body.book-dark .item-card .latin,
body.book-dark .item-card .desc,
body.book-dark .detail .latin { color: #c1c0c0; }
body.book-dark .search-filters a { color: #fcfcfc; border-color: #555; }

body.book-gold .item-card { background: #e5c77d; color: #000; }
body.book-gold .item-card h3,
body.book-gold .content h1,
body.book-gold .detail h1 { color: #000; }
body.book-gold .item-card .latin,
body.book-gold .item-card .desc,
body.book-gold .detail .latin { color: #333; }
body.book-gold .search-filters a { color: #000; border-color: #b89a4a; }
body.book-gold .book-divider,
body.book-gold .chapter-nav { border-color: #d3b875; }
.content-body p { margin: 0 0 1em; }
.disclaimer { background: #fee2e2; color: #991b1b; font-size: 15px; text-align: center; }
.warn-card h2 { color: var(--warning-text); border-color: var(--warning-text); }
.verse-card pre { white-space: pre-wrap; background: #f7f8f7; padding: 12px 14px; border-radius: 8px; margin: 0; }

@media (max-width: 768px) {
    .content { padding-left: 8px; padding-right: 8px; }
    .herb-main { flex-direction: column; }
    .herb-head .detail-thumb { width: 100%; height: auto; }
}

/* 列表 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.item-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.item-card:hover { transform: translateY(-2px); }
.item-card img { width: 100%; height: 140px; object-fit: cover; border-radius: 4px; }
.formula-card { position: relative; padding-top: 8px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 2px; }
.card-tag {
    background: none;
    color: #2a6241;
    font-size: 13px;
    font-weight: 700;
    padding: 0;
    border-radius: 0;
}
.formula-card h3 { margin: 2px 0 4px; }
.desc-wrap {
    display: flex;
    align-items: flex-end;
    gap: 6px;
}
.desc-wrap .desc-text {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: #a0a1a0 !important;
    font-size: 13px !important;
    line-height: 20px;
    max-height: 30px;
    overflow: hidden;
}
.desc-wrap .more {
    flex-shrink: 0;
    color: #2a6241;
    font-size: 13px;
    font-weight: 400;
    line-height: 20px;
    white-space: nowrap;
}
.desc { font-size: 16px; color: var(--body); }
@media (max-width: 768px) { .grid { grid-template-columns: 1fr 1fr; } }

/* 会员中心 */
.dashboard h1 { margin: 0 0 20px; color: var(--title); }
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.dash-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: white;
    border-radius: 12px;
    padding: 28px 16px;
    text-decoration: none;
    color: var(--nav-text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.dash-card span { font-size: 15px; font-weight: 600; }
.user-name-pc { color: var(--nav-text); text-decoration: none; }
.user-name-pc:hover { color: var(--nav-hover-text); }
.menu-user-name { text-decoration: none; color: var(--gray); }
.footer-links a { color: white; text-decoration: none; margin: 0 6px; }

/* 搜索 */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}
.search-overlay-inner {
    background: white;
    width: 90%;
    max-width: 640px;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.search-overlay-form { display: flex; gap: 8px; margin-top: 8px; }
.search-overlay-form input {
    flex: 1;
    padding: 12px 16px;
    font-size: 18px;
    border: 1px solid #c5d5cc;
    border-radius: 8px;
    outline: none;
}
.search-overlay-form input:focus { border-color: #8fb89a; box-shadow: 0 0 0 3px rgba(143, 184, 154, 0.2); }
.search-overlay-form button {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}
.suggest-box { margin-top: 12px; max-height: 50vh; overflow-y: auto; }
.suggest-group { margin-bottom: 8px; }
.suggest-label { font-size: 12px; color: var(--gray); padding: 4px 8px; }
.suggest-box a { display: block; padding: 8px 12px; text-decoration: none; color: var(--nav-text); border-radius: 4px; }
.suggest-box a:hover { background: var(--nav-hover-bg); }
.suggest-empty, .search-empty { padding: 28px 16px; color: var(--gray); text-align: center; }
.suggest-empty p, .search-empty p { margin: 8px 0 4px; color: var(--title); font-size: 16px; }
.empty-icon { font-size: 36px; color: #b7c4bc; }
.search-empty { background: white; border-radius: 10px; margin-top: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.search-filters { margin: 16px 0; }
.search-filters a {
    display: inline-block;
    margin-right: 8px;
    padding: 4px 12px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--nav-text);
    background: white;
    border: 1px solid #ddd;
}
.search-filters a.active { background: var(--tag-bg); color: var(--tag-text); border-color: var(--tag-bg); }
.search-result-title { font-weight: 400; }
.search-result-title .hit { color: #991b1b; font-weight: 700; }
.chapter-list { list-style: none; padding: 0; }
.chapter-list li { padding: 8px 0; border-bottom: 1px solid #eee; content-visibility: auto; contain-intrinsic-size: auto 40px; }
.chapter-list a { text-decoration: none; color: var(--nav-hover-text); }
.chapter-list a:hover { font-weight: 600; }

/* 登录注册 */
.auth-box {
    max-width: 400px;
    margin: 40px auto;
    background: white;
    padding: 32px 28px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.auth-box.admin { border-top: 4px solid var(--primary); }
.auth-box h1 { margin: 0 0 8px; color: var(--title); text-align: center; }
.auth-form input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
}
.auth-form button {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; }
.auth-footer a { color: var(--nav-hover-text); }

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.modal-small { max-width: 320px; padding: 16px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { cursor: pointer; font-size: 22px; color: #666; }
.modal textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    resize: vertical;
    font-size: 14px;
}
.feedback-submit {
    display: block;
    width: auto;
    margin: 10px 0 0 auto;
    padding: 6px 14px;
    font-size: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.search-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #d5ddd8;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.chapter-grid { grid-template-columns: 1fr; }
.kw { background: #fef3c7; color: #991b1b; font-weight: 700; padding: 0 2px; border-radius: 2px; }
.chapter-results .kw { background: #fef3c7; color: #991b1b; }
.toast-tip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #eef6f1;
    color: #2a6241;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 15px;
    z-index: 3000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    animation: toastFade 2s ease forwards;
}
@keyframes toastFade {
    0% { opacity: 0; }
    12% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}
