/* shipu.5l5l.net — light theme */
:root {
    --bg: #ffffff;
    --bg-soft: #fdf8f4;
    --text: #1f2933;
    --muted: #6b7280;
    --brand: #d9480f;
    --brand-dark: #a8340b;
    --border: #e6e2dd;
    --card: #ffffff;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(31, 41, 51, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
                 "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; background: var(--brand);
    color: #fff; padding: 8px 16px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---- header ---- */
.site-header {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.header-inner {
    display: flex; align-items: center; gap: 16px;
    flex-wrap: wrap; padding: 12px 20px;
}
.brand {
    font-size: 20px; font-weight: 700; color: var(--brand);
    white-space: nowrap;
}
.nav-links { display: flex; gap: 14px; flex-wrap: wrap; }
.nav-links a { color: var(--text); font-size: 15px; }
.nav-links a:hover { color: var(--brand); }

.search-box { display: flex; gap: 6px; flex: 1 1 220px; min-width: 180px; }
.search-box input {
    flex: 1; padding: 7px 12px; border: 1px solid var(--border);
    border-radius: 999px; font-size: 14px; background: #fff; color: var(--text);
}
.search-box button {
    padding: 7px 16px; border: 0; border-radius: 999px;
    background: var(--brand); color: #fff; cursor: pointer; font-size: 14px;
}
.search-box button:hover { background: var(--brand-dark); }

.lang-switch select {
    padding: 6px 10px; border: 1px solid var(--border);
    border-radius: 8px; background: #fff; color: var(--text); font-size: 14px;
}

/* ---- hero ---- */
.hero {
    background: linear-gradient(135deg, #fff5ed 0%, #ffe9e0 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 28px; margin: 24px 0;
    text-align: center;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 38px); color: var(--brand-dark); }
.hero p { margin: 4px 0; color: var(--muted); }
.hero-meta { font-weight: 600; color: var(--brand); }

/* ---- sections ---- */
.section { margin: 32px 0; }
.section h1 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 6px; }
.section h2 { font-size: clamp(19px, 2.4vw, 24px); margin-bottom: 14px; }
.lead { color: var(--muted); margin-top: 0; }

/* ---- recipe grid ----
   minmax 必须配 media query，否则窄屏列宽不收缩会横向溢出 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
@media (max-width: 640px) {
    .grid { grid-template-columns: 1fr; }
}

.card {
    display: block; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
    color: var(--text);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(31,41,51,.12); text-decoration: none; }
.card-img { aspect-ratio: 3 / 2; background: var(--bg-soft); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 无图条目（RecipeNLG 长尾）占位：渐变底 + 首字母，避免出现空白块 */
.img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #fdf3e7 0%, #f6e3c8 100%);
    color: #b98b52;
    font-size: 42px; font-weight: 700; line-height: 1;
    text-transform: uppercase;
    user-select: none;
}
.img-placeholder::after {
    content: "🍽";
    position: absolute;
    font-size: 20px;
    opacity: .35;
    transform: translateY(22px);
}
.card-img { position: relative; }
.card-body { padding: 12px 14px; }
.card-body h2, .card-body h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.35; }
.card-meta { margin: 0; font-size: 13px; color: var(--muted); }
.card-meta span:not(:last-child)::after { content: " · "; }

/* ---- chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-block; padding: 6px 14px; font-size: 14px;
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 999px; color: var(--text);
}
.chip:hover { background: #ffe9e0; border-color: var(--brand); text-decoration: none; }
.chip em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }

/* ---- buttons ---- */
.btn {
    display: inline-block; padding: 8px 18px; border-radius: 999px;
    background: var(--brand); color: #fff; font-size: 14px; border: 0;
    cursor: pointer;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }

.pager { display: flex; gap: 14px; align-items: center; margin-top: 24px; }
.pager span { color: var(--muted); font-size: 14px; }

.more { text-align: center; margin-top: 20px; }

/* ---- recipe detail ---- */
.crumbs { font-size: 13px; color: var(--muted); margin: 20px 0 10px; }
.crumbs a { color: var(--muted); }
.recipe h1 { font-size: clamp(24px, 3.5vw, 34px); margin: 0 0 18px; }

.recipe-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 24px; align-items: start; margin-bottom: 28px;
}
@media (max-width: 760px) {
    .recipe-hero { grid-template-columns: 1fr; }
}
.recipe-hero img {
    width: 100%; border-radius: var(--radius);
    border: 1px solid var(--border); display: block;
}
.recipe-facts {
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
}
.recipe-facts p { margin: 0 0 10px; font-size: 15px; }
.recipe-facts strong { color: var(--text); }

