:root {
    --bg: #F3EEEA;
    --bg-deep: #E7E1DC;
    --surface: #FFFBFA;
    --surface-soft: #EFE6E4;
    --text: #4F4548;
    --title: #3D3336;
    --muted: #8A7A7E;
    --quiet: #A39A96;
    --pink: #D9A0AE;
    --rose: #C47B8A;
    --mist-pink: #E8C9D0;
    --gray: #9B938E;
    --clay: #D4B8A8;
    --sage: #9BB0A5;
    --line: rgba(196,123,138,.22);
    --line-strong: rgba(196,123,138,.40);
    --shadow: 0 16px 36px rgba(61,51,54,.08);
    --header-height: 130px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.78;
}
body.panel-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid rgba(196,123,138,.35); outline-offset: 3px; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { position: fixed; z-index: 200; inset: 0 0 auto 0; box-shadow: 0 1px 0 rgba(196,123,138,.14); }
.cloud-line { height: 22px; background: var(--rose); color: #fff; font-size: 12px; line-height: 22px; }
.cloud-line-inner { display: flex; align-items: center; justify-content: space-between; height: 22px; }
.cloud-brand { color: #fff; font-weight: 700; letter-spacing: .08em; }
.text-control { border: 0; background: transparent; color: #fff; min-width: 44px; min-height: 22px; padding: 0 4px; cursor: pointer; }

.masthead { height: 64px; background: rgba(255,251,250,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.masthead-inner { height: 64px; display: grid; grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr); align-items: center; gap: 18px; }
.brand-mark { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; max-width: 230px; }
.brand-logo { max-height: 36px; width: auto; object-fit: contain; object-position: left center; }
.brand-text { font-size: 23px; font-weight: 800; letter-spacing: .08em; color: var(--title); }
.book-button, .app-link, .button-primary, .button-secondary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 9px 18px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.book-button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--title); font-weight: 700; }
.app-link { justify-self: end; background: linear-gradient(135deg,#E8C9D0 0%,#D9A0AE 52%,#C47B8A 100%); color: #fff; font-weight: 700; }
.book-button:hover, .app-link:hover, .button-primary:hover, .button-secondary:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(61,51,54,.10); }

.note-strip { height: 44px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.note-strip-inner { height: 44px; display: flex; align-items: center; gap: 7px; overflow: hidden; }
.note-strip a { min-height: 32px; display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 8px; color: var(--title); font-size: 14px; white-space: nowrap; }
.note-strip a:hover { background: var(--mist-pink); }
.note-strip a.is-current { background: var(--rose); color: #fff; }

.site-main { min-height: 70vh; padding-top: calc(var(--header-height) + 26px); padding-bottom: 72px; }
.page-hero, .home-hero { margin-bottom: 28px; }
.home-hero .media-slot { max-height: 300px; }
.media-slot {
    width: 100%;
    min-height: 190px;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-slot img { width: 100%; height: 100%; max-height: inherit; object-fit: contain; object-position: center; }
.media-slot.card-media { height: 205px; min-height: 205px; }
.media-slot.page-media { max-height: 260px; min-height: 220px; }
.media-slot.app-media { max-height: 420px; min-height: 300px; }
.media-fallback { width: 100%; min-height: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: linear-gradient(135deg, rgba(232,201,208,.7), rgba(255,251,250,.8) 45%, rgba(155,176,165,.25)); color: var(--title); }
.media-fallback span { font-size: 22px; font-weight: 800; letter-spacing: .12em; }
.media-fallback small { color: var(--muted); font-size: 11px; letter-spacing: .18em; }

.eyebrow { display: inline-block; margin-bottom: 6px; color: var(--rose); font-size: 13px; font-weight: 800; letter-spacing: .12em; }
h1, h2, h3 { color: var(--title); line-height: 1.35; margin-top: 0; }
h1 { font-size: clamp(28px, 3.5vw, 32px); margin-bottom: 14px; }
h2 { font-size: clamp(21px, 2.4vw, 26px); margin-bottom: 12px; }
h3 { font-size: 18px; margin-bottom: 8px; }
p { margin: 0 0 1em; }
.lead { max-width: 850px; font-size: 17px; color: var(--text); }
.hero-copy { margin-top: 18px; padding: 0 2px; }
.hero-actions, .section-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.button-primary { background: linear-gradient(135deg,#E8C9D0 0%,#D9A0AE 52%,#C47B8A 100%); color: #fff; font-weight: 800; }
.button-secondary { background: var(--surface); border: 1px solid var(--line-strong); color: var(--title); font-weight: 800; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--rose); font-weight: 800; }
.text-link::after { content: " →"; margin-left: 5px; }

.content-section { margin: 28px auto 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 16px; }
.section-head p { max-width: 650px; color: var(--muted); margin: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.card-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.card-grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.note-card, .content-card, .status-card, .rule-card, .quote-card, .list-card, .faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}
.note-card, .content-card, .status-card, .rule-card, .quote-card, .list-card { padding: 20px; }
.note-card .media-slot, .content-card .media-slot { margin-bottom: 16px; }
.note-card p, .content-card p, .rule-card p, .status-card p, .quote-card p, .list-card p { color: var(--text); }
.card-kicker { color: var(--rose); font-weight: 800; font-size: 13px; letter-spacing: .08em; }
.soft-panel { padding: 24px; border-radius: 18px; background: var(--surface-soft); border: 1px solid var(--line); }
.sage-panel { background: rgba(155,176,165,.16); }
.clay-panel { background: rgba(212,184,168,.20); }

.number-list { display: grid; gap: 10px; counter-reset: item; }
.number-row { display: grid; grid-template-columns: 54px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.number-row .num { font-size: 30px; line-height: 1; color: var(--rose); font-weight: 800; letter-spacing: -.04em; }
.number-row p { margin: 3px 0 0; color: var(--muted); }

.vertical-cabinet { display: grid; gap: 12px; }
.cabinet-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 18px; align-items: center; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.cabinet-row .label { font-weight: 800; color: var(--title); }
.cabinet-row p { margin: 0; color: var(--muted); }

.big-number-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.big-number-card { min-height: 180px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.big-number-card .big-num { display: block; font-size: 52px; line-height: 1; font-weight: 800; color: var(--pink); margin-bottom: 18px; }
.big-number-card p { color: var(--muted); }

.timeline-steps { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.step-card { position: relative; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.step-card .step { color: var(--rose); font-size: 13px; font-weight: 800; }
.step-card p { color: var(--muted); }

.long-copy { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px,4vw,38px); box-shadow: var(--shadow); }
.long-copy h2 { margin-top: 30px; }
.long-copy h2:first-child { margin-top: 0; }
.long-copy ul { margin: 10px 0 18px; padding-left: 1.3em; }
.long-copy li { margin-bottom: 8px; }

.index-list { display: grid; gap: 12px; }
.index-item { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.index-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.index-item p { margin: 8px 0 0; color: var(--muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px; border-radius: 9px; background: var(--surface-soft); color: var(--title); font-size: 13px; }

.quote-card { border-left: 4px solid var(--pink); }
.quote-card .quote-label { display: inline-block; margin-bottom: 10px; color: var(--rose); font-size: 13px; font-weight: 800; }

.faq-list { display: grid; gap: 12px; }
.faq-item { padding: 20px 22px; }
.faq-item h2 { font-size: 18px; margin-bottom: 8px; }
.faq-item p { margin: 0; color: var(--text); }

.site-footer { background: var(--title); color: var(--bg); padding: 48px 0 78px; }
.footer-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-bottom: 24px; border-bottom: 1px solid rgba(243,238,234,.16); }
.footer-brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }
.footer-logo { max-height: 34px; width: auto; object-fit: contain; filter: brightness(0) invert(1); }
.footer-brand span { display: flex; flex-direction: column; }
.footer-brand strong { color: #fff; font-size: 18px; }
.footer-brand small { color: rgba(243,238,234,.72); font-size: 10px; letter-spacing: .16em; }
.footer-brand-row p { max-width: 500px; margin: 0; color: rgba(243,238,234,.76); }
.footer-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px; padding: 28px 0; }
.footer-grid h2 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.footer-grid a { display: block; min-height: 36px; color: rgba(243,238,234,.78); }
.footer-grid a:hover { color: #fff; }
.footer-notice { padding-top: 20px; border-top: 1px solid rgba(243,238,234,.16); color: rgba(243,238,234,.82); }
.footer-bottom { margin-top: 10px; color: rgba(243,238,234,.58); font-size: 13px; }

.site-overlay { position: fixed; z-index: 250; inset: 0; background: rgba(61,51,54,.42); visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .18s ease, visibility .18s ease; }
.site-overlay.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
.neighbor-book, .search-layer { position: fixed; z-index: 300; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .18s ease, visibility .18s ease, transform .18s ease; }
.neighbor-book.is-open, .search-layer.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
.neighbor-book { left: 50%; top: 50%; width: min(940px,92vw); max-height: 72vh; transform: translate(-50%,-48%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: 0 30px 80px rgba(61,51,54,.22); overflow: auto; }
.neighbor-book.is-open { transform: translate(-50%,-50%); }
.book-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: rgba(255,251,250,.98); border-bottom: 1px solid var(--line); }
.book-brand { display: flex; align-items: center; gap: 10px; }
.book-brand img { max-height: 32px; width: auto; object-fit: contain; }
.book-brand span { display: flex; flex-direction: column; line-height: 1.2; }
.book-brand small { color: var(--muted); font-size: 9px; letter-spacing: .12em; }
.close-button { min-width: 52px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }
.book-pages { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.book-group { padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.book-group:nth-child(2n) { border-right: 0; }
.book-group h2 { font-size: 18px; color: var(--rose); }
.book-group a { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: baseline; min-height: 44px; padding: 8px 6px; border-radius: 10px; }
.book-group a:hover { background: var(--surface-soft); }
.book-group strong { color: var(--title); }
.book-group span { color: var(--muted); font-size: 13px; }

.search-layer { top: 104px; left: 50%; width: min(720px, calc(100% - 32px)); transform: translate(-50%,-8px); }
.search-layer.is-open { transform: translate(-50%,0); }
.search-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 24px 70px rgba(61,51,54,.20); padding: 22px; }
.search-card-top { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.search-card-top h2 { margin-bottom: 0; }
.search-appearance { margin-top: 16px; }
.search-appearance label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.search-appearance input { width: 100%; height: 48px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); color: var(--title); padding: 0 14px; }
.search-appearance p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.search-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.search-presets a { min-height: 40px; display: inline-flex; align-items: center; padding: 5px 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; color: var(--title); }

.mobile-bottom-nav { display: none; }

@media (max-width: 900px) {
    .card-grid, .card-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .big-number-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .timeline-steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .timeline-steps .step-card:last-child { grid-column: 1 / -1; }
    .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 700px) {
    :root { --header-height: 86px; }
    .shell { width: calc(100% - 32px); }
    .note-strip { display: none; }
    .masthead-inner { grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; }
    .brand-mark { min-width: 0; max-width: 150px; overflow: hidden; }
    .brand-logo { max-height: 32px; max-width: 140px; }
    .brand-text { font-size: 19px; white-space: nowrap; }
    .book-button, .app-link { min-width: 68px; padding: 8px 10px; border-radius: 10px; font-size: 14px; }
    .site-main { padding-top: calc(var(--header-height) + 22px); padding-bottom: 88px; }
    .home-hero .media-slot { min-height: 170px; }
    .media-slot.card-media { height: 185px; min-height: 185px; }
    .card-grid, .card-grid.two, .card-grid.four, .big-number-grid, .timeline-steps { grid-template-columns: 1fr; }
    .timeline-steps .step-card:last-child { grid-column: auto; }
    .section-head { align-items: start; flex-direction: column; gap: 6px; }
    .number-row { grid-template-columns: 46px 1fr; }
    .number-row .text-link { grid-column: 2; }
    .cabinet-row { grid-template-columns: 1fr; gap: 6px; }
    .footer-brand-row { align-items: flex-start; flex-direction: column; }
    .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
    .site-footer { padding-bottom: 112px; }
    .neighbor-book { width: 92vw; max-height: 80vh; }
    .book-pages { grid-template-columns: 1fr; }
    .book-group { border-right: 0; }
    .book-group a { grid-template-columns: 82px 1fr; }
    .search-layer { top: 94px; width: calc(100% - 24px); }
    .search-card { padding: 18px; }
    .mobile-bottom-nav {
        position: fixed; z-index: 180; left: 0; right: 0; bottom: 0;
        height: calc(50px + env(safe-area-inset-bottom));
        padding: 0 8px env(safe-area-inset-bottom);
        background: rgba(255,251,250,.97); border-top: 1px solid var(--line);
        display: grid; grid-template-columns: repeat(5,1fr); gap: 4px;
    }
    .mobile-bottom-nav a { min-width: 0; min-height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 9px 9px 0 0; font-size: 13px; color: var(--title); }
    .mobile-bottom-nav a.is-current { background: var(--rose); color: #fff; }
}

@media (max-width: 420px) {
    .cloud-brand { letter-spacing: .02em; font-size: 11px; }
    .masthead-inner { gap: 6px; }
    .brand-mark { max-width: 116px; }
    .brand-logo { max-width: 112px; }
    .brand-text { font-size: 17px; }
    .book-button, .app-link { min-width: 62px; padding: 8px; font-size: 13px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .book-group { padding: 18px 16px; }
    .book-group a { grid-template-columns: 74px 1fr; padding-left: 0; padding-right: 0; }
}
