:root {
    --ink: #20232a;
    --ink-soft: #4a4f5a;
    --paper: #f7f4ec;
    --paper-card: #fffdf8;
    --accent: #8a2b2b;       /* 朱砂红 */
    --accent-soft: #b5654a;
    --gold: #b8924a;
    --line: #e3dcce;
    --risk: #9a3412;
    --shadow: 0 6px 24px rgba(40, 30, 20, 0.08);
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.wrap { width: min(880px, 92vw); margin: 0 auto; }

/* Header */
.site-header {
    background: var(--ink);
    color: #f3efe5;
    border-bottom: 3px solid var(--accent);
}
.site-header .wrap {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 0; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark {
    width: 44px; height: 44px; flex: none;
    display: grid; place-items: center;
    background: var(--accent); color: #fff;
    font-size: 24px; border-radius: 8px;
    font-family: "STKaiti", "KaiTi", serif;
}
.brand-text strong { display: block; font-size: 19px; letter-spacing: 1px; }
.brand-text small { color: #c6bfae; font-size: 12px; }
.brand-logo { height: 40px; width: auto; display: block; border-radius: 6px; }
.site-nav a {
    color: #e9e3d5; text-decoration: none; margin-left: 18px; font-size: 15px;
    padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-color: var(--gold); }

main.wrap { padding: 32px 0 48px; }

/* Scroll reveal + entrance animations */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@keyframes heroFadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.hero-logo { animation: heroFadeUp .7s ease both; }
.hero h1 { animation: heroFadeUp .7s ease .08s both; }
.hero p { animation: heroFadeUp .7s ease .18s both; }
.hero-cta { animation: heroFadeUp .7s ease .28s both; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero-logo, .hero h1, .hero p, .hero-cta { animation: none; }
}

/* Stats band */
.stats-band {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px; margin: 0 0 40px; padding: 22px;
    background: var(--paper-card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat { text-align: center; }
.stat-num {
    display: block; font-size: 38px; line-height: 1.1; font-weight: 700;
    color: var(--accent); font-family: "STKaiti", "KaiTi", serif;
}
.stat-label { color: var(--ink-soft); font-size: 14px; }

/* Example chips */
.examples { margin-bottom: 44px; }
.examples h2 { font-size: 20px; border-left: 4px solid var(--accent); padding-left: 12px; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.chip {
    display: inline-block; text-decoration: none; color: var(--ink);
    background: var(--paper-card); border: 1px solid var(--line);
    border-radius: 999px; padding: 10px 16px; font-size: 14px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.chip:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-soft); color: var(--accent); }

/* Testimonials */
.testimonials { margin-bottom: 44px; }
.testimonials h2 { font-size: 20px; border-left: 4px solid var(--accent); padding-left: 12px; }
.testi-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.testi-card {
    background: var(--paper-card); border: 1px solid var(--line);
    border-radius: 12px; padding: 20px; margin: 0;
    transition: transform .2s ease, box-shadow .2s ease;
}
.testi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.testi-quote { margin: 0 0 16px; font-size: 15px; color: var(--ink); position: relative; padding-top: 6px; }
.testi-quote::before { content: "“"; font-family: serif; font-size: 40px; color: var(--gold); position: absolute; top: -10px; left: -4px; opacity: .5; }
.testi-person { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 40px; height: 40px; flex: none; border-radius: 50%;
    background: var(--accent); color: #fff; display: grid; place-items: center;
    font-size: 18px; font-family: "STKaiti", "KaiTi", serif;
}
.testi-meta strong { display: block; font-size: 14px; }
.testi-meta small { color: var(--ink-soft); font-size: 12px; }

/* Admin testimonial editor */
.testi-edit { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 14px 2px; margin-bottom: 12px; background: #fbf7ee; }

/* Card hover on model cards */
.model-card { transition: transform .2s ease, box-shadow .2s ease; }
.model-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* Hero / Landing */
.hero {
    position: relative;
    margin: -32px calc(-50vw + 50%) 36px;   /* 满宽 */
    min-height: 460px;
    display: flex;
    align-items: center;
    color: #f5f1e8;
    background-color: #1d1b22;
    background-image: radial-gradient(circle at 30% 20%, #3a2f2a, #1d1b22 70%); /* 无横幅时的兜底 */
    background-size: cover;
    background-position: center;
    border-bottom: 3px solid var(--accent);
    overflow: hidden;
}
/* 只压暗一侧，露出另一侧横幅 */
.hero::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero.align-left::before  { background: linear-gradient(100deg, rgba(16,14,18,.90) 0%, rgba(16,14,18,.62) 38%, rgba(16,14,18,.12) 66%, rgba(16,14,18,0) 100%); }
.hero.align-right::before { background: linear-gradient(260deg, rgba(16,14,18,.90) 0%, rgba(16,14,18,.62) 38%, rgba(16,14,18,.12) 66%, rgba(16,14,18,0) 100%); }
.hero.align-center::before{ background: linear-gradient(rgba(16,14,18,.50), rgba(16,14,18,.72)); }

.hero-inner { position: relative; z-index: 1; width: min(1120px, 92vw); margin: 0 auto; padding: 56px 20px; }
.hero-text { max-width: 540px; }
.hero.align-left  .hero-text { margin-right: auto; text-align: left; }
.hero.align-right .hero-text { margin-left: auto; text-align: right; }
.hero.align-center .hero-text { margin: 0 auto; text-align: center; }

.hero-logo { max-height: 84px; width: auto; margin-bottom: 22px; }
.hero h1 { font-size: clamp(26px, 4vw, 42px); margin: 0 0 16px; letter-spacing: 1px; line-height: 1.25; text-shadow: 0 2px 14px rgba(0,0,0,.5); }
.hero p { font-size: 16px; color: #ece5d6; margin: 0 0 28px; max-width: 540px; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.hero.align-center .hero p { margin-left: auto; margin-right: auto; }
.hero.align-right .hero p { margin-left: auto; }
.hero-cta { font-size: 17px; padding: 14px 40px; }

/* 窄屏：横幅没有留白空间，改为整体压暗 + 居中，保证可读 */
@media (max-width: 700px) {
    .hero { min-height: 380px; }
    .hero::before { background: linear-gradient(rgba(16,14,18,.62), rgba(16,14,18,.82)) !important; }
    .hero-text { max-width: none; margin: 0 auto !important; text-align: center !important; }
    .hero p { margin-left: auto !important; margin-right: auto !important; }
}

.how-it-works { margin-top: 44px; }
.how-it-works h2 { font-size: 20px; border-left: 4px solid var(--accent); padding-left: 12px; }
.steps {
    list-style: none; padding: 0; margin: 0 0 24px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px;
    counter-reset: step;
}
.steps li {
    background: var(--paper-card); border: 1px solid var(--line); border-radius: 10px;
    padding: 18px 16px 16px; position: relative; counter-increment: step;
}
.steps li::before {
    content: counter(step);
    display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent); color: #fff; font-size: 14px; margin-bottom: 10px;
}
.steps strong { display: block; margin-bottom: 4px; }
.steps span { color: var(--ink-soft); font-size: 14px; }
.cta-row { text-align: center; }

/* Intro */
.intro h1 { font-size: 26px; margin: 0 0 10px; letter-spacing: 1px; }
.intro p { color: var(--ink-soft); margin: 0 0 24px; }
.intro strong { color: var(--accent); }

/* Form */
.ask-form {
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field textarea, .field select,
.field input[type="text"], .field input[type="password"],
.field input[type="email"], .field input[type="number"], .field input[type="date"] {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: 8px;
    background: #fff; font: inherit; color: var(--ink);
    resize: vertical;
}
.field input[type="file"] { width: 100%; font: inherit; padding: 8px 0; }
.field textarea:focus, .field select:focus,
.field input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent-soft); }
.field .hint { display: block; color: #998f7c; font-size: 12px; margin-top: 6px; }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 220px; margin-bottom: 18px; }

.btn-primary {
    background: var(--accent); color: #fff; border: 0;
    padding: 12px 28px; font-size: 16px; border-radius: 8px;
    cursor: pointer; letter-spacing: 2px;
}
.btn-primary:hover { background: #731f1f; }
.btn-secondary {
    display: inline-block; text-decoration: none;
    color: var(--accent); border: 1px solid var(--accent);
    padding: 8px 18px; border-radius: 8px; margin-right: 10px; font-size: 14px;
}
.btn-secondary:hover { background: var(--accent); color: #fff; }

/* Model overview cards */
.models-overview { margin-top: 40px; }
.models-overview h2 { font-size: 20px; border-left: 4px solid var(--accent); padding-left: 12px; }
.model-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.model-card { background: var(--paper-card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.model-card h3 { margin: 0 0 8px; font-size: 16px; color: var(--accent); }
.model-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* History models explainer */
.overview-more { margin-top: 14px; }
.overview-more a { color: var(--accent); text-decoration: none; font-size: 14px; }
.overview-more a:hover { text-decoration: underline; }

.model-detail-list { display: grid; gap: 20px; }
.model-detail {
    background: var(--paper-card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
    border-left: 5px solid var(--accent);
}
.model-detail-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.model-detail-head h2 { margin: 0; font-size: 22px; color: var(--accent); letter-spacing: 1px; }
.model-detail-head .period {
    font-size: 13px; color: var(--ink-soft);
    background: #f0ebdf; padding: 2px 10px; border-radius: 999px;
}
.core-theme {
    font-family: "STKaiti", "KaiTi", serif; font-size: 18px;
    color: var(--ink); margin: 12px 0 18px;
}
.md-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.md-grid h3 { font-size: 15px; margin: 0 0 6px; padding-left: 9px; border-left: 3px solid var(--gold); }
.md-grid p { margin: 0; color: var(--ink-soft); font-size: 14px; }

.cases-title { font-size: 15px; margin: 20px 0 10px; padding-left: 9px; border-left: 3px solid var(--ink); }
.case-card { background: #fbf7ee; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.case-card h4 { margin: 0 0 6px; font-size: 15px; }
.case-summary { margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); }
.case-points { margin: 0; display: grid; gap: 8px; }
.case-points > div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; }
.case-points dt { color: var(--accent); font-size: 13px; font-weight: 600; }
.case-points dd { margin: 0; font-size: 14px; }

@media (max-width: 560px) {
    .md-grid { grid-template-columns: 1fr; }
    .case-points > div { grid-template-columns: 1fr; gap: 2px; }
}

/* Model filter pills */
.model-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.filter-pill {
    cursor: pointer; font: inherit; font-size: 14px;
    background: var(--paper-card); color: var(--ink-soft);
    border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
    transition: all .18s ease;
}
.filter-pill:hover { border-color: var(--accent-soft); color: var(--accent); }
.filter-pill.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Model head with image */
.md-head-row { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }
.md-media { flex: 0 0 240px; max-width: 240px; }
.md-media img {
    width: 100%; height: 100%; max-height: 180px; object-fit: cover;
    border-radius: 10px; border: 1px solid var(--line); display: block;
    transition: transform .3s ease;
}
.md-media:hover img { transform: scale(1.03); }
.lightbox-img { cursor: zoom-in; }
/* 无配图时的占位印章 */
.md-placeholder {
    width: 100%; height: 100%; min-height: 150px; border-radius: 10px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, #2a2622, #4a3b30);
    display: grid; place-items: center; overflow: hidden; position: relative;
}
.md-placeholder::after {
    content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px;
}
.md-placeholder span {
    font-family: "STKaiti", "KaiTi", serif; font-size: 64px; color: #f3efe5;
    background: var(--accent); width: 96px; height: 96px; border-radius: 12px;
    display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.md-headinfo { flex: 1 1 auto; min-width: 0; }
.md-head-row .model-detail-head { margin-bottom: 8px; }
.md-head-row .core-theme { margin: 0; }
@media (max-width: 620px) {
    .md-head-row { flex-direction: column; }
    .md-media { flex-basis: auto; max-width: 100%; width: 100%; }
    .md-media img { max-height: 220px; }
}

/* Accordion (cases) */
.accordion { margin-top: 16px; border-top: 1px solid var(--line); }
.acc-toggle {
    width: 100%; text-align: left; cursor: pointer; font: inherit; font-size: 15px; font-weight: 600;
    background: none; border: 0; padding: 14px 2px; color: var(--ink);
    display: flex; justify-content: space-between; align-items: center;
}
.acc-icon { color: var(--accent); font-size: 20px; line-height: 1; }
.acc-panel { display: none; padding-bottom: 6px; }
.acc-panel.open { display: block; animation: heroFadeUp .35s ease both; }

/* Lightbox */
.lightbox-overlay {
    position: fixed; inset: 0; z-index: 1000; display: none;
    background: rgba(10,9,12,.88); padding: 24px; cursor: zoom-out;
    align-items: center; justify-content: center;
}
.lightbox-overlay.open { display: flex; animation: heroFadeUp .25s ease both; }
.lightbox-overlay img { max-width: 95vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }

/* Admin: model editor */
.cases-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ai-cases-form { margin: 0; }
.ai-cases-form .is-busy { opacity: .7; cursor: progress; }
.admin-model { border: 1px solid var(--line); border-radius: 12px; padding: 6px 18px 18px; margin-bottom: 22px; background: #fffdf8; }
.case-edit { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 14px 4px; margin-bottom: 12px; background: #fbf7ee; }
.case-actions { display: flex; gap: 10px; margin-bottom: 6px; }
.add-case { margin: 8px 0 4px; }
.add-case summary { cursor: pointer; color: var(--accent); font-size: 14px; padding: 6px 0; }
.btn-danger {
    background: #fff; color: var(--risk); border: 1px solid #e0b4a6;
    padding: 8px 18px; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer;
}
.btn-danger:hover { background: var(--risk); color: #fff; border-color: var(--risk); }

/* AI 分析中 全屏遮罩 */
.ai-loading {
    position: fixed; inset: 0; z-index: 2000; display: none;
    background: rgba(20,18,22,.82); backdrop-filter: blur(2px);
    align-items: center; justify-content: center; padding: 24px;
}
.ai-loading.show { display: flex; animation: heroFadeUp .25s ease both; }
.ai-loading-box { text-align: center; color: #f3efe5; max-width: 360px; }
.ai-spinner {
    width: 56px; height: 56px; margin: 0 auto 20px;
    border: 4px solid rgba(255,255,255,.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: tjspin 1s linear infinite;
}
@keyframes tjspin { to { transform: rotate(360deg); } }
.ai-loading-title { font-size: 19px; margin: 0 0 8px; letter-spacing: 1px; }
.ai-loading-msg { font-size: 15px; color: #e7dfce; margin: 0 0 14px; min-height: 1.4em; transition: opacity .2s ease; }
.ai-loading-hint { font-size: 12px; color: #b6ad9b; margin: 0; }
@media (prefers-reduced-motion: reduce) {
    .ai-spinner { animation-duration: 2s; }
    .ai-loading.show { animation: none; }
}

/* Result */
.result {
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}
.result-question { border-bottom: 1px dashed var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.result-question h2 { font-size: 15px; color: var(--ink-soft); margin: 0 0 6px; }
.result-question p { margin: 0; font-size: 17px; }
.result-question .meta { font-size: 12px; color: #998f7c; margin-top: 6px; }

.result-model { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.badge { background: var(--ink); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.model-name { font-size: 22px; font-weight: 700; color: var(--accent); letter-spacing: 1px; }
.model-reason { color: var(--ink-soft); margin: 0 0 20px; font-size: 14px; }

.block { margin: 0 0 22px; }
.block h3 { font-size: 17px; margin: 0 0 8px; padding-left: 10px; border-left: 4px solid var(--gold); }
.block p { margin: 0; }
.block.risk h3 { border-color: var(--risk); }
.block.risk p { color: var(--risk); }
.risk-badge {
    display: inline-block; font-size: 12px; font-weight: 600;
    padding: 2px 12px; border-radius: 999px; margin-left: 10px;
    vertical-align: middle; color: #fff; letter-spacing: .5px;
}
.risk-badge.risk-low { background: #2f8a4e; }
.risk-badge.risk-mid { background: #c8961a; }
.risk-badge.risk-high { background: #cf6a1f; }
.risk-badge.risk-critical { background: #b3261e; }

/* Decision grid */
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.decision-grid .cell { background: #fbf7ee; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.decision-grid h4 { margin: 0 0 6px; font-size: 14px; color: var(--ink); }
.decision-grid ul { margin: 0; padding-left: 18px; }
.decision-grid p { margin: 0; font-size: 14px; }
.muted { color: #a89e8c; }

.actions { padding-left: 20px; margin: 0; }
.actions li { margin-bottom: 8px; }

.conclusion h3 { font-size: 17px; margin: 0 0 8px; }
.conclusion blockquote {
    margin: 0; padding: 14px 18px;
    background: var(--ink); color: #f3efe5;
    border-radius: 8px; font-size: 17px; letter-spacing: 0.5px;
}

.result-actions { margin-top: 24px; }

/* 继续追问 */
.followup {
    margin-top: 24px; padding: 20px; border-radius: var(--radius);
    background: #fbf7ee; border: 1px solid var(--line);
}
.followup h3 { margin: 0 0 8px; font-size: 17px; }
.followup .ask-form { background: none; border: 0; padding: 0; box-shadow: none; }
.followup .quota-lanterns { margin-right: 6px; }
.fu-suggests { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.fu-suggests-label { color: var(--ink-soft); font-size: 13px; }
.fu-suggest {
    cursor: pointer; font: inherit; font-size: 13px; color: var(--accent);
    background: #fff; border: 1px solid var(--accent-soft); border-radius: 999px;
    padding: 6px 14px; transition: all .15s ease;
}
.fu-suggest:hover { background: var(--accent); color: #fff; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; }
.alert-error { background: #fdecea; color: #9a3412; border: 1px solid #f3c4ba; }
.alert-notice { background: #fef9e7; color: #8a6d1a; border: 1px solid #f0e0a8; }
.alert-success { background: #eaf6ec; color: #1f6b35; border: 1px solid #b8e0c2; }

/* Auth / account / quota */
.auth-box { width: min(460px, 92vw); margin: 0 auto; }
.auth-box h1 { font-size: 24px; }
.account-info { margin: 0 0 18px; display: grid; gap: 10px; }
.account-info > div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: baseline;
    background: var(--paper-card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.account-info dt { color: var(--ink-soft); font-size: 14px; }
.account-info dd { margin: 0; }

.plan-badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.plan-badge.paid { background: var(--accent); color: #fff; }
.plan-badge.free { background: #ece6d8; color: var(--ink-soft); }

.quota-bar {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #fbf7ee; border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 16px; margin-bottom: 18px; font-size: 14px;
}
.quota-bar a { color: var(--accent); text-decoration: none; }
.quota-bar a:hover { text-decoration: underline; }
.quota-lanterns { letter-spacing: 2px; }
.lantern { font-size: 17px; }
.lantern.off { opacity: .28; filter: grayscale(1); }

/* Admin table */
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--paper-card); }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: middle; }
.admin-table th { background: #efe9db; font-size: 13px; }
.row-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-form select, .row-form input[type="date"] { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.row-form .btn-secondary { padding: 6px 12px; margin: 0; }

/* Admin */
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-bar h1 { margin: 0; font-size: 24px; }
.admin-section {
    font-size: 17px; margin: 26px 0 14px;
    padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.admin .ask-form { margin-top: 18px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); margin: 8px 0; font-weight: 400; }
.preview {
    display: block; margin: 6px 0 4px; padding: 12px;
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 / 18px 18px;
    border: 1px solid var(--line); border-radius: 8px; width: fit-content;
}
.preview img { max-height: 70px; width: auto; display: block; }
.preview-wide img { max-height: 120px; max-width: 100%; }
.admin-login { width: min(420px, 92vw); margin: 0 auto; }

.footer-admin { margin-top: 6px; }
.footer-admin a { color: #998f7c; font-size: 12px; text-decoration: none; }
.footer-admin a:hover { color: var(--accent); }

/* History */
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { margin-bottom: 10px; }
.history-list a {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    background: var(--paper-card); border: 1px solid var(--line); border-radius: 10px;
    padding: 14px 16px; text-decoration: none; color: var(--ink);
}
.history-list a:hover { border-color: var(--accent-soft); box-shadow: var(--shadow); }
.h-question { font-size: 15px; }
.h-meta { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.tag { background: var(--accent); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.h-meta time { color: #998f7c; font-size: 12px; }

/* ===== Admin shell (sidebar layout) ===== */
.admin-body { background: #f1ece1; }
.admin-shell { display: flex; min-height: 100vh; align-items: stretch; }
.admin-side {
    flex: 0 0 230px; background: var(--ink); color: #e9e3d5;
    display: flex; flex-direction: column; padding: 18px 0;
    position: sticky; top: 0; height: 100vh;
}
.admin-logo {
    display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none;
    font-size: 18px; letter-spacing: 1px; padding: 6px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 10px;
}
.admin-logo span {
    display: grid; place-items: center; width: 30px; height: 30px;
    background: var(--accent); border-radius: 7px; font-family: "STKaiti","KaiTi",serif;
}
.admin-menu { display: flex; flex-direction: column; gap: 2px; }
.admin-menu a {
    color: #d8d1c2; text-decoration: none; font-size: 15px;
    padding: 11px 22px; border-left: 3px solid transparent;
}
.admin-menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-menu a.is-active { background: rgba(138,43,43,.25); border-left-color: var(--accent); color: #fff; }
.admin-menu .admin-logout { margin-top: 12px; color: #c6bfae; font-size: 14px; }

.admin-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.admin-top {
    background: var(--paper-card); border-bottom: 1px solid var(--line);
    padding: 18px 28px;
}
.admin-top h1 { margin: 0; font-size: 22px; }
.admin-content { padding: 24px 28px 48px; max-width: 980px; width: 100%; }
.admin-content .ask-form { box-shadow: none; }
.admin-actions { margin: 0 0 16px; }

/* Summary cards */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
    background: var(--paper-card); border: 1px solid var(--line); border-radius: 10px;
    padding: 16px 18px; text-align: center;
}
.stat-card .sc-num { display: block; font-size: 30px; font-weight: 700; color: var(--accent); }
.stat-card .sc-label { color: var(--ink-soft); font-size: 13px; }

/* Status badges + small buttons + row actions */
.plan-badge.expired { background: #f3e0c0; color: #8a5a1a; }
.btn-sm { padding: 6px 12px !important; font-size: 13px !important; margin: 0 !important; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions form { margin: 0; }
.row-custom { margin-top: 6px; }
.row-custom summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.row-custom .row-form { margin-top: 8px; }

@media (max-width: 800px) {
    .admin-shell { flex-direction: column; }
    .admin-side { flex-basis: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
    .admin-logo { border: 0; margin: 0 10px 0 6px; padding: 6px; }
    .admin-menu { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .admin-menu a { padding: 8px 12px; border-left: 0; border-radius: 6px; }
    .admin-menu .admin-logout { margin-top: 0; }
    .admin-content { padding: 18px 16px 40px; }
}

/* ===== end admin shell ===== */

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #efe9db; margin-top: 40px; }
.site-footer .wrap { padding: 24px 0; color: var(--ink-soft); font-size: 13px; }
.site-footer .disclaimer { color: #998f7c; font-size: 12px; }
.footer-links {
    display: flex; flex-wrap: wrap; gap: 8px 0; margin-bottom: 12px;
    border-bottom: 1px solid var(--line); padding-bottom: 14px;
}
.footer-links a {
    color: var(--ink); text-decoration: none; font-size: 13px;
    padding: 0 14px; border-left: 1px solid var(--line);
}
.footer-links a:first-child { padding-left: 0; border-left: 0; }
.footer-links a:hover { color: var(--accent); }
.footer-tagline { margin: 0 0 6px; }
.footer-copy { color: #998f7c; font-size: 12px; margin: 8px 0 0; }

/* Legal pages */
.legal { max-width: 760px; }
.legal h1 { font-size: 26px; margin: 0 0 6px; }
.legal .legal-meta { color: #998f7c; font-size: 13px; margin: 0 0 16px; }
.legal h2 { font-size: 17px; margin: 24px 0 8px; padding-left: 10px; border-left: 4px solid var(--gold); }
.legal p, .legal li { color: var(--ink); line-height: 1.85; }
.legal ul { padding-left: 22px; }
.legal code { background: #f0ebdf; padding: 1px 6px; border-radius: 4px; font-size: 13px; }

/* Cookie consent */
.cookie-consent {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
    background: var(--ink); color: #f3efe5;
    padding: 14px 20px; border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.28); font-size: 14px;
}
.cookie-consent[hidden] { display: none; }
.cookie-consent a { color: var(--gold); }
.cookie-consent .btn-primary { padding: 8px 22px; font-size: 14px; white-space: nowrap; }

@media (max-width: 560px) {
    .decision-grid { grid-template-columns: 1fr; }
    .intro h1 { font-size: 22px; }
}