/* ============================================================
   Wokfire — English Chinese-recipe theme
   ============================================================ */
:root {
    --bg: #faf6f0;
    --surface: #ffffff;
    --ink: #221a14;
    --ink-soft: #5c5148;
    --line: #eadfd2;
    --red: #c73e1d;
    --red-dark: #a53217;
    --gold: #e8a33d;
    --green: #4a7c59;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(34, 26, 20, .06), 0 8px 24px -12px rgba(34, 26, 20, .18);
    --maxw: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.65 ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 99; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.25; color: var(--ink); }

/* ---------- header ---------- */
.site-header { background: rgba(250, 246, 240, .92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; gap: 22px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; color: var(--ink); }
.logo:hover { color: var(--red); }
.logo-mark { color: var(--red); }
.main-nav { margin-left: auto; }
.main-nav > ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--ink-soft); font-weight: 600; font-size: 15px; }
.main-nav > ul > li > a:hover { color: var(--ink); background: #f1e8dc; }
.subnav { position: absolute; top: 100%; left: 0; min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; margin: 0; list-style: none; display: none; }
.main-nav li:hover > .subnav, .main-nav li:focus-within > .subnav { display: block; }
.subnav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-soft); font-size: 14px; }
.subnav a:hover { background: var(--bg); color: var(--red); }
.header-search { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 14px; }
.header-search input { border: 0; outline: 0; background: transparent; width: 150px; font-size: 14px; color: var(--ink); }
.header-search button { border: 0; background: var(--red); color: #fff; width: 28px; height: 28px; border-radius: 999px; cursor: pointer; display: grid; place-items: center; }
.nav-toggle { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 18px; padding: 4px 12px; cursor: pointer; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(180deg, #fdf1e3 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); padding: 64px 0 56px; text-align: center; }
.hero-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; font-weight: 700; color: var(--red); margin: 0 0 10px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); margin: 0 auto 14px; max-width: 760px; }
.hero h1 em { font-style: italic; color: var(--red); }
.hero-sub { color: var(--ink-soft); max-width: 640px; margin: 0 auto 26px; font-size: 17px; }
.hero-search { display: flex; gap: 10px; max-width: 540px; margin: 0 auto 18px; }
.hero-search input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 13px 22px; font-size: 16px; background: var(--surface); outline-color: var(--red); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { display: inline-block; background: var(--surface); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.chip:hover { border-color: var(--red); color: var(--red); }

/* ---------- sections ---------- */
.section { padding: 44px 0 12px; }
.alt-bg { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-bottom: 44px; margin-top: 24px; }
.section-head { text-align: center; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 6px; }
.section-head p { color: var(--ink-soft); margin: 0; }

/* ---------- cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.featured-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.recipe-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; color: var(--ink); }
.recipe-card:hover { transform: translateY(-3px); color: var(--ink); }
.card-img { aspect-ratio: 8/5; overflow: hidden; background: #f1e8dc; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.recipe-card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-weight: 700; font-size: 16.5px; line-height: 1.4; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.card-desc { color: var(--ink-soft); font-size: 14px; }
.tag-tag { background: #f4ede3; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.tag-hot { background: #fbe3dc; color: var(--red-dark); }

/* ---------- category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.cat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); transition: transform .18s ease, border-color .18s ease; }
.cat-card:hover { transform: translateY(-3px); border-color: var(--gold); color: var(--ink); }
.cat-icon { font-size: 26px; }
.cat-name { font-weight: 700; font-size: 16px; }
.cat-desc { color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }

/* ---------- crumbs / pagination ---------- */
.crumbs { padding-top: 22px; font-size: 14px; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--red); }
.pagination { text-align: center; padding: 30px 0 40px; }
.pagination ul { display: inline-flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; justify-content: center; }
.pagination li a, .pagination li span { display: inline-block; min-width: 36px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: 14px; }
.pagination .active span, .pagination li span:hover { border-color: var(--red); color: var(--red); }

/* ---------- list head ---------- */
.list-head { text-align: center; padding-bottom: 8px; }
.list-head h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 8px; }
.list-desc { color: var(--ink-soft); max-width: 620px; margin: 0 auto; }
.subcat-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 14px 20px 0; }
.empty-note { color: var(--ink-soft); text-align: center; padding: 30px 0; grid-column: 1 / -1; }
.search-page-form { margin: 18px auto 8px; }

