/* AI 货架 — 白底漫画风：深蓝粗描边 / 淡紫硬阴影 / 粉色点缀 / 网点纸底 / 荧光笔标题 */
:root {
  --ink: #1d1a4a;
  --soft: #b8b3ff;
  --pri: #8f8df7;
  --acc: #ff5fa8;
  --paper: #f6f5ff;
  --card: #ffffff;
  --dim: #6f6a9e;
  --bw: 3px;
  --r: 15px;
  --sh: 6px 7px 0 var(--soft);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(#d9d5ff 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--pri); }
button { font-family: inherit; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.muted { color: var(--dim); font-size: 13px; }
.center { text-align: center; }

/* ---------- layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 14px 90px; }
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--paper);
  border-bottom: var(--bw) solid var(--ink);
}
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 8px 14px; display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; font-style: italic; flex-shrink: 0; }
.logo-badge {
  background: var(--ink); color: #fff; border-radius: 10px; padding: 7px 10px;
  font-style: normal; font-size: 16px; box-shadow: 4px 4px 0 var(--soft); letter-spacing: 1px;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chip {
  white-space: nowrap; border: var(--bw) solid var(--ink); border-radius: 999px; background: #fff;
  padding: 6px 12px; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 3px 3px 0 var(--soft);
}
.chip.static { cursor: default; }
.btn {
  white-space: nowrap; border: var(--bw) solid var(--ink); border-radius: 12px; background: #fff;
  padding: 8px 14px; font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: 3px 3px 0 var(--soft);
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--soft); }
.btn.acc { background: var(--acc); color: #fff; }
.btn.ink { background: var(--ink); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.navrow { max-width: 1080px; margin: 0 auto; padding: 0 14px 8px; }
.hscroll { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }

/* ---------- headings ---------- */
.hl {
  display: inline; font-weight: 900;
  background: linear-gradient(transparent 55%, #ffd3e8 55%, #ffd3e8 92%, transparent 92%);
  padding: 0 4px;
}
h1.page-title { font-size: 30px; margin: 22px 0 6px; font-weight: 900; }
h2.sec { font-size: 20px; margin: 26px 0 12px; font-weight: 900; }
.announce {
  border: var(--bw) solid var(--ink); border-radius: var(--r); background: #fff8fc;
  box-shadow: var(--sh); padding: 12px 16px; margin: 16px 0 4px; font-size: 14px; line-height: 1.6;
}

/* ---------- cards / grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 16px; }
.card {
  background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--r);
  box-shadow: var(--sh); padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.card h3 { margin: 0; font-size: 17px; line-height: 1.35; }
.price { font-size: 22px; font-weight: 900; color: var(--ink); }
.price .orig { font-size: 13px; color: var(--dim); text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 8px; background: #efeaff; font-weight: 700; }
.tag.pink { background: #ffe0ef; }
.stock { font-size: 12px; color: var(--dim); }
.card .spacer { flex: 1; }

/* ---------- forms ---------- */
.field { margin: 12px 0; }
.field label { display: block; font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.inp, .sel, .txta {
  width: 100%; border: var(--bw) solid var(--ink); border-radius: 12px; background: #fff;
  padding: 10px 12px; font-size: 15px; font-family: inherit; color: var(--ink);
}
.txta { min-height: 76px; resize: vertical; }
.inp:focus, .sel:focus, .txta:focus { outline: 3px solid var(--soft); }
.panel {
  background: #fff; border: var(--bw) solid var(--ink); border-radius: var(--r);
  box-shadow: var(--sh); padding: 20px; margin-top: 18px;
}
.panel.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.demo-note {
  border: 2.5px dashed var(--pri); border-radius: 12px; background: #efeaff;
  padding: 10px 12px; font-size: 14px; margin: 10px 0; line-height: 1.6;
}
.demo-note b { font-size: 18px; letter-spacing: 2px; }

/* ---------- tables / lists ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { border-bottom: 2px solid #e3e0ff; padding: 8px 6px; text-align: left; vertical-align: top; }
table.tbl th { font-weight: 900; }
.listrow {
  border: var(--bw) solid var(--ink); border-radius: var(--r); background: #fff;
  box-shadow: var(--sh); padding: 14px 16px; margin: 12px 0;
}
.status { font-size: 12px; font-weight: 800; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 9px; background: #efeaff; white-space: nowrap; }
.status.paid { background: #ffe0ef; }
.status.done { background: #d9f7e3; }
.status.cancel { background: #e8e8e8; color: var(--dim); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 16px; }
.statbox { background: #fff; border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); padding: 14px; }
.statbox .num { font-size: 28px; font-weight: 900; }
.statbox .lbl { font-size: 13px; color: var(--dim); }

/* ---------- cart drawer ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(29,26,74,.45); z-index: 80; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 94vw); z-index: 81;
  background: var(--paper); border-left: var(--bw) solid var(--ink);
  padding: 18px; overflow-y: auto; box-shadow: -8px 0 0 rgba(184,179,255,.6);
}
.cartline { display: flex; gap: 10px; align-items: center; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; padding: 10px; margin: 10px 0; }
.cartline .grow { flex: 1; min-width: 0; }

/* ---------- qty stepper (two distinct animations) ---------- */
.stepper { display: inline-flex; align-items: center; gap: 2px; border: var(--bw) solid var(--ink); border-radius: 12px; background: #fff; padding: 2px; position: relative; }
.stepper button {
  position: relative; width: 34px; height: 34px; border: none; border-radius: 9px; background: transparent;
  font-size: 19px; font-weight: 900; color: var(--ink); cursor: pointer; overflow: visible;
}
.stepper .qty { min-width: 30px; text-align: center; font-weight: 900; font-size: 16px; display: inline-block; }
.stepper button:active { background: #efeaff; }
.qty-pop { animation: qtyUp .3s ease; }
.qty-sink { animation: qtyDown .3s ease; }
@keyframes qtyUp { 0% { transform: translateY(4px) scale(.9); color: var(--acc); } 60% { transform: translateY(-3px) scale(1.15); color: var(--acc); } 100% { transform: none; } }
@keyframes qtyDown { 0% { transform: translateY(-3px) scale(1.05); opacity: .6; } 100% { transform: translateY(2px) scale(.92); opacity: .75; } }
.starbit {
  position: absolute; width: 7px; height: 7px; background: var(--acc); pointer-events: none; z-index: 3;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: starOut .34s ease-out forwards;
}
@keyframes starOut { from { transform: translate(0,0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }
.dustbit {
  position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--soft); pointer-events: none; z-index: 3;
  animation: dustIn .32s ease-in forwards;
}
@keyframes dustIn { from { transform: translate(var(--dx), var(--dy)) scale(1); opacity: .85; } to { transform: translate(0,0) scale(.3); opacity: 0; } }

/* ---------- modal ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(29,26,74,.5); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border: var(--bw) solid var(--ink); border-radius: var(--r); box-shadow: var(--sh); max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 22px; }

/* ---------- responsive topbar: mobile two rows ---------- */
@media (max-width: 720px) {
  .topbar-in { flex-wrap: wrap; row-gap: 6px; padding-bottom: 4px; }
  .navrow { padding-bottom: 10px; }
  .logo { font-size: 18px; }
  h1.page-title { font-size: 25px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .price { font-size: 19px; }
}
@media (min-width: 721px) {
  .topbar-in { flex-wrap: nowrap; }
  .navrow { padding: 0 14px 8px; margin-top: -2px; }
}
