:root {
    --bg: #F6EDE0;
    --deep-bg: #EAD7C0;
    --surface: #FFFFFF;
    --sub-surface: #E8D2B4;
    --title: #3A2414;
    --text: #4A3220;
    --muted: #7A5634;
    --soft: #9A7450;
    --wheat: #C4843C;
    --bright: #D9A05A;
    --deep: #8B5A2B;
    --cream: #FFF6EA;
    --border: rgba(196,132,60,0.18);
    --strong-border: rgba(196,132,60,0.46);
    --shadow: 0 12px 28px rgba(58,36,20,0.08);
    --radius: 12px;
    --max: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif; font-size: 15px; line-height: 1.7; overflow-x: hidden; }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button,input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 200; background: var(--surface); color: var(--title); padding: 10px 14px; border-radius: 8px; border: 1px solid var(--strong-border); }
.skip-link:focus { top: 8px; }
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 90; }
.wheat-line { height: 22px; background: var(--deep); color: var(--cream); font-size: 12px; }
.top-inner,.braid-inner { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 100%; }
.top-brand { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search-button { border: 0; background: transparent; color: var(--cream); min-width: 44px; height: 22px; padding: 0 6px; }
.braid-bar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--border); }
.braid-inner { position: relative; }
.braid-left,.app-link { width: 140px; display: flex; align-items: center; }
.app-link { justify-content: flex-end; color: var(--title); font-size: 14px; min-height: 44px; }
.brand-link { display: inline-flex; align-items: center; min-height: 44px; max-width: 160px; }
.brand-logo { height: 28px; width: auto; object-fit: contain; object-position: center; }
.brand-text { font-size: 16px; font-weight: 700; color: var(--title); white-space: nowrap; }
.drawer-trigger { position: absolute; left: 50%; transform: translateX(-50%); min-width: 74px; height: 44px; border: 1px solid var(--strong-border); border-radius: 10px; background: var(--cream); color: var(--title); }
.knot-tabs { height: 40px; background: var(--cream); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 13px; }
.knot-tabs a { min-width: 76px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--muted); }
.knot-tabs a.active { background: var(--wheat); color: var(--cream); }
.site-main { min-height: 70vh; padding: 142px 16px 56px; }
.container { width: min(var(--max), 100%); margin: 0 auto; }
.page-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 28px; margin-bottom: 24px; }
.page-hero .eyebrow,.section-label { color: var(--deep); font-size: 13px; font-weight: 700; letter-spacing: .08em; }
h1,h2,h3 { color: var(--title); margin-top: 0; }
h1 { font-size: 24px; line-height: 1.3; margin-bottom: 14px; }
h2 { font-size: 20px; line-height: 1.4; margin-bottom: 12px; }
h3 { font-size: 16px; line-height: 1.5; margin-bottom: 8px; }
p { margin: 0 0 14px; }
.lead { font-size: 16px; color: var(--muted); max-width: 850px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 42px; min-width: 118px; padding: 0 18px; border-radius: 10px; font-size: 14px; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg,#D9A05A 0%,#C4843C 55%,#8B5A2B 100%); color: var(--cream); }
.btn-secondary { background: var(--surface); color: var(--title); border: 1px solid var(--strong-border); }
.btn:hover,.btn:focus-visible,.app-link:hover,.app-link:focus-visible,.brand-link:focus-visible,.knot-tabs a:focus-visible,.footer-grid a:focus-visible,.mobile-bottom a:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
.section { width: min(var(--max), 100%); margin: 0 auto 24px; }
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.section-card + .section-card { margin-top: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.feature-card,.shelf-item,.rank-item,.faq-item,.note-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.feature-card p,.shelf-item p,.rank-item p,.note-card p { color: var(--muted); }
.media-slot { width: 100%; height: 200px; background: var(--cream); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.media-slot.card-media { height: 180px; }
.media-slot.hero-media { height: 260px; }
.media-slot.app-media { height: 340px; }
.media-slot.icon-media { width: 68px; height: 68px; margin: 0 0 14px; padding: 10px; }
.media-slot img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.media-slot.icon-media img { width: 48px; height: 48px; object-fit: contain; }
.home-cover { width: min(var(--max),100%); margin: 0 auto 24px; }
.cover-copy { background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 14px 14px; padding: 24px; }
.cover-brand { color: var(--deep); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.cover-copy h1 { margin-bottom: 8px; }
.numbered-list,.timeline,.shelf-grid,.rank-list,.faq-grid,.article-stack { display: grid; gap: 14px; }
.numbered-row { display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.numbered-row .num,.rank-num { color: var(--wheat); font-weight: 800; font-size: 24px; line-height: 1; }
.shelf-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.shelf-item { min-height: 180px; }
.shelf-tag,.status { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--deep-bg); color: var(--deep); font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.rank-list { grid-template-columns: repeat(5,minmax(0,1fr)); }
.rank-item { min-height: 190px; }
.timeline { position: relative; }
.timeline-item { position: relative; margin-left: 18px; padding: 0 0 18px 28px; border-left: 2px solid var(--border); }
.timeline-item::before { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--wheat); left: -7px; top: 5px; }
.timeline-item:last-child { padding-bottom: 0; }
.article-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.article-section ul { margin: 10px 0 0 20px; padding: 0; }
.article-section li { margin-bottom: 8px; }
.topic-index { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
.topic-index a { border: 1px solid var(--border); background: var(--cream); border-radius: 10px; min-height: 44px; display: flex; align-items: center; padding: 10px 12px; }
.faq-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.faq-item h3 { margin-bottom: 10px; }
.site-footer { background: var(--deep); color: var(--cream); border-top: 1px solid rgba(255,246,234,.35); padding: 32px 16px 80px; font-size: 13px; }
.footer-inner { width: min(var(--max),100%); margin: 0 auto; }
.footer-brand-row { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,246,234,.2); }
.footer-brand-row .brand-link { min-height: 28px; }
.footer-brand-row .brand-text { color: var(--cream); }
.footer-brand-row div strong,.footer-brand-row div span { display: block; }
.footer-brand-row div span { opacity: .75; margin-top: 2px; }
.footer-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; padding: 24px 0; }
.footer-grid h2 { color: var(--cream); font-size: 14px; margin-bottom: 10px; }
.footer-grid a { display: block; color: var(--cream); opacity: .86; padding: 4px 0; }
.footer-grid a:hover { opacity: 1; }
.copyright-note { max-width: 900px; color: var(--cream); opacity: .86; }
.copyright { color: var(--cream); opacity: .72; margin-bottom: 0; }
.overlay { position: fixed; inset: 0; z-index: 110; background: rgba(58,36,20,.44); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
.overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }
.site-drawer { position: fixed; z-index: 120; right: 0; top: 0; width: min(400px,86vw); height: 100dvh; background: var(--surface); box-shadow: -12px 0 32px rgba(58,36,20,.18); transform: translateX(102%); visibility: hidden; pointer-events: none; transition: transform .24s ease, visibility .24s ease; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 32px; }
.site-drawer.open { transform: translateX(0); visibility: visible; pointer-events: auto; }
.drawer-head { min-height: 72px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.close-button { min-width: 58px; min-height: 44px; border: 1px solid var(--strong-border); background: var(--cream); color: var(--title); border-radius: 10px; }
.drawer-section { padding: 16px; border-bottom: 1px solid var(--border); }
.drawer-section h2 { font-size: 13px; color: var(--deep); margin-bottom: 8px; }
.drawer-section a { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
.drawer-section a:last-child { border-bottom: 0; }
.drawer-section b,.drawer-section span { display: block; }
.drawer-section span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.search-layer { position: fixed; z-index: 121; left: 0; right: 0; top: 82px; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
.search-layer.open { visibility: visible; opacity: 1; pointer-events: auto; }
.search-card { width: min(760px,calc(100% - 32px)); margin: 12px auto 0; background: var(--surface); border: 1px solid var(--strong-border); box-shadow: var(--shadow); border-radius: 14px; padding: 20px; }
.search-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.search-head strong,.search-head span { display: block; }
.search-head span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.search-label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.search-input { width: 100%; height: 44px; border: 1px solid var(--strong-border); border-radius: 10px; background: var(--cream); color: var(--title); padding: 0 12px; outline: none; }
.search-input:focus { border-color: var(--wheat); box-shadow: 0 0 0 3px rgba(196,132,60,.12); }
.preset-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.preset-links a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; background: var(--deep-bg); color: var(--title); border-radius: 999px; }
.mobile-bottom { display: none; }
@media (max-width: 860px) {
    .grid-3,.grid-2,.shelf-grid,.rank-list,.faq-grid { grid-template-columns: 1fr 1fr; }
    .topic-index { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    body { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
    .top-inner,.braid-inner { width: calc(100% - 32px); }
    .braid-left,.app-link { width: 112px; }
    .drawer-trigger { min-width: 66px; }
    .knot-tabs { display: none; }
    .site-main { padding-top: 100px; padding-left: 16px; padding-right: 16px; padding-bottom: 28px; }
    .page-hero,.section-card,.cover-copy { padding: 20px; }
    .grid-3,.grid-2,.shelf-grid,.rank-list,.faq-grid,.topic-index { grid-template-columns: 1fr; }
    .numbered-row { grid-template-columns: 46px 1fr; }
    .media-slot.hero-media { height: 260px; }
    .media-slot.app-media { height: 320px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
    .site-footer { padding-bottom: 92px; }
    .mobile-bottom { position: fixed; z-index: 95; left: 0; right: 0; bottom: 0; height: calc(48px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5,1fr); }
    .mobile-bottom a { min-height: 48px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
    .mobile-bottom a.active { background: var(--wheat); color: var(--cream); }
    .search-layer { top: 0; bottom: 0; background: var(--deep); }
    .search-card { width: 100%; height: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--deep); color: var(--cream); padding: 28px 16px; overflow-y: auto; }
    .search-head strong,.search-head span,.search-label { color: var(--cream); }
    .search-head span { opacity: .78; }
    .search-input { background: var(--cream); }
    .search-card .close-button { background: var(--cream); }
    .preset-links a { background: var(--cream); color: var(--title); }
}
