/* ============================================================
   私宴 · 二人食   ——  视觉体系
   深墨底 / 象牙白 / 烫金细线 / 楷体标题
   全部使用系统字体，不依赖任何网络字体
   ============================================================ */

:root {
  --ink:        #0e0e10;
  --ink-2:      #141418;
  --ink-3:      #1c1c22;
  --line:       rgba(201, 168, 106, .16);
  --line-soft:  rgba(255, 255, 255, .07);
  --ivory:      #f4efe4;
  --ivory-dim:  #cdc7b8;
  --muted:      #8b8677;
  --gold:       #c9a86a;
  --gold-bright:#e2c88f;
  --chuan:      #b23b2e;
  --yue:        #2e6b5e;
  --radius:     14px;
  --shadow:     0 18px 50px rgba(0, 0, 0, .55);
  --font-display: "KaiTi", "STKaiti", "楷体", "Songti SC", "SimSun", "STSong", serif;
  --font-latin:   "Cormorant Garamond", "Didot", "Georgia", "Times New Roman", serif;
  --font-body:    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {  /* 极淡的暖光，避免死黑 */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 520px at 12% -6%, rgba(201,168,106,.09), transparent 62%),
    radial-gradient(900px 480px at 96% 4%, rgba(178,59,46,.06), transparent 60%);
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* ------------------------------- 顶栏 ------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(14,14,16,.96), rgba(14,14,16,.82));
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 14px 18px 10px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand-cn::before {   /* 黑珍珠 */
  content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 11px;
  border-radius: 50%; vertical-align: 3px;
  background: radial-gradient(circle at 32% 28%, #fffaf0, #cfae72 55%, #5d4a22 100%);
  box-shadow: 0 0 10px rgba(201, 168, 106, .5);
}
.brand-cn {
  font-family: var(--font-display); font-size: 25px; letter-spacing: .16em;
  color: var(--ivory);
}
.brand-latin {
  font-family: var(--font-latin); font-size: 11px; letter-spacing: .42em;
  text-transform: uppercase; color: var(--gold);
}
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .2em; }

.tabs { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.tab {
  position: relative; padding: 9px 15px; font-size: 14px; letter-spacing: .1em;
  color: var(--ivory-dim); border-radius: 8px; transition: color .2s, background .2s;
}
.tab:hover { color: var(--ivory); background: rgba(255,255,255,.035); }
.tab.active { color: var(--gold-bright); }
.tab.active::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 3px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.tab .dot {
  display: inline-block; min-width: 17px; height: 17px; line-height: 17px;
  margin-left: 6px; padding: 0 5px; border-radius: 9px; font-size: 11px;
  background: var(--chuan); color: #fff; text-align: center; vertical-align: 1px;
}
.tab .dot.hide { display: none; }

/* ------------------------------- 布局 ------------------------------- */

main { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 26px 18px 90px; }
.view { display: none; animation: fadeUp .45s ease both; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------- 首页 hero ------------------------------- */

.hero { text-align: center; padding: 30px 10px 34px; }
.hero-eyebrow {
  font-family: var(--font-latin); font-size: 11px; letter-spacing: .5em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 14px;
}
.hero-title {
  font-family: var(--font-display); font-size: clamp(28px, 5.2vw, 46px);
  font-weight: 400; letter-spacing: .1em; margin: 0 0 12px; line-height: 1.35;
}
.hero-sub { color: var(--ivory-dim); font-size: 14px; letter-spacing: .06em; margin: 0; }
.hero-rule {
  width: 108px; height: 1px; margin: 22px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero-stats { display: flex; justify-content: center; gap: 34px; margin-top: 24px; flex-wrap: wrap; }
.hero-stat b { display: block; font-family: var(--font-latin); font-size: 26px; color: var(--gold-bright); font-weight: 500; }
.hero-stat span { font-size: 11px; color: var(--muted); letter-spacing: .18em; }

/* ------------------------------- 筛选 ------------------------------- */

.filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-label {
  font-size: 11px; letter-spacing: .24em; color: var(--muted); min-width: 60px;
  text-transform: uppercase;
}
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; font-size: 13px; border-radius: 999px;
  border: 1px solid var(--line-soft); color: var(--ivory-dim);
  transition: all .2s; background: rgba(255,255,255,.02);
}
.chip:hover { border-color: var(--line); color: var(--ivory); }
.chip.active { border-color: var(--gold); color: var(--gold-bright); background: rgba(201,168,106,.1); }

.search {
  flex: 1; min-width: 180px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line-soft);
  color: var(--ivory); outline: none; font-size: 14px;
}
.search:focus { border-color: var(--gold); }
.search::placeholder { color: var(--muted); }

/* ------------------------------- 菜品网格 ------------------------------- */

.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}

