/* Same look as gekiyasu-dong.com / deals: cream paper, ink outlines, acid accents. */
:root {
  --ink: #262220; --muted: #6d665c; --soft: #8f887c; --paper: #fffdf8; --cream: #f7f2e8; --sand: #efe3cc;
  --acid: #e9f73a; --acid-shadow: #c9d24e; --line: #ddd6c8; --coral: #d2553b; --green: #1f7a3d;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "PingFang SC", "Noto Sans SC", Meiryo, Arial, sans-serif;
  --black: "Arial Black", Arial, "Hiragino Sans", "Noto Sans SC", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --gut: 16px;
  --tabs-h: 62px;
  color-scheme: light;  /* always the cream paper look, like the 抽选 page, even in iOS dark mode */
}
* { box-sizing: border-box; }
html { background: var(--cream); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cream); font: 15px/1.55 var(--sans);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 12px); overflow-x: hidden; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) var(--gut) 10px; background: var(--cream); border-bottom: 2px solid var(--ink); }
.logo { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.logo b { font: 950 26px/1 Arial, sans-serif; letter-spacing: -.1em; }
.logo span { font: 700 17px/1 var(--serif); letter-spacing: -.06em; }
.logo i { margin-left: 8px; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--acid);
  color: #262220; font: 900 11px/1.3 var(--sans); font-style: normal; }
.icon-btn { width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper);
  font-size: 19px; font-weight: 900; cursor: pointer; }
.icon-btn.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { padding: 12px var(--gut) 0; max-width: 720px; margin: 0 auto; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--paper); border-top: 2px solid var(--ink); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  text-decoration: none; font: 900 11.5px/1.2 var(--sans); color: var(--muted); }
.tabs a span { font-size: 20px; line-height: 1; }
.tabs a[aria-current] { color: var(--ink); }
.tabs a[aria-current] span { background: var(--acid); color: #262220; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 12px; }

/* chips / pills */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gut)) 12px; padding: 2px var(--gut); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 32px; padding: 3px 13px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper);
  font: 900 12.5px/1.3 var(--sans); cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 16px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none;
  font: 900 13.5px/1.2 var(--sans); cursor: pointer; }
