/* 共用樣式:賣家總覽(index.html)與個人訂單備份(orders.html)。只做淺色。 */
:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --card: #ffffff;
  --ink: #232a33;
  --muted: #6b7684;
  --line: #e3e8ef;
  --head: #eaf1fa;
  --accent: #2a6fb5;
  --accent-soft: #e3effb;
  --ok: #1f7a4d;
  --ok-soft: #e1f3e9;
  --warn: #a15c07;
  --warn-soft: #fdf0d8;
  --danger: #b3261e;
  --font: "Noto Sans TC", "Noto Sans JP", "Hiragino Sans", "PingFang TC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font);
  padding-block: 20px 40px;
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
h1 { font-size: 21px; line-height: 1.3; margin: 0; text-wrap: balance; }
h2 { font-size: 16px; margin: 0 0 8px; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.facts { margin: 0; padding-left: 18px; font-size: 14px; }
.facts li { margin: 2px 0; }

/* 摘要數字 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; line-height: 1.25; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; white-space: nowrap; display: inline-block; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* 表格(用 grid,手機也不爆版) */
.tbl { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tbl .grp { background: var(--head); padding: 8px 12px; font-weight: 700; font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; }
.tbl .grp span:last-child { font-weight: 500; color: var(--muted); font-size: 12.5px; text-align: right; }
.row { display: grid; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.row.head { background: #f4f7fb; border-top: 0; font-size: 12px; color: var(--muted); padding-block: 6px; }
.cols-merged { grid-template-columns: 80px 1fr 34px 34px 40px 70px; }
.cols-order { grid-template-columns: 80px 1fr 40px 74px; }
.row .num { text-align: right; font-variant-numeric: tabular-nums; }
.row .c { text-align: center; font-variant-numeric: tabular-nums; }
.row .zero { color: #b9c1cc; }
.thumb { width: 80px; height: 80px; border-radius: 8px; background: #eef1f5; object-fit: cover; display: block; }
.ph { width: 80px; height: 80px; border-radius: 8px; border: 1px dashed #b9c1cc; color: var(--muted); font-size: 11px; line-height: 1.2; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px; }
.nm { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.nm small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 700; vertical-align: 1px; white-space: nowrap; }
.total { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 2px solid var(--line); font-weight: 700; background: #fbfcfe; flex-wrap: wrap; }

/* 分頁 */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 500; padding: 7px 16px; border-radius: 99px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

main { display: flex; flex-direction: column; gap: 14px; }
.note { font-size: 13px; color: var(--muted); margin: 0; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 7px 8px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.cmp th:first-child, .cmp td:first-child { text-align: left; }
.cmp thead th { border-top: 0; background: var(--head); font-size: 12.5px; color: var(--muted); font-weight: 500; }
.cmp tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.checks { margin: 0; padding-left: 18px; font-size: 14px; }
@media (max-width: 420px) {
  body { font-size: 14.5px; }
  .cols-merged { grid-template-columns: 80px 1fr 26px 26px 30px 58px; gap: 5px; padding-inline: 8px; }
  .cols-order { grid-template-columns: 80px 1fr 30px 62px; gap: 8px; padding-inline: 8px; }
}

/* 可點縮圖 + 官網按鈕 */
.thumb-btn { all: unset; display: block; width: 80px; height: 80px; border-radius: 8px; cursor: zoom-in; }
.thumb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb-btn:hover .thumb { box-shadow: 0 0 0 2px var(--accent-soft); }
.go { display: inline-block; margin-top: 0; padding: 0 8px; vertical-align: 1px; border: 1px solid var(--accent); border-radius: 99px; color: var(--accent); background: var(--card); font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; line-height: 1.6; }
.go:hover { background: var(--accent-soft); }
.go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row.head small { display: block; font-size: 10.5px; line-height: 1.2; }
.yen-note { font-weight: 400; font-size: .85em; color: var(--muted); white-space: nowrap; }

/* 大圖視窗(沿用 Sanrio_Shopping_List,配色改本頁) */
.lb { position: fixed; inset: 0; z-index: 20; background: rgba(18, 26, 38, .93); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding-top: calc(92px + env(safe-area-inset-top, 0px)); padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); touch-action: pan-y; }
.lb-stage { width: min(100%, 560px); aspect-ratio: 1; flex: 0 1 auto; min-height: 0; overflow: hidden; background: #fff; border-radius: 10px; }
.lb-img { display: block; width: 100%; height: 100%; object-fit: contain; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.lb-info { width: min(100%, 560px); display: flex; flex-direction: column; gap: 10px; }
.lb-cap { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; width: 100%; color: #eef3f9; text-align: left; font-size: 17px; line-height: 1.4; }
.lb-l { flex: 1 1 0; min-width: 0; }
.lb-r { flex: 0 1 auto; min-width: 0; max-width: 58%; text-align: right; }
.lb-cap .ja { font-size: 14.5px; color: #a9b6c6; }
.lb-price { font-size: 16px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.lb-sub { font-size: 13px; color: #a9b6c6; font-variant-numeric: tabular-nums; }
.lb-link { display: inline-block; margin-top: 2px; padding: 6px 0; font-size: 15px; color: #8cc4ff; text-decoration: underline; }
.lb-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-count { color: #8cc4ff; font-size: 13px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.lb-btn { all: unset; position: absolute; width: 44px; height: 44px; border-radius: 22px; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; line-height: 44px; text-align: center; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.26); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-close { top: calc(24px + env(safe-area-inset-top, 0px)); right: max(24px, env(safe-area-inset-right, 0px)); }
.lb-nav { display: flex; align-items: center; justify-content: center; gap: 20px; }
.lb-prev, .lb-next { position: static; flex: 0 0 auto; }
@media (min-width: 760px) {
  .lb-prev, .lb-next { position: absolute; top: 50%; margin-top: -22px; }
  .lb-prev { left: max(16px, env(safe-area-inset-left, 0px)); }
  .lb-next { right: max(16px, env(safe-area-inset-right, 0px)); }
}
@media (max-height: 480px) and (orientation: landscape) {
  .lb { flex-direction: row; gap: 20px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); padding-right: calc(92px + env(safe-area-inset-right, 0px)); }
  .lb-stage { height: 100%; width: auto; max-width: 46%; }
  .lb-info { width: auto; flex: 1 1 0; max-width: 380px; }
  .lb-prev, .lb-next { position: static; margin-top: 0; }
}

/* 整列可點(開官網);網址小字一行,過長截斷 */
.row.link { cursor: pointer; }
.row.link:hover { background: #f5f9fe; }
.nm .url { color: #8a96a5; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.nm { min-width: 0; }

/* 字級配合 80px 商品圖重新配置(12/2) */
h1 { font-size: 25px; }
h2 { font-size: 18px; margin-bottom: 10px; }
.tbl .grp { font-size: 14.5px; padding-block: 9px; }
.tbl .grp span:last-child { font-size: 13.5px; }
.row { gap: 12px; padding-block: 10px; }
.row.head { font-size: 13px; }
.nm { font-size: 17px; line-height: 1.35; }
.nm small { font-size: 14px; margin-top: 3px; line-height: 1.3; }
.nm .url { font-size: 13px; margin-top: 3px; }
.row .num, .row .c { font-size: 17px; }
.tag { font-size: 12px; padding: 1px 7px; vertical-align: 2px; }
.total { font-size: 17px; padding-block: 12px; }
.stat .v { font-size: 26px; }
.facts { font-size: 15px; }
@media (max-width: 420px) {
  h1 { font-size: 23px; }
  .row { gap: 8px; }
  .row.cols-merged { gap: 5px; }
  .cols-merged .num, .cols-merged .c { font-size: 15px; }
  .nm { font-size: 16px; }
  .nm small { font-size: 13px; }
  .nm .url { font-size: 12px; }
  .row .num, .row .c { font-size: 16px; }
  .total { font-size: 16px; }
  .facts { font-size: 14px; }
}

/* 賣家頁:已加入購物車勾選框 + 底部提示條(純勾選,不存資料) */
.cols-check { grid-template-columns: 40px 80px 1fr 40px 74px; }
.chk { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 44px; cursor: pointer; }
.chk input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chk span { width: 24px; height: 24px; border: 2px solid #b6c2d1; border-radius: 6px; background: #fff; display: block; position: relative; }
.chk input:checked + span { background: var(--ok); border-color: var(--ok); }
.chk input:checked + span::after { content: ""; position: absolute; left: 6px; top: 1px; width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.chk input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.row.done { background: #f0f9f4; }
.row.done.link:hover { background: #e6f4ec; }
body:has(.cart-bar) { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.cart-bar { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 10px; padding: 11px 22px; border-radius: 99px; background: #232a33; color: #fff;
  font-size: 16px; font-weight: 500; white-space: nowrap; box-shadow: 0 6px 20px rgba(20, 30, 45, .25); font-variant-numeric: tabular-nums; }
.cart-bar b { font-size: 20px; color: #8cc4ff; }
.cart-bar small { font-size: 13px; color: rgba(255,255,255,.8); font-weight: 400; }
.cart-bar.all { background: var(--ok); }
@media (max-width: 420px) {
  .cols-check { grid-template-columns: 30px 80px 1fr 30px 62px; gap: 6px; }
  .chk { width: 30px; }
}
.row.head .c, .row.head .num { font-size: 13px; white-space: nowrap; }
.row.head .sm { display: none; }
@media (max-width: 420px) { .row.head .lg { display: none; } .row.head .sm { display: inline; font-size: 15px; } }
