@import url("./tokens.css");
@font-face { font-family: zktqkt; src: url("../../src/字酷堂清楷体.ttf"); font-display: swap; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", sans-serif; line-height: 1.8; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
a, button, input { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #99733e; outline-offset: 4px; }
.skip-link { position: absolute; top: -100px; left: 20px; background: white; padding: 10px; z-index: 10; }
.skip-link:focus { top: 10px; }
.site-header { max-width: 1400px; margin: auto; padding: 24px 5%; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 12px; align-items: center; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand strong { display: block; font-family: zktqkt, serif; font-size: 25px; letter-spacing: 2px; line-height: 1.3; }
.brand small { font-size: 9px; letter-spacing: 3px; color: var(--muted); }
nav { display: flex; gap: 30px; font-size: 14px; }
nav a { padding: 7px 0; border-bottom: 2px solid transparent; }
nav a:hover, nav a[aria-current="page"] { border-color: var(--green); }
.container { max-width: 1240px; margin: auto; padding: 48px 32px 70px; }
.eyebrow { color: var(--muted); font-size: 11px; letter-spacing: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 400; }
h1, .hero h2 { font-family: zktqkt, serif; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 560px; align-items: center; gap: 50px; }
.hero h1 { font-size: clamp(48px, 5.5vw, 76px); line-height: 1.35; letter-spacing: 5px; margin: 20px 0; }
.hero-copy > p { max-width: 450px; color: var(--muted); font-size: 15px; }
.hero-art { position: relative; background: #eeeee2; border-radius: 50% 50% 3px 3px; height: 490px; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.hero-art img { height: 87%; width: 82%; object-fit: contain; mix-blend-mode: multiply; }
.art-label { position: absolute; bottom: 20px; right: 24px; font-size: 12px; letter-spacing: 3px; }
.button { display: inline-flex; padding: 12px 23px; background: var(--green); color: white; gap: 28px; align-items: center; border: 1px solid var(--green); font-size: 14px; }
.button:hover { background: #344c39; }
.button.secondary { background: transparent; color: var(--green); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0; }
.quote { text-align: center; border-block: 1px solid var(--line); margin: 35px 0 65px; padding: 30px 10px; }
.quote p { font-family: zktqkt, serif; font-size: 25px; letter-spacing: 3px; margin-bottom: 4px; }
.quote cite { font-style: normal; font-size: 12px; color: var(--muted); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading h2 { font-family: zktqkt, serif; font-size: 34px; margin: 5px 0 0; }
.text-link { font-size: 13px; border-bottom: 1px solid var(--green); }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.plant-card { position: relative; border: 1px solid var(--line); background: #fbfaf5; transition: transform .2s, border-color .2s; }
.plant-card:hover { transform: translateY(-4px); border-color: var(--green); }
.card-art { height: 220px; padding: 20px; background: #efefe5; }
.card-art img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.card-copy { padding: 20px; }
.card-copy h3 { font-family: zktqkt, serif; font-size: 29px; margin: 6px 0; }
.card-copy p { color: var(--muted); font-size: 12px; margin: 0; padding-right: 14px; }
.card-arrow { position: absolute; right: 16px; bottom: 18px; }
.about { margin-top: 65px; display: grid; grid-template-columns: 1fr 2fr; gap: 50px; padding-top: 40px; border-top: 1px solid var(--line); }
.about h2 { font-family: zktqkt, serif; font-size: 34px; }
.about p { font-size: 14px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); padding: 24px 5%; color: var(--muted); display: flex; justify-content: space-between; gap: 20px; font-size: 12px; }
.page-heading { margin-bottom: 32px; }
.page-heading h1 { font-size: 48px; margin: 8px 0; }
.page-heading p, .muted { color: var(--muted); font-size: 14px; }
.search-bar { display: flex; max-width: 720px; gap: 10px; margin: 25px 0 16px; }
input[type="search"] { min-width: 0; width: 100%; background: #fffef9; border: 1px solid #bdc5b5; border-radius: 0; padding: 12px 16px; color: var(--ink); }
.search-bar button { cursor: pointer; flex-shrink: 0; }
.suggestions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.result-summary { margin: 30px 0 20px; font-size: 13px; color: var(--muted); }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; border: 1px solid var(--line); }
.empty p { color: var(--muted); }
.catalogue { display: grid; grid-template-columns: 240px minmax(0, 1fr); border: 1px solid var(--line); background: #fffef9; }
.catalogue-sidebar { padding: 20px 16px; border-right: 1px solid var(--line); }
.catalogue-sidebar label { font-size: 13px; display: block; margin-bottom: 10px; }
.catalogue-sidebar input { padding: 8px; }
.plant-list { max-height: 660px; overflow-y: auto; margin-top: 15px; }
.plant-list a { display: flex; gap: 16px; padding: 8px 10px; font-size: 15px; border-left: 2px solid transparent; }
.plant-list a:hover, .plant-list a.selected { background: #e9edde; border-left-color: var(--green); }
.entry-number { font-size: 10px; color: var(--muted); align-self: center; font-variant-numeric: tabular-nums; }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.reader-toolbar a { font-size: 12px; }
.poem-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.poem-card { padding: 25px; border: 1px solid var(--line); background: #fbfaf5; }
.poem-card h2 { font-family: zktqkt, serif; font-size: 27px; margin: 10px 0 20px; }
.plant-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.plant-tags a { border: 1px solid var(--line); padding: 4px 10px; font-size: 13px; }
.plant-tags a:hover { background: #e9edde; }
@media (max-width: 900px) {
    .site-header { flex-wrap: wrap; gap: 15px; }
    nav { gap: 24px; }
    .hero { gap: 25px; min-height: 480px; }
    .hero-art { height: 390px; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .poem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalogue { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .site-header { padding: 18px 20px; }
    .brand strong { font-size: 23px; }
    nav { width: 100%; justify-content: space-between; gap: 8px; font-size: 13px; }
    .container { padding: 28px 20px 45px; }
    .hero { grid-template-columns: 1fr; gap: 12px; }
    .hero h1 { font-size: 52px; }
    .hero-art { height: 330px; margin-top: 10px; }
    .quote { margin: 35px 0; }
    .quote p { font-size: 20px; }
    .card-grid { gap: 12px; }
    .card-art { height: 170px; padding: 12px; }
    .card-copy { padding: 14px; }
    .about { grid-template-columns: 1fr; gap: 10px; margin-top: 40px; }
    .site-footer { flex-direction: column; gap: 4px; }
    .catalogue { grid-template-columns: 1fr; }
    .catalogue-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .plant-list { max-height: 170px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .plant-list a { padding: 6px; gap: 6px; font-size: 14px; }
    .poem-grid { grid-template-columns: 1fr; }
    .page-heading h1 { font-size: 40px; }
    .search-bar .button { padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* The same reading components serve the catalogue and standalone records. */
[hidden] { display: none !important; }
.suggestions a { border: 1px solid var(--line); padding: 3px 13px; color: var(--green); }
.suggestions a:hover { background: var(--selected); }
.catalogue { align-items: start; }
.catalogue-sidebar { position: sticky; top: 0; }
.plant-list { max-height: 70vh; }
.reader { min-width: 0; }
#reader-content { min-height: 500px; }
.reader[aria-busy="true"] #reader-content { opacity: .6; }
.plant-article { padding: 24px; overflow-wrap: anywhere; }
.entry-heading { border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.entry-heading h1, .entry-heading h2 { font-family: zktqkt, serif; font-size: 38px; margin: 5px 0 10px; }
.entry-heading p { font-size: 13px; color: var(--muted); }
.entry-heading p a:hover { text-decoration: underline; }
.entry-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px; }
.entry-prose { min-width: 0; font-size: 15px; line-height: 1.95; }
.entry-prose section { margin-bottom: 30px; }
.entry-prose h2, .entry-prose h3 { font-family: SimSun, serif; font-size: 21px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--green); }
.entry-prose p { margin-bottom: 18px; }
.source-title { margin-top: 24px; }
.entry-gallery { border-left: 1px solid var(--line); padding-left: 20px; }
.entry-gallery figure { margin: 0 0 30px; }
.entry-gallery img { width: 100%; height: auto; mix-blend-mode: multiply; }
.entry-gallery figcaption { font-size: 12px; text-align: center; color: var(--muted); margin-top: 10px; }
.entry-back { display: inline-block; font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.entry-pagination { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 24px; }
.detail-page .plant-article { padding: 0; }
.detail-page .entry-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 50px; }
.entry-error { padding: 16px; background: #f6ebd9; }
@media (max-width: 900px) {
    .entry-layout { grid-template-columns: 1fr; }
    .entry-gallery { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
    .entry-gallery img { max-width: 420px; display: block; margin: auto; }
}
@media (max-width: 600px) {
    .catalogue-sidebar { position: static; }
    .plant-article { padding: 18px; }
    .detail-page .entry-layout { grid-template-columns: 1fr; gap: 20px; }
    .entry-pagination { flex-wrap: wrap; }
}

.gallery-empty {
    padding: 28px 16px;
    border: 1px dashed var(--line);
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}
.gallery-empty p:first-child {
    color: var(--green);
    font-size: 16px;
}
.gallery-empty p:last-child { margin-bottom: 0; }
.card-art:has(.card-placeholder) { display: grid; place-items: center; }
.card-placeholder { color: var(--muted); font-size: 13px; letter-spacing: 2px; }
