/* BESUTO 黑金：近黑底、暖白字；金色只用在品牌字、已選狀態與主要動作 */
:root {
  color-scheme: dark;
  --bg: #09090a;
  --surface: #111113;
  --surface-2: #17171a;
  --line: #2a2a2f;
  --line-gold: rgb(212 175 55 / .32);
  --text: #f3eee4;
  --muted: #aaa397;
  --faint: #5d5951;
  --gold: #d4af37;
  --gold-light: #f2d98b;
  --gold-grad: linear-gradient(135deg, #f7e7a8 0%, #d4af37 36%, #a8841f 64%, #e8c45f 100%);
  --plate: radial-gradient(closest-side, #4a463d, #222125 72%, #19191c); /* 中心亮一點，黑色款才看得出輪廓 */
  --ok: #7fd8a4;
  --bad: #ff8f85;
  --radius: 20px;
  --serif: "Cormorant", "Noto Serif TC", serif;
  --sans: "Montserrat", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --z-header: 20;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 88px; }
body {
  margin: 0;
  font: 16px/1.7 var(--sans);
  /* Cormorant 預設是舊式數字（01 會像 o1）；注意 font 簡寫會把它重設，用簡寫的地方要再寫一次 */
  font-variant-numeric: lining-nums;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 78% -12%, rgb(212 175 55 / .15), transparent 62%),
    radial-gradient(800px 480px at -12% 38%, rgb(212 175 55 / .06), transparent 60%),
    var(--bg);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
::selection { color: #0b0b0c; background: var(--gold-light); }

.muted { color: var(--muted); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.amount { font-variant-numeric: tabular-nums; }
.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 頂欄 ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgb(9 9 10 / .74);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-gold);
}
.brand { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; margin: -9px 0; text-decoration: none; }
.brand-mark {
  font: 700 1.55rem/1 var(--serif); letter-spacing: .28em;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { color: var(--muted); font-size: .82rem; letter-spacing: .24em; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  font-weight: 700; color: #0b0b0c; background: var(--gold-grad);
}
.who-name { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
/* 手機：頂欄維持一行，名字與按鈕文字收起來，按鈕只留圖示 */
@media (max-width: 639px) {
  .brand-sub, .who-name, .who .label { display: none; }
  .who .btn-sm { width: 44px; padding: 0; }
}

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 24px;
  border: 1px solid var(--line-gold); border-radius: 999px;
  font: 600 .95rem/1 var(--sans); letter-spacing: .06em; text-decoration: none;
  color: var(--text); background: transparent; cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease),
    box-shadow .25s var(--ease), background-position .5s var(--ease);
}
.btn:hover { color: var(--gold-light); border-color: var(--gold); background-color: rgb(212 175 55 / .06); }
.btn-gold {
  border: 0; color: #0b0b0c; background: var(--gold-grad); background-size: 180% 180%;
  box-shadow: 0 12px 30px -14px rgb(212 175 55 / .7);
}
.btn-gold:hover { color: #0b0b0c; background-position: 100% 50%; box-shadow: 0 16px 38px -14px rgb(212 175 55 / .85); }
.btn-sm { padding: 0 16px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn[aria-busy="true"]::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.icon-btn {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.icon-btn:hover { color: var(--gold-light); background: rgb(212 175 55 / .1); }
/* 文字按鈕用 padding 撐出 44px 觸控範圍，再用負 margin 抵銷，外觀不變 */
.text-btn {
  padding: 12px 6px; margin: -12px -6px; border: 0; background: none; cursor: pointer;
  font: 500 .85rem var(--sans); letter-spacing: .04em; color: var(--gold-light);
  text-decoration: underline; text-underline-offset: 4px;
}

/* ---------- 版面與區塊 ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 72px; }
.panel {
  position: relative; margin-top: 28px; padding: clamp(20px, 3.2vw, 38px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgb(255 255 255 / .025), transparent 140px), var(--surface);
  box-shadow: 0 40px 70px -50px rgb(0 0 0 / .9), inset 0 1px 0 rgb(255 255 255 / .04);
}
.panel::before {
  content: ""; position: absolute; top: -1px; left: 28px; right: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .55;
}
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 22px; }
.section-head .index { font: 700 1.05rem/1 var(--serif); font-variant-numeric: lining-nums; letter-spacing: .12em; color: var(--gold); }
.section-head .muted { font-size: .85rem; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 700; letter-spacing: .03em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1vw, 1.95rem); line-height: 1.3; }
h3 { font-size: 1.2rem; line-height: 1.3; }
.eyebrow { margin: 0; font-size: .78rem; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: var(--gold); }
.empty { margin: 0; padding: 22px 0; text-align: center; color: var(--muted); }

/* ---------- 主視覺 ---------- */
.hero { display: grid; gap: 28px; align-items: center; padding: clamp(28px, 6vw, 76px) 0 12px; }
.hero h1 { margin: 14px 0 18px; font-size: clamp(2.2rem, 1.3rem + 3.4vw, 3.8rem); line-height: 1.14; }
.lead { max-width: 32em; margin: 0; color: var(--muted); font-size: 1.05rem; }
.features { display: grid; gap: 14px; margin: 26px 0 0; padding: 0; list-style: none; }
.features li { display: flex; align-items: center; gap: 14px; }
.features svg {
  flex: none; width: 42px; height: 42px; padding: 10px; border-radius: 12px;
  color: var(--gold); background: rgb(212 175 55 / .08); border: 1px solid var(--line-gold);
}
.features b { display: block; font-weight: 600; }
.features span { color: var(--muted); font-size: .9rem; }
.price-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; margin-top: 30px; }
.price { display: flex; align-items: baseline; gap: 10px; }
.price span { color: var(--muted); font-size: .85rem; letter-spacing: .24em; }
.price b {
  font: 700 clamp(2.8rem, 2.1rem + 2.2vw, 3.6rem)/1 var(--serif); font-variant-numeric: lining-nums;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.price small { color: var(--muted); }
.hero-visual { position: relative; order: -1; }
.hero-visual::before {
  content: ""; position: absolute; inset: 0 6%;
  background: radial-gradient(closest-side, rgb(212 175 55 / .3), rgb(212 175 55 / .07) 62%, transparent);
}
.hero-visual::after {
  content: ""; position: absolute; left: 14%; right: 14%; bottom: -6%; height: 34px;
  background: radial-gradient(closest-side, rgb(212 175 55 / .28), transparent);
}
.hero-visual img { position: relative; z-index: 1; width: 100%; filter: drop-shadow(0 28px 36px rgb(0 0 0 / .65)); }
@media (min-width: 880px) {
  .hero { grid-template-columns: 1fr 1.08fr; }
  .hero-visual { order: 0; }
}

/* ---------- 商品細節 ---------- */
/* 六欄：第一排三分、四分合照各佔一半，第二排三張細節圖各佔三分之一 */
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.shot {
  position: relative; overflow: hidden; grid-column: span 2; aspect-ratio: 1; padding: 0;
  border: 1px solid var(--line); border-radius: 16px; background: var(--plate); cursor: zoom-in;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .3s var(--ease); }
/* 淘寶的白底說明圖在黑頁面上太亮：平常調暗，滑過或聚焦再恢復 */
.shot:not(.cutout) img { filter: brightness(.72) saturate(.9); }
.shot.wide { grid-column: span 3; aspect-ratio: 16 / 9; }
.shot.cutout img { object-fit: contain; padding: 16px 16px 46px; } /* 底部留給說明文字，褲子不被蓋到 */
.shot:hover, .shot:focus-visible { border-color: var(--gold); box-shadow: 0 18px 40px -24px rgb(212 175 55 / .6); }
.shot:hover img, .shot:focus-visible img { transform: scale(1.05); filter: none; }
.shot span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px;
  font: 600 .95rem/1.3 var(--sans); text-align: left; color: var(--text);
  background: linear-gradient(transparent, rgb(9 9 10 / .94));
}
@media (max-width: 639px) {
  .gallery { gap: 10px; }
  .shot.wide { grid-column: span 6; }
  .shot span { padding: 28px 10px 10px; font-size: .85rem; }
}
.lightbox {
  max-width: min(94vw, 920px); max-height: 94vh; padding: 0; overflow: hidden;
  border: 1px solid var(--line-gold); border-radius: 16px; background: var(--surface); color: var(--text);
}
.lightbox::backdrop { background: rgb(0 0 0 / .82); backdrop-filter: blur(4px); }
.lightbox img { max-height: 88vh; margin: 0 auto; background: var(--plate); } /* 去背圖要有亮一點的底，黑色款才看得到 */
.lightbox .close { position: absolute; top: 8px; right: 8px; color: var(--text); background: rgb(9 9 10 / .7); }

/* ---------- 登入 ---------- */
.login { display: grid; justify-items: start; gap: 16px; }
/* 頁面是深色配色，Google 按鈕的 iframe 是淺色，配色不同時瀏覽器會補一塊白底；讓容器也用淺色就會是透明的 */
#gbtn { color-scheme: light; }
.login p { margin: 0; }
.dev-login {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 16px; border: 1px dashed var(--line-gold); border-radius: 14px;
  color: var(--muted); font-size: .9rem;
}

/* ---------- 選購 ---------- */
.shop { display: grid; gap: 28px; align-items: start; }
@media (min-width: 960px) {
  .shop { grid-template-columns: minmax(0, 1fr) 340px; }
  .cart { position: sticky; top: 96px; }
}
fieldset { margin: 0 0 28px; padding: 0; border: 0; min-width: 0; }
legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 12px; padding: 0; font-weight: 600; font-size: 1.05rem; }
.step { font: 700 .95rem/1 var(--serif); font-variant-numeric: lining-nums; letter-spacing: .16em; color: var(--gold); }
.hint { margin: -4px 0 12px; color: var(--muted); font-size: .88rem; }
.choices { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.choices.sizes { grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 640px) { .choices.products { grid-template-columns: repeat(4, 1fr); } }
.choice { position: relative; display: block; cursor: pointer; }
/* input 透明鋪滿卡片：保留鍵盤操作，必填提示也對準整張卡；點擊交給外層 label */
.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; pointer-events: none; }
.choice .card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%;
  padding: 10px 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2);
  text-align: center;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.choice .img { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--plate); }
.choice .img img { max-width: 94%; max-height: 88%; object-fit: contain; filter: drop-shadow(0 10px 12px rgb(0 0 0 / .55)); }
.choice .name { font-weight: 500; font-size: .92rem; }
.sizes .card { gap: 2px; padding: 12px 4px; }
.sizes .card b { font-weight: 600; font-size: 1.05rem; letter-spacing: .04em; }
.sizes .card small { color: var(--muted); font-size: .7rem; }
.choice:hover .card { border-color: var(--line-gold); background-color: #1b1b1f; }
.choice input:checked + .card {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgb(212 175 55 / .14), rgb(212 175 55 / .02)), var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--gold), 0 14px 32px -18px rgb(212 175 55 / .6);
}
.choice input:checked + .card b,
.choice input:checked + .card .name { color: var(--gold-light); }
.choice input:focus-visible + .card { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.check {
  position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; color: #0b0b0c; background: var(--gold-grad);
  opacity: 0; transform: scale(.5); transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.check svg { width: 14px; height: 14px; }
.choice input:checked + .card .check { opacity: 1; transform: none; }
.qty-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.stepper:has(input:focus-visible) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.stepper input {
  width: 3.4em; height: 44px; border: 0; background: transparent; color: var(--text);
  font: 600 1.1rem var(--sans); text-align: center; -moz-appearance: textfield; appearance: textfield;
}
.stepper input:focus-visible { outline: none; }
.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }

.cart {
  padding: 24px; border: 1px solid var(--line-gold); border-radius: 18px;
  background: linear-gradient(180deg, rgb(212 175 55 / .09), transparent 160px), var(--surface-2);
}
.cart h3 { margin-bottom: 8px; }
.lines { margin: 0; padding: 0; list-style: none; }
.lines li {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px dashed var(--line);
}
.thumb { width: 54px; height: 42px; padding: 4px; object-fit: contain; border-radius: 10px; background: var(--plate); }
.lines b { display: block; font-weight: 600; font-size: .92rem; }
.lines .meta { color: var(--muted); font-size: .85rem; }
.total { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0; color: var(--muted); }
.total b {
  font: 700 2.1rem/1 var(--serif); font-variant-numeric: lining-nums;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
#shopMsg { margin: 14px 0 0; }
#shopMsg:empty { display: none; }

/* ---------- 我的訂單 ---------- */
.orders { display: grid; gap: 14px; }
@media (min-width: 760px) { .orders { grid-template-columns: repeat(2, 1fr); } }
.orders .empty { grid-column: 1 / -1; }
.order {
  padding: 18px 20px; border: 1px solid var(--line); border-left: 2px solid var(--gold); border-radius: 14px;
  background: var(--surface-2);
}
.order-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.order-no { font: 700 1.35rem/1 var(--serif); color: var(--gold-light); font-variant-numeric: lining-nums; }
.order time { color: var(--muted); font-size: .85rem; }
.order ul { margin: 0 0 10px; padding: 0; list-style: none; }
.order li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; color: var(--muted); font-size: .92rem; }
.order-foot { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px dashed var(--line); font-weight: 600; }

/* ---------- 頁尾 ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px;
  max-width: 1120px; margin: 0 auto; padding: 26px clamp(16px, 4vw, 40px) 40px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem;
}
.site-footer .brand-mark { font-size: 1.1rem; }
.legal-links { display: flex; gap: 4px 18px; }
.legal-links a { color: var(--muted); text-decoration: none; padding: 12px 0; margin: -12px 0; } /* 撐出 44px 觸控範圍 */
.legal-links a:hover { color: var(--gold-light); }

/* ---------- 政策頁 ---------- */
.prose { max-width: 780px; margin-left: auto; margin-right: auto; }
.prose h1 { margin: 10px 0 4px; font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem); line-height: 1.25; }
.prose h2 { margin: 30px 0 8px; font-size: 1.2rem; color: var(--gold-light); }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0; padding-left: 1.3em; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--gold); }
.prose a { color: var(--gold-light); text-underline-offset: 3px; }
.prose .updated { color: var(--muted); font-size: .9rem; }