/* ---------- recipe detail ---------- */
.recipe-page { padding-bottom: 40px; }
.recipe-head { text-align: center; max-width: 780px; margin: 10px auto 0; }
.recipe-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: 12.5px; font-weight: 700; color: var(--red); margin: 0 0 8px; }
.recipe-title { font-size: clamp(30px, 4.5vw, 46px); margin: 0 0 14px; }
.recipe-lede { color: var(--ink-soft); font-size: 17.5px; }
.recipe-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; list-style: none; padding: 0; margin: 22px 0 8px; }
.recipe-meta li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; font-size: 14px; color: var(--ink-soft); }
.recipe-meta strong { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }
.recipe-hero { margin: 26px auto; max-width: 900px; }
.recipe-hero img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 16/10; object-fit: cover; }
.recipe-actions { text-align: center; margin-bottom: 30px; }
.recipe-body { display: grid; grid-template-columns: 380px 1fr; gap: 34px; align-items: start; }
.recipe-side { position: sticky; top: 84px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.ingredients-card h2 { margin: 0 0 4px; font-size: 24px; }
.card-note { color: var(--ink-soft); font-size: 14px; margin: 0 0 14px; }
.ingredient-list, .equipment-list { list-style: none; margin: 0; padding: 0; }
.ingredient-list li { padding: 9px 0 9px 26px; border-bottom: 1px dashed var(--line); position: relative; font-size: 15px; }
.ingredient-list li:last-child { border-bottom: 0; }
.ingredient-list li::before { content: ""; position: absolute; left: 4px; top: 16px; width: 9px; height: 9px; border-radius: 999px; background: var(--gold); }
.equipment-list li { padding: 4px 0 4px 24px; position: relative; color: var(--ink-soft); font-size: 14.5px; }
.equipment-list li::before { content: "🔧"; position: absolute; left: 0; top: 4px; font-size: 13px; }
.ingredients-card h3 { margin: 18px 0 8px; font-size: 18px; }
.steps-section h2, .prose h2, .tips-section h2, .storage-section h2, .faq-section h2, .related-section h2 { font-size: 26px; margin: 0 0 16px; }
.steps-list { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps-list > li { counter-increment: step; position: relative; padding: 0 0 22px 58px; }
.steps-list > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 38px; height: 38px; border-radius: 999px; background: var(--red); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 17px; font-family: Georgia, serif; }
.steps-list > li::after { content: ""; position: absolute; left: 19px; top: 44px; bottom: 4px; width: 1px; background: var(--line); }
.steps-list > li:last-child::after { display: none; }
.step-img { display: block; width: 100%; max-width: 480px; height: auto; border-radius: 12px; margin: 0 0 14px; box-shadow: var(--shadow); }

.step-text { display: block; font-size: 16.5px; }
.prose { max-width: 720px; }
.prose p { color: var(--ink); }
.prose h2 { margin-top: 34px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.tips-list, .storage-list { padding-left: 0; list-style: none; }
.tips-list li, .storage-list li { position: relative; padding: 8px 0 8px 30px; }
.tips-list li::before { content: "💡"; position: absolute; left: 0; top: 8px; }
.storage-list li::before { content: "🧊"; position: absolute; left: 0; top: 8px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; max-width: 720px; }
.faq-item summary { cursor: pointer; font-weight: 700; font-size: 16px; }
.faq-item p { color: var(--ink-soft); margin: 10px 0 2px; }
.related-section { margin-top: 46px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- buttons ---------- */
.btn { display: inline-block; border: 1px solid transparent; border-radius: 999px; padding: 11px 24px; font-weight: 700; font-size: 15px; cursor: pointer; transition: background .15s ease; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }

/* ---------- prose pages ---------- */
.page-section { padding-top: 30px; }
.page-prose { max-width: 780px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 44px; box-shadow: var(--shadow); }
.page-prose h1 { margin-top: 0; font-size: 34px; }
.message-form { display: flex; flex-direction: column; gap: 14px; max-width: 480px; margin-top: 22px; }
.message-form label { font-weight: 600; font-size: 14.5px; display: flex; flex-direction: column; gap: 6px; }
.message-form input, .message-form textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font: inherit; outline-color: var(--red); }
.hp-field { position: absolute; left: -9999px; }

/* ---------- footer ---------- */
.site-footer { background: #241b14; color: #d8cbbd; margin-top: 60px; padding: 46px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 34px; padding-bottom: 30px; }
.footer-logo { font-size: 20px; font-weight: 800; color: #fff; margin: 0 0 8px; }
.footer-brand p { font-size: 14px; line-height: 1.6; margin: 0; max-width: 300px; }
.footer-head { color: #fff; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 7px 0; }
.footer-col a { color: #d8cbbd; font-size: 14px; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid #3b2e23; padding: 18px 20px; }
.footer-bottom p { margin: 0; font-size: 13px; color: #a4937f; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 20px 20px; box-shadow: var(--shadow); }
    .main-nav.open { display: block; }
    .main-nav > ul { flex-direction: column; gap: 2px; }
    .subnav { display: block; position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 16px; }
    .nav-toggle { display: block; margin-left: auto; }
    .header-search { margin-left: 0; }
    .header-inner { flex-wrap: wrap; gap: 12px; padding: 10px 20px; }
    .recipe-body { grid-template-columns: 1fr; }
    .recipe-side { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
    .hero { padding: 44px 0 40px; }
    .hero-search { flex-direction: column; }
}


/* ---------- tag pages ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 40px; }
.tag-chip { font-size: 15px; padding: 9px 18px; }
.tag-chip b { color: var(--red); margin-left: 4px; }

/* ---------- print (recipe card only) ---------- */
@media print {
    body { background: #fff; }
    .site-header, .site-footer, .crumbs, .recipe-actions, .related-section, .recipe-hero { display: none !important; }
    .recipe-body { grid-template-columns: 1fr; gap: 18px; }
    .recipe-side { position: static; }
    .card, .faq-item { box-shadow: none; border-color: #ddd; }
    .recipe-head { text-align: left; }
    .recipe-title { font-size: 26px; }
    a { color: #000; text-decoration: none; }
}

/* ============================================================
   首页轮播图（后台 幻灯管理 cid=1 可配置）
   ============================================================ */
.slide-track {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.slide-track::-webkit-scrollbar { height: 8px; }
.slide-track::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.slide-card {
    flex: 0 0 min(420px, 82vw);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
    color: var(--ink);
}
.slide-card:hover { transform: translateY(-3px); color: var(--ink); }
.slide-img { aspect-ratio: 21/9; overflow: hidden; background: #f1e8dc; }
.slide-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.slide-card:hover .slide-img img { transform: scale(1.04); }
.slide-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.slide-name { font-weight: 700; font-size: 17px; line-height: 1.4; }
.slide-desc { color: var(--ink-soft); font-size: 14px; }
.slide-cta { color: var(--red); font-weight: 700; font-size: 14px; }
.slide-hint { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 2px 0 0; }

/* ============================================================
   首页各分类区块（每分类 1 行 × 最多 4 张卡片）
   ============================================================ */
.cat-section { padding: 26px 0 10px; border-top: 1px dashed var(--line); }
.cat-section:first-of-type { border-top: 0; }
.cat-section.alt-bg { background: #fff; margin: 0 -20px; padding: 26px 20px 10px; border-top: 1px solid var(--line); }
.cat-section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.cat-section-head .cat-icon { font-size: 30px; line-height: 1; }
.cat-section-title { flex: 1; min-width: 0; }
.cat-section-title h3 { margin: 0; font-size: 21px; }
.cat-section-title p { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.cat-more { white-space: nowrap; font-weight: 700; font-size: 14.5px; }
@media (max-width: 720px) {
    .cat-section-head { flex-wrap: wrap; }
    .cat-more { margin-left: 44px; }
    .cat-section-title { flex-basis: calc(100% - 44px); }
}

/* ============================================================
   导航优化：一级菜单不换行 + Recipes 下拉两列 + 分页样式
   ============================================================ */
.main-nav > ul { flex-wrap: nowrap; }
.main-nav > ul > li > a { white-space: nowrap; }
.main-nav li.has-sub > a::after { content: " ▾"; font-size: 11px; color: var(--ink-soft); }
.main-nav li.has-sub > .subnav { min-width: 300px; column-count: 2; column-gap: 2px; }
.main-nav li.has-sub > .subnav a { break-inside: avoid; }

/* 分页（/recipes 索引页等） */
.page-nav { margin-top: 30px; text-align: center; }
.page-nav ul { display: inline-flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; justify-content: center; }
.page-nav li a, .page-nav li span {
    display: inline-block; min-width: 38px; padding: 7px 10px;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--ink-soft); font-size: 14px; font-weight: 600;
}
.page-nav li a:hover { border-color: var(--red); color: var(--red); }
.page-nav li.active span { background: var(--red); border-color: var(--red); color: #fff; }
.page-nav li.disabled span { opacity: .45; }
.empty-note { text-align: center; color: var(--ink-soft); padding: 30px 0; }

@media (max-width: 860px) {
    .main-nav li.has-sub > .subnav { column-count: 1; min-width: 0; }
}
