/* store.css — 深夜便利店（behere.fun 首页专用）
   黑白极简手绘 + 米白纸底（对齐 b/e 子站）+ 暖黄灯光 + 红色小面积点缀。
   角规格统一：小圆角 8px（内框 = 外框 - 边框宽 = 6px），硬阴影无模糊、偏移统一。
   自包含：只被 index.html 引用，不影响 /idea、/admin。 */

/* ---------- Tokens ---------- */
:root {
  --paper: #F4F1E8;
  --paper-2: #EDE8DA;
  --card: #FBF9F2;
  --ink: #211E16;
  --ink-soft: #4A463B;
  --muted: #8B8779;
  --line: #D8D2C1;
  --lamp: #E7B24A;
  --lamp-soft: rgba(231, 178, 74, 0.28);
  --red: #CE4B37;

  --radius: 8px;      /* 外框 */
  --radius-sm: 6px;   /* 内框 = 外框 - 边框宽(2px) */
  --bw: 2px;
  --shadow: 4px 4px 0 var(--ink);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", "Courier New", monospace;
}

/* ---------- 深色模式：关灯后的同一家店（暗纸底 + 纸白墨线 + 更暗灯光），不是黑金霓虹 ---------- */
:root[data-theme="dark"] {
  --paper: #16130E;
  --paper-2: #1E1A13;
  --card: #221D16;
  --ink: #ECE5D6;
  --ink-soft: #B7AF9C;
  --muted: #837C6B;
  --line: #322C22;
  --lamp: #D9A544;
  --lamp-soft: rgba(217, 165, 68, 0.10);
  --red: #E06A57;
  --shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}
/* 无 JS 时的兜底：跟随系统深色 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #16130E;
    --paper-2: #1E1A13;
    --card: #221D16;
    --ink: #ECE5D6;
    --ink-soft: #B7AF9C;
    --muted: #837C6B;
    --line: #322C22;
    --lamp: #D9A544;
    --lamp-soft: rgba(217, 165, 68, 0.10);
    --red: #E06A57;
    --shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--ink); color: var(--paper); }

.arrow { display: inline-block; transition: transform 0.25s ease; }
.product:hover .arrow,
.social-link:hover .arrow,
.cashier-link:hover .arrow { transform: translateX(3px); }

/* ================= 第一屏（紧凑） ================= */
.store-front {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  background: var(--paper);
  overflow: hidden;
}
/* 暖黄灯光：一小片柔光（灯光点缀，非发光字） */
.store-front::before {
  content: "";
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: min(520px, 120%);
  height: 260px;
  background: radial-gradient(closest-side, var(--lamp-soft), rgba(231, 178, 74, 0) 78%);
  pointer-events: none;
  z-index: 0;
}
.store-front > * { position: relative; z-index: 1; }

/* 店招（纸卡手绘，墨色，不发光） */
.signboard {
  text-align: center;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 20px 9px;
  box-shadow: var(--shadow);
}
.store-sign {
  font-size: clamp(1.5rem, 7.2vw, 2.2rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ink);
  line-height: 1.15;
}
.store-sign-sub { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

/* 营业牌 + 营业时间：合并为一行 */
.front-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  max-width: 640px;
}
.status-board {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink);
  border: var(--bw) solid var(--ink);
  background: var(--card);
  padding: 4px 11px;
  border-radius: var(--radius-sm);
}
.blip {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(206, 75, 55, 0.18);
  animation: blip 1.6s ease-in-out infinite;
}
@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.hours { font-size: 11.5px; color: var(--muted); }