.recipe-section { margin: 28px 0; }
.recipe-section h2 {
    font-size: 20px; margin-bottom: 12px;
    padding-bottom: 6px; border-bottom: 2px solid var(--border);
}

.ingredients { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 28px; }
@media (max-width: 640px) { .ingredients { columns: 1; } }
.ingredients li {
    padding: 6px 0; border-bottom: 1px dashed var(--border);
    font-size: 15px; break-inside: avoid;
}
.ingredients .measure { font-weight: 600; color: var(--brand-dark); }

.instructions p { margin: 0 0 12px; font-size: 16px; }

/* ---- nutrition (OpenFoodFacts) ---- */
.nutrition-note { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.nutrition-src {
    display: inline-block; margin-left: 6px; padding: 1px 7px;
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 999px; font-size: 12px;
}
.nutrition-grid {
    list-style: none; padding: 0; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}
.nutrition-grid li {
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 10px; text-align: center;
}
.nutrition-grid .n-val {
    display: block; font-size: 20px; font-weight: 700; color: var(--brand-dark);
    line-height: 1.2;
}
.nutrition-grid .n-unit { font-size: 12px; font-weight: 500; color: var(--muted); }
.nutrition-grid .n-label {
    display: block; margin-top: 4px; font-size: 12px; color: var(--muted);
}

.video-wrap {
    position: relative; padding-bottom: 56.25%; height: 0;
    overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border);
}
.video-wrap iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;
}

/* ---- empty / footer ---- */
.empty { color: var(--muted); font-size: 16px; }
.empty-page { text-align: center; padding: 60px 0; }

.site-footer {
    background: var(--bg-soft); border-top: 1px solid var(--border);
    margin-top: 48px; padding: 28px 0; font-size: 14px; color: var(--muted);
}
.site-footer p { margin: 4px 0; }
.footer-links a { color: var(--muted); }
.copy { margin-top: 10px; font-size: 13px; }

/* RTL (Arabic) */
[dir="rtl"] .card-meta span:not(:last-child)::after { content: ""; }
[dir="rtl"] .header-inner { direction: rtl; }
[dir="rtl"] .ingredients .measure { margin-left: 6px; }

/* ---- AdSense 广告位 ----
   关键：预留最小高度，避免广告异步加载完成前内容“跳动”(CLS)。
   CLS 是 Core Web Vitals 指标，直接影响 SEO 排名。 */
.ad-slot { margin: 18px 0; text-align: center; }
.ad-slot .ad-label {
    font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 6px;
}
ins.adsbygoogle {
    display: block; width: 100%; min-height: 100px;
    background: transparent;
}
.ad-top, .ad-bottom { min-height: 100px; }
/* 信息流广告跨整行网格（否则会挤成单列卡片） */
.ad-in-feed { grid-column: 1 / -1; }
/* 未填充兜底：隐藏空广告位，避免空白块 */
ins.adsbygoogle.ad-unfilled { min-height: 0; display: none; }
[dir="rtl"] .ad-label { text-align: right; }

/* ---- GDPR 同意横幅 ---- */
.consent-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    background: rgba(31,41,51,.96); color: #fff;
    box-shadow: 0 -2px 12px rgba(0,0,0,.18);
}
.consent-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; padding: 14px 0;
}
.consent-text { margin: 0; font-size: 14px; line-height: 1.5; flex: 1 1 320px; color: #f3f4f6; }
.consent-text a { color: #ffd8c2; text-decoration: underline; }
.consent-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.consent-actions .btn { padding: 9px 20px; border-radius: 8px; font-size: 14px; }
.consent-actions .btn-accept { background: var(--brand); color: #fff; }
.consent-actions .btn-reject { background: transparent; border: 1px solid rgba(255,255,255,.55); color: #fff; }
.consent-actions .btn:hover { opacity: .9; text-decoration: none; }
@media (max-width: 600px) {
    .consent-inner { flex-direction: column; align-items: stretch; }
    .consent-actions { justify-content: flex-end; }
}
/* GDPR 拒绝后隐藏全部广告位：hidden 属性需强制 display:none，
   否则 ins.adsbygoogle{display:block} 会覆盖 UA 的 [hidden] 规则导致空位可见 */
.ad-slot[hidden], ins.adsbygoogle[hidden] { display: none !important; }