.card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--ink-2); border: 1px solid var(--line-soft);
  transition: transform .35s cubic-bezier(.2,.8,.3,1), border-color .35s, box-shadow .35s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: var(--line); box-shadow: var(--shadow); }

.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #191920; }
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s cubic-bezier(.2,.8,.3,1), filter .5s;
  filter: saturate(1.03) contrast(1.02);
}
.card:hover .card-media img { transform: scale(1.055); }
.card-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.30) 0%, rgba(0,0,0,0) 34%, rgba(0,0,0,.62) 100%);
}

/* 无图时的设计化封面 */
.cover-fallback {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; position: relative;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(201,168,106,.14), transparent 60%),
    linear-gradient(150deg, #22222a 0%, #14141a 55%, #1d1a16 100%);
}
.cover-fallback.chuan { background: radial-gradient(120% 90% at 50% 0%, rgba(178,59,46,.26), transparent 62%), linear-gradient(150deg,#241a19,#141013 60%,#1d1512); }
.cover-fallback.yue   { background: radial-gradient(120% 90% at 50% 0%, rgba(46,107,94,.26), transparent 62%), linear-gradient(150deg,#16211f,#101416 60%,#151b19); }
.cover-fallback .cf-frame { position: absolute; inset: 13px; border: 1px solid var(--line); }
.cover-fallback .cf-name {
  font-family: var(--font-display); font-size: 27px; letter-spacing: .2em;
  color: var(--ivory); text-shadow: 0 2px 14px rgba(0,0,0,.6);
}
.cover-fallback .cf-latin {
  font-family: var(--font-latin); font-size: 10px; letter-spacing: .38em;
  text-transform: uppercase; color: var(--gold);
}

.card-no {
  position: absolute; top: 12px; left: 14px; z-index: 2;
  font-family: var(--font-latin); font-size: 12px; letter-spacing: .18em; color: var(--gold-bright);
  text-shadow: 0 1px 8px #000;
}
.badge-cuisine {
  position: absolute; top: 11px; right: 12px; z-index: 2;
  font-size: 11px; letter-spacing: .14em; padding: 3px 9px; border-radius: 999px;
  border: 1px solid currentColor; backdrop-filter: blur(4px);
}
.badge-cuisine.chuan { color: #f0a79c; background: rgba(178,59,46,.26); }
.badge-cuisine.yue   { color: #9ed4c6; background: rgba(46,107,94,.26); }

.card-body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-name { font-family: var(--font-display); font-size: 22px; letter-spacing: .06em; margin: 0; font-weight: 400; }
.card-en { font-family: var(--font-latin); font-size: 11px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.card-tagline { font-size: 13px; color: var(--ivory-dim); margin: 0; min-height: 2.6em; }
.mini-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mini {
  font-size: 11px; letter-spacing: .05em; color: var(--ivory-dim);
  border: 1px solid var(--line-soft); border-radius: 6px; padding: 2px 8px; background: rgba(255,255,255,.02);
}
.mini.spicy { color: #ef9a8f; border-color: rgba(178,59,46,.4); }
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }

.btn-primary {
  flex: 1; padding: 9px 14px; border-radius: 9px; font-size: 14px; letter-spacing: .1em;
  background: linear-gradient(135deg, var(--gold), #a5854d); color: #1a1408; font-weight: 600;
  transition: filter .2s, transform .12s;
}
.btn-primary:hover { filter: brightness(1.09); }
.btn-primary:active { transform: scale(.98); }
.btn-ghost {
  padding: 9px 14px; border-radius: 9px; font-size: 14px; letter-spacing: .1em;
  border: 1px solid var(--line); color: var(--ivory-dim); transition: all .2s;
}
.btn-ghost:hover { color: var(--gold-bright); border-color: var(--gold); }
.btn-danger { border-color: rgba(178,59,46,.5); color: #e79c92; }
.btn-danger:hover { border-color: #b23b2e; color: #ffb3a8; }

.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .e-cn { font-family: var(--font-display); font-size: 22px; color: var(--ivory-dim); letter-spacing: .14em; }

/* ------------------------------- 详情弹层 ------------------------------- */

.modal {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(6,6,8,.82); backdrop-filter: blur(9px);
  overflow-y: auto; padding: 22px 14px 60px;
}
.modal.open { display: block; animation: fadeUp .3s ease both; }
.modal-card {
  max-width: 980px; margin: 0 auto; background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow);
}
.modal-hero { position: relative; aspect-ratio: 21 / 9; background: #191920; overflow: hidden; }
.modal-hero img { width: 100%; height: 100%; object-fit: cover; }
.modal-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.5), transparent 40%, rgba(20,20,24,.96)); }
.modal-hero .mh-text { position: absolute; left: 30px; right: 30px; bottom: 20px; z-index: 2; }
.modal-hero h2 { font-family: var(--font-display); font-size: clamp(26px, 4.4vw, 40px); margin: 0 0 6px; font-weight: 400; letter-spacing: .08em; }
.modal-hero .mh-latin { font-family: var(--font-latin); font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.modal-close {
  position: absolute; top: 14px; right: 16px; z-index: 3; width: 38px; height: 38px;
  border-radius: 50%; background: rgba(0,0,0,.5); border: 1px solid var(--line);
  color: var(--ivory); font-size: 19px; line-height: 1;
}
.modal-close:hover { background: rgba(178,59,46,.5); }

.modal-body { padding: 26px 30px 34px; }
.meta-bar { display: flex; gap: 26px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.meta-item span { display: block; font-size: 11px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.meta-item b { font-family: var(--font-display); font-size: 18px; font-weight: 400; color: var(--ivory); }

.sec-title {
  display: flex; align-items: center; gap: 12px; margin: 26px 0 12px;
  font-family: var(--font-display); font-size: 19px; letter-spacing: .16em; color: var(--gold-bright);
}
.sec-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

.ing-table { width: 100%; border-collapse: collapse; }
.ing-table th {
  text-align: left; font-size: 11px; letter-spacing: .18em; color: var(--muted);
  font-weight: 400; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); text-transform: uppercase;
}
.ing-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 14px; vertical-align: top; }
.ing-table td.amt { color: var(--gold-bright); white-space: nowrap; font-family: var(--font-latin); font-size: 15px; letter-spacing: .04em; }
.ing-table td.note { color: var(--muted); font-size: 13px; }
.ing-table tr:hover td { background: rgba(255,255,255,.018); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { position: relative; padding: 0 0 20px 52px; counter-increment: s; }
.steps li::before {
  content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 0;
  font-family: var(--font-latin); font-size: 15px; color: var(--gold);
  border: 1px solid var(--line); border-radius: 50%; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
}
.steps li::after { content: ""; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 1px; background: var(--line-soft); }
.steps li:last-child::after { display: none; }
.steps .st-title { font-family: var(--font-display); font-size: 17px; letter-spacing: .08em; color: var(--ivory); margin-bottom: 4px; }
.steps .st-text { font-size: 14px; color: var(--ivory-dim); line-height: 1.85; }

.note-box {
  border-left: 2px solid var(--gold); background: rgba(201,168,106,.055);
  padding: 14px 18px; border-radius: 0 10px 10px 0; margin-top: 8px;
}
.note-box p { margin: 5px 0; font-size: 14px; color: var(--ivory-dim); }
.note-box strong { color: var(--gold-bright); font-weight: 500; }

.order-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.qty { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.qty button { width: 36px; height: 38px; font-size: 17px; color: var(--ivory-dim); }
.qty button:hover { background: rgba(255,255,255,.06); color: var(--gold-bright); }
.qty span { width: 40px; text-align: center; font-family: var(--font-latin); font-size: 17px; }
.note-input {
  flex: 1; min-width: 160px; padding: 9px 14px; border-radius: 9px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line-soft); color: var(--ivory); outline: none;
}
.note-input:focus { border-color: var(--gold); }

/* ------------------------- 配料表（含缩略图 / 买什么） ------------------------- */

.ing-table th.th-thumb, .ing-table td.td-thumb { width: 56px; padding-left: 0; padding-right: 10px; }
.ing-thumb {
  display: block; width: 46px; height: 46px; border-radius: 9px; object-fit: cover;
  border: 1px solid var(--line-soft); background: #1b1b22;
}
.ing-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 20px; color: var(--gold);
  background: linear-gradient(140deg, #23232b, #17171c);
}
.ing-name { font-size: 15px; color: var(--ivory); letter-spacing: .03em; }
.ing-pick { font-size: 12.5px; color: var(--gold-bright); margin-top: 3px; line-height: 1.55; }
.ing-tip  { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

.thumb-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 22px; color: var(--gold);
  background: linear-gradient(140deg, #23232b, #17171c);
}
.thumb-fallback.chuan { background: linear-gradient(140deg, #2c1c1a, #171215); color: #e8a99e; }
.thumb-fallback.yue   { background: linear-gradient(140deg, #172624, #121718); color: #9ed4c6; }

/* ------------------------------- 通用面板 ------------------------------- */

.panel-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.panel-head h2 { font-family: var(--font-display); font-size: 30px; font-weight: 400; letter-spacing: .12em; margin: 0; }
.panel-head .ph-sub { color: var(--muted); font-size: 13px; letter-spacing: .1em; }
.panel-head .ph-actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

.order-item {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 10px;
  background: var(--ink-2); border: 1px solid var(--line-soft); border-radius: 12px;
  transition: border-color .25s, opacity .25s;
}
.order-item:hover { border-color: var(--line); }
.order-item.done { opacity: .45; }
.order-item.done .oi-name { text-decoration: line-through; }
.oi-thumb { width: 60px; height: 60px; border-radius: 9px; overflow: hidden; flex: 0 0 60px; background: #1b1b22; }
.oi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.oi-main { flex: 1; min-width: 0; }
.oi-name { font-family: var(--font-display); font-size: 19px; letter-spacing: .06em; }
.oi-meta { font-size: 12px; color: var(--muted); letter-spacing: .05em; }
.oi-note { font-size: 13px; color: var(--gold-bright); margin-top: 3px; }
.oi-actions { display: flex; gap: 7px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line-soft);
  color: var(--ivory-dim); font-size: 15px; transition: all .2s;
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold-bright); }
.icon-btn.ok:hover { border-color: #4f9e7d; color: #8fd8b8; }
.icon-btn.del:hover { border-color: #b23b2e; color: #ffb3a8; }

.who { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .08em; }
.who .avatar {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; background: rgba(201,168,106,.16); border: 1px solid var(--line); color: var(--gold-bright);
}

/* ------------------------------- 厨师台 ------------------------------- */

.kitchen-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.kitchen-col {
  background: linear-gradient(180deg, rgba(255,255,255,.022), transparent);
  border: 1px solid var(--line-soft); border-radius: 14px; padding: 18px;
}
.kitchen-col h3 {
  font-family: var(--font-display); font-size: 20px; font-weight: 400; letter-spacing: .14em;
  margin: 0 0 14px; display: flex; align-items: center; gap: 10px;
}
.kitchen-col h3 .count { font-family: var(--font-latin); font-size: 15px; color: var(--gold); }
.kitem {
  display: flex; gap: 13px; align-items: center; padding: 12px 14px; margin-bottom: 9px;
  background: var(--ink-3); border: 1px solid var(--line-soft); border-radius: 11px;
}
.kitem .ki-no { font-family: var(--font-latin); font-size: 13px; color: var(--muted); }
.kitem .ki-body { flex: 1; min-width: 0; }
.kitem .ki-name { font-family: var(--font-display); font-size: 20px; letter-spacing: .05em; }
.kitem .ki-sub { font-size: 12px; color: var(--muted); }

.shop-group { margin-bottom: 20px; }
.shop-group h4 {
  font-family: var(--font-display); font-size: 17px; font-weight: 400; letter-spacing: .16em;
  color: var(--gold-bright); margin: 0 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line-soft);
}
.shop-item { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,.05); align-items: flex-start; }
.shop-item .si-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.shop-item .si-name { font-size: 15px; color: var(--ivory); }
.shop-item .si-pick { font-size: 12.5px; color: var(--gold-bright); line-height: 1.5; }
.shop-item .si-dishes { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.shop-check { width: 17px; height: 17px; accent-color: var(--gold); margin-top: 4px; }

/* ------------------------------- 表单/设置 ------------------------------- */

.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.form-row label { display: block; font-size: 12px; letter-spacing: .16em; color: var(--muted); margin-bottom: 7px; text-transform: uppercase; }
.form-row input {
  width: 100%; padding: 10px 14px; border-radius: 10px; font-size: 15px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line-soft); color: var(--ivory); outline: none;
}
.form-row input:focus { border-color: var(--gold); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ------------------------------- 登录闸门 ------------------------------- */

.gate {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; background: var(--ink); padding: 20px;
}
.gate.open { display: flex; }
.gate-card { width: 100%; max-width: 380px; text-align: center; }
.gate-card .g-cn { font-family: var(--font-display); font-size: 34px; letter-spacing: .24em; }
.gate-card .g-latin { font-family: var(--font-latin); font-size: 11px; letter-spacing: .44em; color: var(--gold); text-transform: uppercase; margin: 8px 0 26px; }
.gate-card input {
  width: 100%; padding: 13px 16px; text-align: center; letter-spacing: .3em; font-size: 17px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 11px; color: var(--ivory); outline: none;
}
.gate-card input:focus { border-color: var(--gold); }
.gate-card .err { color: #e79c92; font-size: 13px; min-height: 20px; margin-top: 10px; }

/* ------------------------------- 提示条 ------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px); z-index: 300;
  padding: 12px 26px; border-radius: 999px; font-size: 14px; letter-spacing: .1em;
  background: rgba(24,24,28,.96); border: 1px solid var(--gold); color: var(--gold-bright);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------- 安装到主屏引导条 --------------------------- */

.install-hint {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 130%); z-index: 250;
  width: calc(100% - 28px); max-width: 520px;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(28,28,34,.98), rgba(20,20,24,.98));
  border: 1px solid var(--gold); box-shadow: var(--shadow);
  transition: transform .45s cubic-bezier(.2,.8,.3,1);
}
.install-hint.show { transform: translate(-50%, 0); }
.install-hint .ih-text { flex: 1; font-size: 13.5px; line-height: 1.6; color: var(--ivory-dim); }
.install-hint .ih-text b { color: var(--gold-bright); font-weight: 600; }
.install-hint .ih-close {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line-soft); color: var(--muted); font-size: 14px;
}
.install-hint .ih-close:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ------------------------------- 出错页 ------------------------------- */

.fatal {
  position: fixed; inset: 0; z-index: 400; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(12, 12, 14, .97);
}
.fatal.show { display: flex; }
.fatal-card { max-width: 430px; text-align: center; }
.fatal-card .fc-cn { font-family: var(--font-display); font-size: 33px; letter-spacing: .2em; color: var(--ivory); }
.fatal-card .fc-latin { font-family: var(--font-latin); font-size: 11px; letter-spacing: .42em; text-transform: uppercase; color: var(--gold); margin: 10px 0 22px; }
.fatal-card .fc-msg { color: #e79c92; font-size: 14px; line-height: 1.75; word-break: break-all; }
.fatal-card .fc-tip { color: var(--muted); font-size: 13px; line-height: 1.75; margin: 12px 0 22px; }

/* ------------------------------- 页脚 ------------------------------- */

.foot {
  text-align: center; padding: 40px 18px 60px; color: var(--muted); font-size: 12px; letter-spacing: .16em;
}
.foot .f-latin { font-family: var(--font-latin); letter-spacing: .4em; text-transform: uppercase; color: var(--line); }

/* ------------------------------- 手机适配 ------------------------------- */

@media (max-width: 720px) {
  .topbar-inner { padding: 11px 14px 8px; gap: 10px; }
  .brand-cn { font-size: 21px; letter-spacing: .1em; }
  .brand-latin { display: none; }
  .tabs { width: 100%; margin-left: 0; justify-content: space-between; }
  .tab { padding: 8px 10px; font-size: 13px; }
  main { padding: 18px 13px 80px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card-name { font-size: 18px; }
  .card-tagline { display: none; }
  .card-body { padding: 11px 12px 12px; gap: 6px; }
  .modal-body { padding: 20px 17px 28px; }
  .modal-hero { aspect-ratio: 16 / 10; }
  .modal-hero .mh-text { left: 18px; right: 18px; bottom: 14px; }
  .order-item { padding: 11px 12px; gap: 11px; }
  .oi-thumb { width: 48px; height: 48px; flex-basis: 48px; }
  .hero { padding: 18px 4px 24px; }
  .hero-stats { gap: 22px; }
  .filter-label { min-width: 100%; }
  .ing-table th.th-thumb, .ing-table td.td-thumb { width: 46px; padding-right: 8px; }
  .ing-thumb { width: 38px; height: 38px; }
}

/* -------- iOS 装到主屏后（刘海屏 / 底部横条）留出安全区（放在最后以覆盖上面） -------- */

@supports (padding: env(safe-area-inset-top)) {
  .topbar-inner {
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-left: calc(18px + env(safe-area-inset-left));
    padding-right: calc(18px + env(safe-area-inset-right));
  }
  main {
    padding-left: calc(18px + env(safe-area-inset-left));
    padding-right: calc(18px + env(safe-area-inset-right));
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }
  .install-hint { bottom: calc(20px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(34px + env(safe-area-inset-bottom)); }
  .modal { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}