/* 店长 + 开场白：并排 */
.front-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 640px;
  width: 100%;
  justify-content: center;
}
.shopkeeper {
  width: 62px;
  height: 62px;
  flex: none;
}
.shopkeeper-img { width: 100%; height: 100%; object-fit: contain; }
.shopkeeper-ph { display: block; width: 100%; height: 100%; color: var(--ink); }
.opening {
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ================= 标签 ================= */
.tag {
  align-self: flex-start;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.tag-onsale { color: var(--ink); border-color: var(--ink); }
.tag-exp { color: #B07C1E; border-color: #B07C1E; }
.tag-half { color: var(--muted); border-color: var(--muted); }
.tag-off { color: var(--red); border-color: var(--red); }
.tag-cashier { color: #1d1a14; border-color: var(--lamp); background: var(--lamp); }

/* ================= 货架 ================= */
.shelves {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 18px 56px;
  border-top: 2px solid var(--line);
}
.shelf { padding: 20px 0 4px; }
.shelf-title {
  display: inline-block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding-bottom: 5px;
  border-bottom: 3px solid var(--ink);
  border-radius: 0;
}
.shelf-sub { margin-top: 9px; font-size: 13px; color: var(--muted); }

.shelf-grid { margin-top: 16px; display: grid; grid-template-columns: 1fr; gap: 14px; }
/* 单张主推（最新上架 / 收银台）：固定单列，不参与多列栅格 */
.shelf-grid.shelf-grid-single { grid-template-columns: 1fr; max-width: 560px; }

/* 最新上架：全店头牌，标题下的线用红色点一下 */
.shelf-latest { padding-top: 12px; }
.shelf-latest .shelf-title { border-bottom-color: var(--red); }

/* 收银台：独立一栏，排在后厨与临期之间（虚线隔开，像柜台） */
.shelf-cashier { border-top: 2px dashed var(--line); margin-top: 14px; padding-top: 18px; }

/* 商品卡 */
.product {
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 12px 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.product:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }

/* 缩略图（统一 4:3，内框半径 = 外框 - 边框） */
.product-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  overflow: hidden;
  position: relative;
}
.product-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: filter 0.35s ease; }
/* 熄灯后：包装轻压一档，别晃眼 */
:root[data-theme="dark"] .product-thumb img { filter: brightness(0.88); }
.product-thumb-ph {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 11px 11px;
  background-position: -1px -1px;
}
.product-thumb-ph::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  transform: translate(-50%, -50%);
  background: var(--ink);
  opacity: 0.16;
}

.product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.product-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.product-marker {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.04em;
  padding: 3px 7px;
  color: var(--paper);
  background: var(--red);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.product-name { font-size: 16px; font-weight: 800; letter-spacing: 0.01em; }
.product-desc { font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); flex: 1; }
.product-link { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.product-soon { cursor: default; }
.product-soon:hover { transform: none; box-shadow: none; }
.product-soon .product-link { color: #B07C1E; }

/* 临期特价区 */
.shelf-clearance { border-top: 2px dashed var(--line); margin-top: 18px; }
.shelf-clearance .shelf-title { border-bottom-color: var(--muted); color: var(--ink-soft); }
.product-clear {
  background: var(--paper-2);
  border-style: dashed;
  border-color: var(--muted);
  color: var(--ink-soft);
}
.product-clear:hover { box-shadow: 4px 4px 0 var(--muted); }
.product-clear .product-name { color: var(--ink-soft); }
.product-clear .product-thumb { border-style: dashed; border-color: var(--muted); filter: grayscale(1); }

/* 关于我 */
.shelf-about { margin-top: 6px; }/* 英文版把「这是谁」放在第一栏：贴住货架区顶端，别顶出一块空 */
.shelves > .shelf-about:first-child { padding-top: 6px; }

/* 人像 + 一句自我介绍 */
.about-hero { margin-top: 18px; display: flex; gap: 16px; align-items: flex-start; max-width: 680px; }
.about-avatar {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.about-hero-text { min-width: 0; }
.about-headline { font-size: 19px; font-weight: 800; line-height: 1.55; letter-spacing: 0.01em; }
.about-role { margin-top: 8px; font-family: var(--mono); font-size: 11.5px; line-height: 1.7; color: var(--muted); }

/* 联系方式（英文版只放邮箱，不放表单） */
.about-contact {
  margin-top: 22px;
  max-width: 560px;
  padding: 16px 16px 18px;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
}
.about-contact-lead { font-size: 14.5px; font-weight: 700; line-height: 1.6; }
.about-email-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--paper);
  background: var(--ink);
  border-radius: var(--radius-sm);
  transition: transform 0.18s ease;
}
.about-email-btn:hover { transform: translate(-1px, -1px); }
.about-email-addr {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  user-select: all;
  word-break: break-all;
}
.about-contact-note { margin-top: 10px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }

/* 事实清单：左标签右内容，像价签（gap 用内边距做，虚线才连成一整条） */
.about-facts {
  margin-top: 22px;
  max-width: 640px;
  display: grid;
  grid-template-columns: 112px 1fr;
  column-gap: 0;
  border-top: 2px solid var(--line);
}
.about-fact-label,
.about-fact-value {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.about-fact-label {
  padding-right: 14px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.about-fact-value { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }

.about-lines { margin-top: 16px; max-width: 640px; display: flex; flex-direction: column; gap: 6px; }
.about-lines p { font-size: 15.5px; line-height: 1.85; }
.about-social { margin-top: 22px; padding-top: 20px; border-top: 2px solid var(--line); max-width: 680px; }
.about-social-lead { font-family: var(--mono); font-size: 12px; color: var(--ink); margin-bottom: 14px; }
.social-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.social-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 8px 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.social-handle { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink); }
.social-link { grid-column: 3; white-space: nowrap; font-size: 12.5px; font-weight: 700; color: var(--red); }

/* 收银台（后厨排末尾一格，与商品卡同宽同高同边框） */
.cashier {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  height: 100%;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 12px 14px;
  font-family: var(--mono);
}
.cashier-slogan { margin-top: 12px; font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.cashier-line { margin-top: 6px; margin-bottom: 14px; font-size: 12.5px; color: var(--ink-soft); }
.cashier-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--paper);
  background: var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

/* ================= 页脚 ================= */
.store-foot { border-top: 2px solid var(--line); text-align: center; padding: 24px 20px 38px; }
.foot-note { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.foot-copy { margin-top: 6px; font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.foot-icp { margin-top: 4px; font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }
.foot-icp a { color: inherit; }
.foot-icp a:hover, .foot-icp a:focus-visible { color: var(--ink-soft); outline: none; }

/* ================= 右上角控制条：语言 + 主题（并排、同尺寸） ================= */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px 0;
}
.top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  height: 34px;
  padding: 0 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 var(--line);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.35s ease;
}
.top-btn:hover, .top-btn:focus-visible { color: var(--ink); border-color: var(--ink); outline: none; }

/* 主题按钮：自动 → 白天 → 夜晚 */
.theme-toggle-label { display: none; }
.theme-toggle::before {
  content: "";
  flex: none;
  width: 9px; height: 9px;
  border: 1.5px solid currentColor;
}
.theme-toggle[data-mode="auto"]::before { background: currentColor; opacity: 0.45; }
.theme-toggle[data-mode="dark"]::before { background: currentColor; }
@media (min-width: 560px) {
  .top-bar { padding-top: 12px; }
  .top-btn { min-width: 76px; padding: 0 11px; }
  .theme-toggle-label { display: inline; }
}

/* ================= 响应式 ================= */
@media (min-width: 560px) {
  .shelf-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .shelf-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .shelves { padding: 20px 28px 80px; }
  .store-front { padding: 30px 28px 22px; gap: 14px; }
  .shopkeeper { width: 72px; height: 72px; }
  .about-avatar { width: 104px; height: 104px; }
  .about-headline { font-size: 21px; }
}
@media (max-width: 480px) {
  .about-hero { gap: 12px; }
  .about-avatar { width: 66px; height: 66px; }
  .about-headline { font-size: 17.5px; line-height: 1.5; }
  .about-facts { grid-template-columns: 92px 1fr; }
  .about-fact-label { padding-right: 12px; }
}
@media (max-width: 360px) {
  .store-sign { font-size: clamp(1.4rem, 7vw, 1.8rem); }
  .shopkeeper { width: 54px; height: 54px; }
  .opening { font-size: 14.5px; }
  .about-hero { flex-direction: column; gap: 10px; }
  .about-facts { grid-template-columns: 1fr; }
  .about-fact-label { border-bottom: 0; padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .blip { animation: none; }
  .product, .arrow { transition: none; }
}