/* ---------- 後台 ---------- */
.page-title { padding: clamp(24px, 4vw, 48px) 0 4px; }
.page-title h1 { margin-top: 10px; font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); line-height: 1.2; }
.notice { margin-top: 24px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 24px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi small { display: block; margin-top: 2px; color: var(--muted); font-size: .85rem; }
.kpi { position: relative; overflow: hidden; padding: 20px 22px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.kpi::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gold-grad); }
.kpi span { color: var(--muted); font-size: .88rem; letter-spacing: .06em; }
.kpi b { display: block; margin-top: 6px; font: 600 clamp(1.7rem, 1.3rem + 1.2vw, 2.3rem)/1.15 var(--sans); }
.form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 12px; }
.money-input {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 18px; min-height: 48px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2);
  font: 600 1.15rem var(--sans); color: var(--gold-light);
}
.money-input:has(input:focus-visible) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.money-input input { width: 6em; border: 0; background: transparent; color: var(--text); font: inherit; }
.money-input input:focus-visible { outline: none; }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
thead th {
  font-size: .78rem; font-weight: 600; letter-spacing: .12em; color: var(--gold);
  background: #141417; border-bottom-color: var(--line-gold);
}
tbody tr { transition: background-color .15s var(--ease); }
tbody tr:hover { background: rgb(212 175 55 / .05); }
tbody tr:last-child td { border-bottom: 0; }
tfoot th, tfoot td { border-top: 1px solid var(--line-gold); border-bottom: 0; color: var(--gold-light); font-weight: 600; background: rgb(212 175 55 / .07); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.zero { color: var(--faint); }
td.wrap { min-width: 12em; white-space: normal; }

/* ---------- 收款狀態與訂單操作 ---------- */
.badge {
  display: inline-block; padding: 1px 10px; border: 1px solid var(--line-gold); border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--gold-light); vertical-align: middle;
}
.badge.ok { color: var(--ok); border-color: rgb(127 216 164 / .45); }
td small { display: block; color: var(--muted); font-size: .78rem; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 9.5em; }
.order .btn { margin-top: 12px; }
.last5 {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
}
.last5 label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.last5 input {
  width: 6.2em; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); font: 600 1rem var(--sans); letter-spacing: .18em;
}
.last5 input:invalid:not(:placeholder-shown) { border-color: var(--bad); }
.last5 .btn { margin-top: 0; }
.last5 small { color: var(--ok); font-size: .8rem; }
.last5-done { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.last5-code { color: var(--gold-light); letter-spacing: .12em; }
.transfer .muted { margin: 8px 0 0; font-size: .85rem; }
.transfer {
  margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--line-gold); border-radius: 14px;
  background: linear-gradient(180deg, rgb(212 175 55 / .08), transparent), var(--surface-2);
}
.pre { margin: 6px 0 0; white-space: pre-wrap; }
#ordersMsg { margin: 0 0 14px; }
#ordersMsg:empty { display: none; }
textarea {
  display: block; width: 100%; min-height: 120px; margin-bottom: 12px; padding: 12px 14px; resize: vertical;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit;
}
textarea::placeholder { color: var(--faint); }
.btn-danger { color: var(--bad); border-color: rgb(255 143 133 / .45); }
.btn-danger:hover { color: #0b0b0c; background: var(--bad); border-color: var(--bad); }

/* ---------- 取貨方式 ---------- */
.pickup { margin: 16px 0 0; }
.pickup legend { font-size: .95rem; }
.pickup-choices { display: grid; gap: 8px; }
.pick { position: relative; display: block; cursor: pointer; }
.pick input { position: absolute; inset: 0; margin: 0; opacity: 0; pointer-events: none; }
.pick span {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 44px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.pick small { color: var(--gold-light); font-weight: 600; }
.pick:hover span { border-color: var(--line-gold); }
.pick input:checked + span { border-color: var(--gold); background: rgb(212 175 55 / .1); box-shadow: inset 0 0 0 1px var(--gold); }
.pick input:focus-visible + span { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.pickup-note { display: grid; gap: 6px; margin-top: 10px; color: var(--muted); font-size: .85rem; }
.ship-fields { display: grid; gap: 10px; margin-top: 10px; }
.ship-fields label { display: grid; gap: 6px; color: var(--muted); font-size: .85rem; }
.ship-fields input {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .95rem;
}
.ship-fields input::placeholder { color: var(--faint); }
.ship-fields input:invalid:not(:placeholder-shown) { border-color: var(--bad); }
.pickup-note textarea { min-height: 72px; margin: 0; }
.totals { margin-top: 16px; }
.totals > div { display: flex; justify-content: space-between; color: var(--muted); font-size: .92rem; }
.totals .total { margin: 6px 0 16px; }
.order-pickup { margin: 8px 0 0; color: var(--muted); font-size: .88rem; }
.order-pickup small { display: block; white-space: pre-wrap; }
#pickupSummary:empty { display: none; }
.kpi small:empty { display: none; }

/* ---------- 修改訂單對話框 ---------- */
.edit-field { display: grid; gap: 6px; margin-top: 14px; color: var(--muted); font-size: .88rem; }
.edit-field select, .edit-field textarea, .edit-field input {
  min-height: 44px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 1rem;
}
.edit-field textarea { min-height: 72px; }
.editor {
  width: min(94vw, 580px); padding: 24px; border: 1px solid var(--line-gold); border-radius: 18px;
  background: var(--surface); color: var(--text);
}
.editor::backdrop { background: rgb(0 0 0 / .78); backdrop-filter: blur(3px); }
.editor p { margin: 6px 0 0; }
.edit-lines { display: grid; gap: 10px; margin: 18px 0 10px; padding: 0; list-style: none; }
.edit-lines li { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) 4.6em 44px; gap: 8px; align-items: center; }
.edit-lines select, .edit-lines input {
  min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--text); font: inherit;
}
@media (max-width: 520px) {
  .edit-lines li { grid-template-columns: minmax(0, 1fr) 4.6em 44px; }
  .edit-lines li [data-k="product"] { grid-column: 1 / -1; }
}
.editor [data-msg]:empty { display: none; }
.editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.editor-actions [data-delete] { margin-right: auto; }

/* ---------- 後台緊湊版面 ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.admin main { max-width: 1320px; padding-bottom: 48px; }
.admin .kpis { grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
@media (min-width: 1100px) { .admin .kpis { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 480px) { .admin .kpi { padding: 10px 12px; } #orderSearch { flex: 1; width: auto; } }
.admin .kpi { padding: 12px 16px; border-radius: 14px; }
.admin .kpi span { font-size: .8rem; }
.admin .kpi b { margin-top: 2px; font-size: clamp(1.25rem, 1rem + .7vw, 1.6rem); }
.admin .kpi small { font-size: .78rem; }
.panel.compact { margin-top: 16px; padding: 18px 20px; border-radius: 16px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 12px; }
.panel-head h2, .settings h2 { font-size: 1.15rem; }
.panel-head .muted { font-size: .85rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.chips { display: flex; gap: 6px; }
.chip {
  min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); font: 500 .85rem var(--sans); cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.chip:hover { color: var(--gold-light); border-color: var(--line-gold); }
.chip[aria-pressed="true"] { color: #0b0b0c; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.chip span { margin-left: 6px; font-variant-numeric: tabular-nums; opacity: .8; }
#orderSearch {
  width: 15em; min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .85rem;
}
#orderSearch::placeholder { color: var(--faint); }
.panel.compact #ordersMsg { margin: -4px 0 10px; }
table.dense { font-size: .88rem; }
table.dense th, table.dense td { padding: 8px 10px; }
table.dense td.wrap { min-width: 14em; }
.dense .actions { flex-wrap: nowrap; min-width: 0; }
.dense .btn-sm, .settings .btn-sm { min-height: 32px; padding: 0 12px; font-size: .8rem; }
.settings { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) { .settings { grid-template-columns: 1fr 1.6fr 1fr; align-items: stretch; } }
.settings .panel { margin-top: 0; }
.settings h2 { margin-bottom: 12px; }
.settings h2 span { margin-left: 6px; font: 600 .8rem var(--sans); }
.settings p { margin: 8px 0 0; font-size: .85rem; }
.settings p:empty { display: none; }
.settings .form-row { margin-bottom: 0; }
.settings textarea { min-height: 96px; margin-bottom: 10px; font-size: .92rem; }
.settings .money-input { min-height: 40px; font-size: 1.05rem; }
/* 觸控裝置維持 44px 觸控範圍 */
@media (pointer: coarse) {
  .chip, #orderSearch, .dense .btn-sm, .settings .btn-sm { min-height: 44px; }
}

/* ---------- 動態 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero-copy, .hero-visual, .panel, .kpis { animation: rise .8s var(--ease) both; }
  .hero-visual { animation-delay: .1s; }
  .panel { animation-delay: .15s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
