:root {
  --sp-green: #2e7d32;
  --sp-green-dark: #1b5e20;
  --sp-green-light: #e8f5e9;
  --sp-accent: #2e7d32;            /* 綠色文字／圖示（深色模式改亮綠） */
  --sp-bg: #f5f7f4;                /* 頁面底色 */
  --sp-surface: #fff;              /* 底部導覽列、AI 摘要等浮在上面的面 */
  --sp-line: #eef1ec;
  --sp-line-strong: #e3e7e1;
  --sp-muted: #7a837a;
  --sp-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.04);
  --sp-navbar: linear-gradient(90deg, #1b5e20, #2e7d32);
  --sp-hero: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #66bb6a 100%);
  --sp-hero-shadow: 0 10px 30px rgba(46,125,50,.25);
  --sp-chip-bg: #eef2ec;
  --sp-have-bg: #e8f5e9;
  --sp-have-fg: #1b5e20;
  --sp-miss-bg: #fff3e0;
  --sp-miss-fg: #e65100;
  --sp-upload-bg: #fafdf9;
  --sp-upload-border: #a5d6a7;
  --sp-expired-bg: #fff6f6;
  --sp-box-have: #f1f8e9;
  --sp-box-miss: #fff8e1;
  --sp-ai-from: #fff4e5;           /* AI 卡片底色（暖橘） */
  /* AI 點綴色：取自 Logo 的橘與棕（橘底配深棕字，對比約 8:1） */
  --sp-ai-1: #ffb300;
  --sp-ai-2: #fb8c00;
  --sp-ai-ink: #4a2205;
  --sp-ai-text: #c2410c;           /* 白底上的橘色文字（對比 5.2:1） */
  --sp-ai-icon: #ef6c00;
  --sp-stat-label: #6b746b;
  --sp-stat-value: #222;
  --sp-stat-sub: #8a938a;
  --sp-pill: #4c564c;
  --sp-btn-disabled: #81a784;
  --bs-primary: #2e7d32;
  --bs-success: #2e7d32;
  --bs-success-rgb: 46, 125, 50;
  --bs-link-color: #2e7d32;
  --bs-link-color-rgb: 46, 125, 50;
  --bs-link-hover-color: #1b5e20;
  --bs-body-font-family: 'Noto Sans TC', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* 深色模式（Bootstrap 本身的深色色票在 theme.css） */
:root[data-bs-theme="dark"] {
  /* 深色模式：頁面底色 #191919、卡片 #242424（中性深灰） */
  --sp-green-light: #263727;
  --sp-accent: #81c784;
  --sp-bg: #191919;
  --sp-surface: #242424;
  --sp-line: #2f2f2f;
  --sp-line-strong: #353535;
  --sp-muted: #999999;
  --sp-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 4px 14px rgba(0,0,0,.35);
  --sp-navbar: linear-gradient(90deg, #0e3311, #1a5a1f);
  --sp-hero: linear-gradient(135deg, #0e3311 0%, #1b5e20 55%, #2e7d32 100%);
  --sp-hero-shadow: 0 10px 30px rgba(0,0,0,.45);
  --sp-chip-bg: #303030;
  --sp-have-bg: #2b3c2c;
  --sp-have-fg: #a5d6a7;
  --sp-miss-bg: #42331f;
  --sp-miss-fg: #ffb74d;
  --sp-upload-bg: #1f1f1f;
  --sp-upload-border: #3d6b40;
  --sp-expired-bg: #352625;
  --sp-box-have: #272d27;
  --sp-box-miss: #332f25;
  --sp-ai-from: #332b22;
  --sp-ai-text: #ffb74d;           /* 深色卡片上的亮橘文字（對比 9.6:1） */
  --sp-ai-icon: #ffb74d;
  --sp-stat-label: #a3a3a3;
  --sp-stat-value: #f3f3f3;
  --sp-stat-sub: #8a8a8a;
  --sp-pill: #c4c4c4;
  --sp-btn-disabled: #3e5a40;
}

body {
  background: var(--sp-bg);
  min-height: 100vh;
}

.btn-success { --bs-btn-bg: var(--sp-green); --bs-btn-border-color: var(--sp-green); --bs-btn-hover-bg: var(--sp-green-dark); --bs-btn-hover-border-color: var(--sp-green-dark); --bs-btn-active-bg: var(--sp-green-dark); --bs-btn-disabled-bg: var(--sp-btn-disabled); --bs-btn-disabled-border-color: var(--sp-btn-disabled); }
.btn-outline-success { --bs-btn-color: var(--sp-green); --bs-btn-border-color: var(--sp-green); --bs-btn-hover-bg: var(--sp-green); --bs-btn-hover-border-color: var(--sp-green); --bs-btn-active-bg: var(--sp-green); --bs-btn-active-border-color: var(--sp-green); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #81c784; box-shadow: 0 0 0 .2rem rgba(46, 125, 50, .2); }
.form-check-input:checked { background-color: var(--sp-green); border-color: var(--sp-green); }

.app-navbar { background: var(--sp-navbar); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
/* 加到 iPhone 主畫面後，狀態列疊在頁面上：導覽列往下讓出瀏海／動態島的高度（一般瀏覽器是 0） */
.app-navbar { padding-top: calc(var(--bs-navbar-padding-y) + env(safe-area-inset-top, 0px)); }
.app-navbar .nav-link.active { font-weight: 700; color: #fff !important; }

.card { border: none; border-radius: 14px; box-shadow: var(--sp-shadow); }
.card-header { border-bottom: 1px solid var(--sp-line); border-radius: 14px 14px 0 0 !important; }
.card-footer { border-top: 1px solid var(--sp-line); border-radius: 0 0 14px 14px !important; }

/* 訪客體驗提示列（導覽列下方） */
.guest-bar { background: var(--sp-ai-from); color: var(--sp-ai-ink); border-bottom: 1px solid rgba(251,140,0,.25); font-size: .875rem; padding: .4rem 0; }
.guest-bar .bi { color: var(--sp-ai-icon); }
.guest-bar-btn { --bs-btn-padding-y: .15rem; --bs-btn-padding-x: .65rem; --bs-btn-font-size: .8rem; white-space: nowrap; }
[data-bs-theme="dark"] .guest-bar { color: #f3e3cf; border-bottom-color: rgba(255,183,77,.2); }
/* 訪客體驗按鈕（首頁、登入頁） */
.btn-guest { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255,255,255,.6); --bs-btn-hover-color: var(--sp-green-dark); --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: #fff; border-style: dashed; }

/* 手機底部導覽列 */
.has-bottom-nav main { padding-bottom: 84px !important; }
.has-bottom-nav .app-footer { padding-bottom: 96px !important; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: flex; justify-content: space-around; align-items: flex-end;
  background: var(--sp-surface); border-top: 1px solid var(--sp-line-strong);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; color: var(--sp-muted); text-decoration: none; font-size: .72rem; gap: 2px; }
.bottom-nav a i { font-size: 1.35rem; }
.bottom-nav a.active { color: var(--sp-accent); font-weight: 700; }
.bottom-nav a.scan i { background: var(--sp-green); color: #fff; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: -26px; box-shadow: 0 4px 12px rgba(46,125,50,.4); border: 4px solid var(--sp-surface); }

/* 首頁 hero */
.hero { background: var(--sp-hero); box-shadow: var(--sp-hero-shadow); }
/* 首頁主視覺：大標、兩個主要按鈕、真實手機畫面 */
.hero-title { font-size: clamp(2.15rem, 1.35rem + 3.2vw, 3.4rem); line-height: 1.18; letter-spacing: .01em; }
.hero-ai { color: #f5b72f; }
.hero-lead { font-size: 1rem; line-height: 1.75; opacity: .9; word-break: keep-all; overflow-wrap: anywhere; } /* 只在標點換行，不會把「記帳」拆開 */
.hero-note > span { word-break: keep-all; }
.hero-cta { display: grid; gap: .6rem; }
.hero-note { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; margin-top: .9rem; font-size: .875rem; opacity: .88; }
.hero-note a { text-underline-offset: 3px; }
.hero-phone { width: min(270px, 80%); margin: 0 auto; padding: 9px; border-radius: 42px; background: #1c1c1e;
  box-shadow: 0 0 0 2px #3a3a3c inset, 0 26px 50px rgba(0,0,0,.32), 0 0 0 8px rgba(255,255,255,.07); }
.hero-phone-screen { position: relative; overflow: hidden; border-radius: 33px; background: #f5f7f4; }
.hero-phone-status { height: 28px; display: flex; align-items: center; justify-content: space-between; padding: 2px 20px 0 26px;
  background: linear-gradient(90deg, #1b5e20, #2e7d32); color: #fff; font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
.hero-phone-island { width: 70px; height: 19px; border-radius: 11px; background: #000; }
.hero-phone-sys { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.hero-phone-sys .bi-battery-full { font-size: 15px; }
.hero-phone img { display: block; width: 100%; height: auto; }
.hero-phone .on-dark, [data-bs-theme="dark"] .hero-phone .on-light { display: none; }
[data-bs-theme="dark"] .hero-phone .on-dark { display: block; }
[data-bs-theme="dark"] .hero-phone-status { background: linear-gradient(90deg, #0e3311, #1a5a1f); }
[data-bs-theme="dark"] .hero-phone-screen { background: #191919; }
@media (min-width: 576px) {
  .hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }
  .hero-lead { font-size: 1.08rem; }
}
@media (min-width: 992px) {
  .hero-lead { font-size: 1.2rem; }
}
/* 手機、平板：手機畫面從主視覺底部探出來（只露出上半部），主視覺不會太高 */
@media (max-width: 991.98px) {
  .hero-landing { overflow: hidden; padding-bottom: 0 !important; }
  .hero-phone { width: min(250px, 72%); padding-bottom: 0; border-radius: 38px 38px 0 0; box-shadow: 0 0 0 2px #3a3a3c inset, 0 -6px 30px rgba(0,0,0,.18), 0 0 0 8px rgba(255,255,255,.07); }
  .hero-phone-screen { max-height: 300px; border-radius: 30px 30px 0 0; }
}
.feature-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--sp-green-light); color: var(--sp-accent); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
/* 首頁功能卡片：手機版圖示在左、文字在右（卡片高度約少一半） */
@media (max-width: 767.98px) {
  .feature-card .card-body { display: grid; grid-template-columns: 2.75rem 1fr; column-gap: .9rem; align-items: start; padding: .9rem 1rem; }
  .feature-card .feature-icon { grid-row: span 2; width: 2.75rem; height: 2.75rem; font-size: 1.2rem; border-radius: .8rem; margin-bottom: 0 !important; }
  .feature-card h5 { font-size: 1rem; margin: .1rem 0 .2rem; }
  .feature-card p { font-size: .875rem; line-height: 1.6; }
}
/* 首頁「三個步驟就上手」：手機直排、電腦橫排，編號圓圈之間用線連起來 */
.flow3 { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.4rem; }
.flow3 li { position: relative; display: grid; grid-template-columns: 2.5rem 1fr; column-gap: .9rem; }
.flow3-num { grid-row: span 2; position: relative; z-index: 1; width: 2.5rem; height: 2.5rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--sp-green); color: #fff; font-weight: 700; font-size: 1.1rem; box-shadow: 0 0 0 5px var(--sp-green-light); }
.flow3-title { margin: .55rem 0 .3rem; font-weight: 700; font-size: 1.05rem; }
.flow3-title .bi { color: var(--sp-accent); }
.flow3-desc { margin: 0; color: var(--sp-muted); font-size: .9rem; line-height: 1.7; text-wrap: pretty; }
.feature-card p, .hero-lead { text-wrap: pretty; } /* 避免最後一行只剩一個字 */
.flow3 li:not(:last-child)::after { content: ""; position: absolute; left: 1.25rem; top: 3.1rem; bottom: -.8rem; width: 2px; margin-left: -1px; border-radius: 2px; background: rgba(var(--bs-success-rgb), .3); }
@media (min-width: 768px) {
  .flow3 { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
  .flow3 li { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 0 .5rem; }
  .flow3-desc { text-wrap: balance; }
  .flow3-num { grid-row: auto; width: 3rem; height: 3rem; font-size: 1.25rem; }
  .flow3-title { margin-top: 1rem; }
  /* 連到下一個圓圈：從這個圓圈右邊到下一個圓圈左邊 */
  .flow3 li:not(:last-child)::after { left: calc(50% + 1.5rem + 12px); right: auto; top: 1.5rem; bottom: auto; width: calc(100% + 1.5rem - 3rem - 24px); height: 2px; margin: -1px 0 0; }
}
.auth-card { margin-top: 2rem; }

/* 統計卡片 */
/* 首頁數字卡片：右上角的圖示方塊用顏色表示狀態（沒有要處理的事就是綠色勾勾），數字與單位同一行 */
.stat-card { --stat-c: var(--sp-accent); --stat-bg: var(--sp-green-light); color: inherit; transition: transform .15s, box-shadow .15s; }
.stat-card .card-body { padding: 1rem 1.1rem .95rem; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 2px 6px rgba(0,0,0,.07), 0 10px 24px rgba(0,0,0,.07); }
.stat-card.tone-warn { --stat-c: #ef8c00; --stat-bg: #fff3dc; }
.stat-card.tone-danger { --stat-c: #d32f2f; --stat-bg: #fde8e8; }
.stat-card.tone-neutral { --stat-c: var(--sp-pill); --stat-bg: var(--sp-chip-bg); }
.stat-card.is-alert { background: var(--sp-expired-bg); box-shadow: var(--sp-shadow), inset 0 0 0 1px rgba(211,47,47,.16); }
.stat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.stat-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; font-weight: 500; color: var(--sp-stat-label); padding-top: .2rem; }
.stat-icon { flex: 0 0 auto; width: 2.25rem; height: 2.25rem; border-radius: .7rem; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; background: var(--stat-bg); color: var(--stat-c); }
.stat-value { margin-top: .3rem; font-size: 2rem; font-weight: 700; line-height: 1.15; color: var(--sp-stat-value); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.stat-unit { margin-left: .25rem; font-size: .85rem; font-weight: 500; color: var(--sp-stat-label); letter-spacing: 0; }
.stat-unit-pre { margin: 0 .3rem 0 0; }
.stat-sub { margin-top: .2rem; font-size: .78rem; color: var(--sp-stat-sub); }
.stat-card.tone-warn .stat-sub, .stat-card.tone-danger .stat-sub { color: var(--sp-stat-label); }
[data-bs-theme="dark"] .stat-card.tone-warn { --stat-c: #ffb74d; --stat-bg: #3a2f1c; }
[data-bs-theme="dark"] .stat-card.tone-danger { --stat-c: #ef9a9a; --stat-bg: #3d2424; }
[data-bs-theme="dark"] .stat-card.is-alert { box-shadow: var(--sp-shadow), inset 0 0 0 1px rgba(239,154,154,.18); }
[data-bs-theme="dark"] a.stat-card:hover { box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 10px 24px rgba(0,0,0,.45); }
@media (max-width: 575.98px) {
  .stat-card .card-body { padding: .85rem .9rem .8rem; }
  .stat-icon { width: 2rem; height: 2rem; font-size: 1rem; border-radius: .6rem; }
  .stat-value { font-size: 1.65rem; }
}

.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--sp-chip-bg); font-size: .85rem; }
.chip.have { background: var(--sp-have-bg); color: var(--sp-have-fg); }
.chip.missing { background: var(--sp-miss-bg); color: var(--sp-miss-fg); }

/* 新增食材 */
.upload-zone { display: block; border: 2px dashed var(--sp-upload-border); border-radius: 14px; padding: 28px 12px; text-align: center; cursor: pointer; background: var(--sp-upload-bg); transition: background .15s; }
.upload-zone:hover { background: var(--sp-green-light); }
.upload-zone img { max-height: 280px; }
.step-dot { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--sp-green); color: #fff; font-size: .8rem; align-items: center; justify-content: center; margin-right: 6px; }
.item-row { border: 1px solid var(--sp-line-strong); box-shadow: none; }

/* 庫存 */
.filter-pills .nav-link { color: var(--sp-pill); border-radius: 999px; }
.filter-pills .nav-link.active { background: var(--sp-green); color: #fff; }
.pantry-card.expired { background: var(--sp-expired-bg); }
.pantry-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; flex-shrink: 0; background: var(--sp-green-light); }
.pantry-thumb.emoji { display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.min-w-0 { min-width: 0; }
.check-btn { width: 32px; height: 32px; padding: 0; }

/* 食譜 */
.recipe-card { border-top: 4px solid var(--sp-green); }
.ingredient-box { border-radius: 12px; padding: 12px; height: 100%; }
.ingredient-box.have { background: var(--sp-box-have); }
.ingredient-box.missing { background: var(--sp-box-miss); }
.recipe-steps li { margin-bottom: .4rem; }
details summary { cursor: pointer; }

/* 記帳 */
.chart-box { position: relative; height: 260px; }
.ai-card { background: linear-gradient(135deg, var(--sp-ai-from), var(--bs-body-bg)); }
.ai-card h5 .bi { color: var(--sp-ai-icon); }
.ai-summary { font-size: 1.05rem; background: var(--sp-surface); border-left: 4px solid var(--sp-ai-2); padding: 10px 14px; border-radius: 8px; }

.ai-loading { color: var(--sp-ai-text); font-weight: 500; }
.ai-loading .spinner-border.text-success { color: var(--sp-ai-icon) !important; }

/* AI 相關按鈕與圖示：使用 Logo 的橘色點綴（一般操作仍是綠色） */
.btn-ai {
  --bs-btn-color: var(--sp-ai-ink); --bs-btn-bg: var(--sp-ai-2); --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--sp-ai-ink); --bs-btn-hover-bg: #f57c00; --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--sp-ai-ink); --bs-btn-active-bg: #ef6c00; --bs-btn-active-border-color: transparent;
  --bs-btn-disabled-color: var(--sp-ai-ink); --bs-btn-disabled-bg: var(--sp-ai-2); --bs-btn-disabled-border-color: transparent;
  --bs-btn-focus-shadow-rgb: 251, 140, 0;
  background-image: linear-gradient(135deg, var(--sp-ai-1), var(--sp-ai-2));
  font-weight: 700;
}
.btn-ai:hover, .btn-ai:focus-visible { background-image: linear-gradient(135deg, #ffa000, #f57c00); }
.btn-ai-outline {
  --bs-btn-color: var(--sp-ai-text); --bs-btn-border-color: var(--sp-ai-2);
  --bs-btn-hover-color: var(--sp-ai-ink); --bs-btn-hover-bg: var(--sp-ai-2); --bs-btn-hover-border-color: var(--sp-ai-2);
  --bs-btn-active-color: var(--sp-ai-ink); --bs-btn-active-bg: #f57c00; --bs-btn-active-border-color: #f57c00;
  --bs-btn-disabled-color: var(--sp-ai-text); --bs-btn-disabled-border-color: var(--sp-ai-2);
  --bs-btn-focus-shadow-rgb: 251, 140, 0;
}
.text-ai { color: var(--sp-ai-icon) !important; }

/* 頁尾 */
.app-footer { font-size: .8rem; color: var(--bs-secondary-color); line-height: 1.7; }
.app-footer .footer-name { font-weight: 600; color: var(--bs-body-color); }
.app-footer .footer-links { display: flex; flex-wrap: wrap; justify-content: center; column-gap: .45rem; margin: .15rem 0; }
.app-footer .footer-links a { color: var(--bs-secondary-color); text-decoration: none; }
.app-footer .footer-links a:hover, .app-footer .footer-links a:focus-visible { color: var(--sp-accent); text-decoration: underline; }

/* 關於我們、使用教學、隱私權政策、服務條款、聯絡我們 */
.doc-page { max-width: 860px; margin: 0 auto; }
.doc-page h5 { font-weight: 700; margin-top: 1.6rem; margin-bottom: .6rem; }
.doc-page h5:first-child { margin-top: 0; }
.doc-page p, .doc-page li { line-height: 1.8; }
.doc-page .doc-meta { font-size: .85rem; color: var(--bs-secondary-color); }
.doc-body > :last-child { margin-bottom: 0; }
.doc-body h5 .bi, .doc-body li > .bi:first-child { color: var(--sp-accent); }
.doc-body h6 { font-weight: 700; margin-top: 1.2rem; }
.doc-steps { counter-reset: step; list-style: none; padding-left: 0; }
.doc-steps > li { position: relative; padding-left: 2.6rem; margin-bottom: 1.1rem; }
.doc-steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: .1rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--sp-green); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .9rem; }

/* 電腦版（lg 以上）固定在畫面上方；手機版不可位移，否則卡片會往下偏移、被下一張卡片蓋住按鈕 */
@media (min-width: 992px) { .sticky-lg-offset { top: 80px; } }

/* 記帳頁：手機版的購買明細清單（依日期分組） */
.exp-day { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 1rem; font-size: .8rem; font-weight: 600; color: var(--sp-stat-label); background: var(--sp-bg); border-top: 1px solid var(--sp-line); border-bottom: 1px solid var(--sp-line); }
.exp-day:first-child { border-top: 0; }
.exp-item { display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; background: transparent; }
.exp-icon { flex: 0 0 auto; width: 2.1rem; height: 2.1rem; border-radius: .6rem; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; background: var(--sp-chip-bg); }
.exp-main { flex: 1 1 auto; min-width: 0; }
.exp-name { font-weight: 600; line-height: 1.3; }
.exp-meta { font-size: .78rem; color: var(--sp-stat-sub); }
.exp-amount { flex: 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 顏色統一：原本 Bootstrap 的水藍色（info）改成跟主題配色走的淡主色 */
.badge-soon { background: var(--sp-green-light); color: var(--sp-accent); box-shadow: inset 0 0 0 1px rgba(var(--bs-success-rgb), .28); }
.alert-info { --bs-alert-bg: var(--sp-green-light); --bs-alert-border-color: rgba(var(--bs-success-rgb), .25); --bs-alert-color: var(--bs-body-color); --bs-alert-link-color: var(--sp-accent); }
.alert-info > .bi:first-child, .alert-info > i:first-child { color: var(--sp-accent); }

/* 首頁：真實使用數據 */
.home-stat-num { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--sp-stat-value); font-variant-numeric: tabular-nums; }
.home-stat-num .bi { font-size: 1.1rem; color: var(--sp-accent); vertical-align: .1em; }
.home-stat-label { font-size: .85rem; color: var(--sp-stat-label); }
/* 首頁：技術亮點 */
.tech-grid { display: grid; gap: 1rem 1.5rem; }
.tech-item { display: grid; grid-template-columns: 2.5rem 1fr; column-gap: .85rem; align-items: start; }
.tech-icon { width: 2.5rem; height: 2.5rem; border-radius: .75rem; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; background: var(--sp-chip-bg); color: var(--sp-pill); }
.tech-title { font-weight: 700; margin: .1rem 0 .15rem; }
.tech-desc { font-size: .875rem; line-height: 1.65; color: var(--sp-muted); text-wrap: pretty; }
@media (min-width: 768px) { .tech-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .tech-grid { grid-template-columns: repeat(3, 1fr); } }
/* 首頁：常見問題 */
.faq details { border-top: 1px solid var(--sp-line-strong); }
.faq details:last-child { border-bottom: 1px solid var(--sp-line-strong); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .75rem; padding: .85rem .1rem; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .bi { margin-left: auto; flex: 0 0 auto; color: var(--sp-muted); transition: transform .2s; }
.faq details[open] summary .bi { transform: rotate(180deg); }
.faq summary:hover { color: var(--sp-accent); }
.faq-answer { padding: 0 .1rem 1rem; color: var(--sp-muted); line-height: 1.75; text-wrap: pretty; }
/* 首頁：收尾區塊 */
.cta-band h2 { font-size: clamp(1.4rem, 1.1rem + 1.3vw, 2rem); }
@media (min-width: 576px) { .cta-band .hero-cta { justify-content: center; } }

/* 新增：拍食材（存入庫存）／拍料理（學做法）兩種拍照用途 */
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.mode-tab { display: flex; align-items: center; gap: .65rem; min-width: 0; padding: .65rem .8rem; border: 1.5px solid var(--sp-line-strong); border-radius: 14px; background: var(--sp-surface); color: var(--bs-body-color); text-decoration: none; transition: border-color .15s, background .15s; }
.mode-tab:hover { border-color: rgba(var(--bs-success-rgb), .55); color: var(--bs-body-color); }
.mode-tab.active { border-color: var(--sp-green); background: var(--sp-green-light); }
.mode-ico { flex: 0 0 auto; width: 2.3rem; height: 2.3rem; border-radius: .75rem; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; background: var(--sp-chip-bg); color: var(--sp-pill); }
.mode-tab.active .mode-ico { background: var(--sp-green); color: #fff; }
.mode-txt { min-width: 0; line-height: 1.3; }
.mode-txt b { display: block; font-size: 1rem; }
.mode-tab.active .mode-txt b { color: var(--sp-accent); }
.mode-txt small { display: block; margin-top: .1rem; font-size: .75rem; color: var(--sp-muted); word-break: keep-all; }
@media (max-width: 575.98px) { .mode-tab { padding: .55rem .6rem; gap: .5rem; } .mode-ico { width: 2rem; height: 2rem; font-size: 1rem; border-radius: .6rem; } }

/* 拍料理 */
.dish-empty-ico { width: 4rem; height: 4rem; margin: 0 auto .9rem; border-radius: 1.2rem; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; background: var(--sp-green-light); color: var(--sp-accent); }
.dish-empty-ico.sm { width: 2.75rem; height: 2.75rem; margin: 0; flex: 0 0 auto; border-radius: .9rem; font-size: 1.3rem; }
.dish-steps { max-width: 27rem; display: grid; gap: .65rem; font-size: .9rem; line-height: 1.55; }
.dish-steps > div { display: flex; align-items: flex-start; text-wrap: pretty; }
.dish-steps .step-dot { flex: 0 0 auto; margin-right: .6rem; }
.dish-note { padding-top: .75rem; border-top: 1px dashed var(--sp-line-strong); line-height: 1.6; }
.dish-name { text-wrap: balance; }
.dish-badge { background: var(--sp-chip-bg); color: var(--sp-pill); font-weight: 600; }
.dish-alt { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; color: var(--sp-muted); }
.dish-alt-btn { --bs-btn-padding-y: .12rem; --bs-btn-padding-x: .65rem; --bs-btn-font-size: .8rem; --bs-btn-color: var(--bs-body-color); --bs-btn-bg: var(--sp-chip-bg); --bs-btn-border-color: var(--sp-line-strong); --bs-btn-hover-color: var(--sp-accent); --bs-btn-hover-bg: var(--sp-green-light); --bs-btn-hover-border-color: rgba(var(--bs-success-rgb), .4); --bs-btn-active-bg: var(--sp-green-light); --bs-btn-active-color: var(--sp-accent); border-radius: 999px; }
.dish-buy { margin-bottom: .3rem; }
.dish-tag { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border-radius: 999px; font-size: .7rem; background: var(--sp-surface); color: var(--sp-muted); vertical-align: .08em; }
.dish-tip { padding: .6rem .8rem; border-radius: 10px; background: var(--sp-green-light); line-height: 1.6; }
.dish-tip .bi { color: var(--sp-accent); }
.dish-fix { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--sp-line); }
.dish-fix summary { font-size: .875rem; color: var(--sp-muted); }
.dish-fix summary:hover, .dish-fix[open] summary { color: var(--sp-accent); }

/* 我的收藏食譜：拍料理的照片與標籤 */
.saved-recipe-btn { gap: .75rem; }
.saved-thumb { flex: 0 0 auto; width: 44px; height: 44px; object-fit: cover; border-radius: 10px; background: var(--sp-green-light); }
.saved-title { flex: 1 1 auto; min-width: 0; }
.saved-title .dish-badge { margin-left: .35rem; font-size: .7rem; vertical-align: .12em; }
.saved-photo { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; }
.dish-card .ingredient-box { height: auto; }

/* AI 輔助標記：AI 在本系統是選用的輔助功能 */
.ai-chip { display: inline-flex; align-items: center; gap: .2rem; padding: .08rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.5; white-space: nowrap; vertical-align: .1em; background: var(--sp-ai-from); color: var(--sp-ai-text); border: 1px solid rgba(251, 140, 0, .35); }
.ai-assist-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; padding: .6rem .75rem; border-radius: 12px; border: 1px dashed rgba(251, 140, 0, .45); background: var(--sp-ai-from); }
.ai-assist-txt { display: flex; align-items: center; gap: .45rem; font-size: .875rem; color: var(--sp-ai-ink); }
[data-bs-theme="dark"] .ai-assist-txt { color: var(--bs-body-color); }
.feature-card .ai-chip { margin-left: .35rem; }

/* 首頁：核心功能／AI 輔助功能 兩組 */
.section-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; font-size: 1.15rem; font-weight: 700; margin: 0 0 .75rem; }
.section-title > .bi { margin-right: 0 !important; }
.section-note { font-size: .82rem; font-weight: 400; color: var(--sp-muted); }
.feature-ai { background: linear-gradient(160deg, var(--sp-ai-from), var(--sp-surface) 60%); }
.feature-ai .feature-icon { background: var(--sp-ai-from); color: var(--sp-ai-text); }

/* 新增食材：拍照（AI 輔助）與手動輸入之間的分隔線 */
.or-divider { display: flex; align-items: center; gap: .75rem; margin: 1rem 0 .25rem; color: var(--sp-muted); font-size: .8rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--sp-line-strong); }

/* 自己畫的食材圖示 */
.food-icon { width: 1.25em; height: 1.25em; vertical-align: -0.25em; object-fit: contain; }
.pantry-thumb.emoji .food-icon { width: 2.6rem; height: 2.6rem; vertical-align: baseline; }
.exp-icon .food-icon { width: 1.5rem; height: 1.5rem; vertical-align: baseline; }
.fs-4 > .food-icon { width: 1.8rem; height: 1.8rem; vertical-align: baseline; }
.row-icon .food-icon { width: 1.8rem; height: 1.8rem; vertical-align: middle; }