.pill.acid { background: var(--acid); color: #262220; }
.pill.ghost { background: var(--paper); color: var(--ink); }

/* cards */
.card { position: relative; display: block; margin: 0 0 12px; padding: 12px; border: 2px solid var(--ink); border-radius: 18px;
  background: var(--paper); box-shadow: 3px 3px 0 var(--ink); text-decoration: none; }
button.card { width: 100%; text-align: left; cursor: pointer; font: inherit; }
.item { display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.thumb { display: block; width: 64px; height: 64px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; object-fit: contain; }
.parts { margin-top: 6px; }
.thumb.empty { display: grid; place-items: center; font: 900 11px var(--sans); color: var(--soft); background: var(--sand); }
.title { margin: 0; font: 800 14px/1.35 var(--sans); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.meta { margin-top: 3px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.tag { display: inline-block; padding: 0 7px; border: 1.5px solid var(--ink); border-radius: 999px; font: 900 10.5px/1.6 var(--sans); background: var(--paper); }
.tag.amazon { background: #ffd58a; color: #262220; }
.tag.yahoo { background: #ffb3b3; color: #262220; }
.tag.rakuten { background: #ffc2d6; color: #262220; }
.tag.off { background: var(--sand); color: var(--muted); border-color: var(--soft); }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.num { padding: 6px 8px; border-radius: 12px; background: var(--cream); border: 1.5px solid var(--line); min-width: 0; }
.num small { display: block; color: var(--muted); font: 700 10.5px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num b { display: block; font: 900 15px/1.3 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num.profit { background: var(--acid); border-color: var(--ink); color: #262220; }
.num.profit small { color: #4a4636; }
.num.loss { background: var(--sand); }
.num.loss b { color: var(--coral); }
.pos { color: var(--green); }
.neg { color: var(--coral); }

.empty-state { padding: 40px 10px; text-align: center; color: var(--muted); }
.empty-state b { display: block; font: 900 18px/1.3 var(--sans); color: var(--ink); margin-bottom: 6px; }
.err { padding: 12px; border: 2px dashed var(--coral); border-radius: 14px; color: var(--coral); font-weight: 700; }
.small { font-size: 12px; color: var(--muted); }
.h2 { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 8px; font: 900 16px/1.2 var(--sans); }
.h2 small { font: 700 12px var(--sans); color: var(--muted); }
.kicker { margin: 4px 0 10px; font: 950 34px/.9 var(--black); letter-spacing: -.07em; }
.kicker i { color: var(--soft); font-style: normal; font-weight: 400; }

/* search */
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper);
  font-size: 16px; outline: none; }
.search input:focus { box-shadow: 0 0 0 3px var(--acid); }
.search .pill { min-height: 46px; }
.row-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.row-item .r { text-align: right; flex: none; }
.row-item .r b { display: block; font: 900 16px/1.2 var(--sans); }

/* product detail */
.hero { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; padding-right: 34px; }
.hero .thumb { width: 84px; height: 84px; }
.hero h1 { margin: 0; font: 900 16px/1.35 var(--sans); word-break: break-all; }
.big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.big b { font: 950 32px/1 var(--black); letter-spacing: -.04em; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table td { padding: 8px 4px; border-bottom: 1.5px dashed var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.p { text-align: right; font-weight: 900; white-space: nowrap; }
.table tr.dim td { color: var(--soft); }
.table a { text-decoration: none; }
.spark { width: 100%; height: 70px; display: block; }
.spark path.l { fill: none; stroke: var(--ink); stroke-width: 2; }
.spark path.a { fill: var(--acid); opacity: .55; }
.spark text { fill: var(--muted); font: 700 10px var(--sans); }
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.calc label { display: block; font: 700 12px var(--sans); color: var(--muted); }
.calc input { width: 100%; height: 42px; margin-top: 3px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); font-size: 16px; }
.calc-out { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--cream); border: 1.5px solid var(--line); font-weight: 800; }
.back { display: inline-flex; margin-bottom: 10px; }
.star { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 2px solid var(--ink); border-radius: 50%;
  background: var(--paper); font-size: 18px; cursor: pointer; }
.star[aria-pressed="true"] { background: var(--acid); color: #262220; }

/* lottery */

/* deals */
.verdict { background: var(--acid); color: #262220; }
.drop { color: var(--coral); font-weight: 900; }
.deal-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.deal-actions .pill { min-height: 34px; padding: 4px 14px; font-size: 12.5px; }

/* embedded iphone18 page */
body.embedded { padding-bottom: 0; }
body.embedded main { max-width: none; padding: 8px 0 0; }
.embed-bar { display: flex; justify-content: space-between; gap: 8px; padding: 0 var(--gut) 8px; }
.embed-bar .pill { min-height: 34px; padding: 4px 14px; font-size: 12.5px; }
.embed { display: block; width: 100%; border: 0; border-top: 2px solid var(--ink); background: #cde9f6; }
.big-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.big-link b { font: 900 16px/1.3 var(--sans); }

/* settings */
.set { display: grid; grid-template-columns: 1fr 90px; gap: 8px 10px; align-items: center; }
.set input { height: 40px; padding: 0 10px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); text-align: right; font-size: 16px; }
.set label { font-weight: 700; font-size: 14px; }
.set label small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.links { display: grid; gap: 10px; }
.pp-words { width: 100%; height: 42px; margin-top: 4px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); font-size: 16px; }

/* scanner */
.scanner { position: fixed; inset: 0; z-index: 20; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: relative; width: min(80vw, 340px); height: 150px; border: 3px solid var(--acid); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); }
.scan-hint { position: relative; color: #fff; font-weight: 800; margin: 18px 0; }
.scanner .pill { position: relative; background: #fff; color: #262220; }

.skeleton { height: 108px; margin-bottom: 12px; border-radius: 18px; background: linear-gradient(90deg, var(--sand), var(--paper), var(--sand)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* 库存 */
.tag.tone-good { background: var(--acid); color: #262220; }
.tag.tone-warn { background: var(--coral); border-color: var(--coral); color: #fff; }
.tag.tone-ok { background: var(--sand); }
.tag.tone-off { background: var(--sand); color: var(--muted); border-color: var(--soft); }
.lots { margin-top: 8px; }
.lots summary { cursor: pointer; font: 800 12.5px var(--sans); color: var(--muted); }
.pp-stock { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13px; font-weight: 700; }
.pp-stock input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: #262220; }
.tabs a { font-size: 11px; }

/* 补货规律 */
.kicker-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kicker-row .pill { min-height: 34px; padding: 4px 14px; font-size: 12.5px; flex: none; }
.pat-line { margin-top: 6px; font-size: 13px; }
.pat-line b { font-weight: 900; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin: 10px 0 4px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; position: relative; }
.bar i { display: block; background: var(--ink); border-radius: 3px 3px 0 0; min-height: 1px; }
.bar span { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font: 700 9px/1.6 var(--sans); color: var(--muted); }
.bars.w7 .bar span { font-size: 11px; }
.bars + .bars { margin-top: 22px; }
.bars.w7 { margin-bottom: 26px; }
.heat { display: grid; gap: 2px; }
.heat-row { display: grid; grid-template-columns: 18px repeat(24, 1fr); gap: 2px; align-items: center; }
.heat-row span { font: 700 11px var(--sans); color: var(--muted); }
.heat-row i { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--ink); }
.heat-head i { background: none; opacity: 1 !important; font: 700 9px var(--sans); color: var(--muted); text-align: center; aspect-ratio: auto; }

/* 周报 */
.row-pills { display: flex; gap: 6px; }
.xhs { white-space: pre-wrap; word-break: break-word; margin: 0; padding: 10px 12px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--cream); font: 13px/1.6 var(--sans); }
.row-item + .row-item { border-top: 1.5px dashed var(--line); padding-top: 8px; margin-top: 8px; }

.account { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.account .who { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; min-width: 0; }
.account .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .who small { grid-column: 2; color: var(--muted, #6b645a); font-size: 12px; }
.account .who b:first-child, .account .who b:first-child + small { grid-column: 1 / -1; }
.account .avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); grid-row: span 2; }
.lot-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lot-actions .pill { min-height: 34px; padding: 4px 14px; font-size: 12.5px; }
.steps { margin: 6px 0 0; padding-left: 20px; } .steps li { margin: 2px 0; }
body.locked .tabs, body.locked #refresh { display: none; }
body.locked { padding-bottom: 24px; }
.locked-card { margin-top: 12vh; }
.locked-card img { display: block; margin: 0 auto 14px; border: 2px solid var(--ink); border-radius: 22px; }
