/* ============================================================
   星辰小铺 · Soft Apple 主题（2026-09-22 design skill 重设计）
   Design Read: 消费者发卡商城, Apple 生态语言 —— 柔和圆角、
   分层灰阶、单一蓝色强调、无衬线、大留白、克制的玻璃顶栏。
   Dials: VARIANCE 4 / MOTION 5 / DENSITY 3（Apple-y premium consumer）
   Shape Lock: 卡片 20px · 控件 12px · 输入 10px（单一体系, 全站一致）
   注: 顶栏毛玻璃为 web 近似实现, 非 Apple 官方 Liquid Glass。
   ============================================================ */
:root {
  --paper: #F5F5F7;            /* Apple 灰白底 */
  --card: #FFFFFF;
  --ink: #1D1D1F;              /* Apple 近黑 */
  --ink-2: #494950;
  --muted: #86868B;            /* Apple 灰 */
  --line: #E8E8ED;
  --line-2: #D2D2D7;
  --accent: #0071E3;           /* Apple 蓝 */
  --accent-2: #0066CC;
  --accent-tint: #F0F7FE;
  --green: #34A853;
  --red: #E30000;
  --orange: #C93400;
  --radius-card: 20px;
  --radius-ctl: 12px;
  --radius-input: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 8px 24px -12px rgba(0,0,0,.10);
  --shadow-lift: 0 2px 6px rgba(0,0,0,.05), 0 16px 40px -16px rgba(0,0,0,.16);
  --ease: cubic-bezier(.25,.1,.25,1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
               "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--paper); color: var(--ink); min-height: 100vh;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 20px 72px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
::selection { background: rgba(0,113,227,.18); }

/* ---------- 顶栏（毛玻璃 web 近似） ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a { padding: 8px 14px; border-radius: 9px; font-size: 14px; color: var(--ink-2); transition: background .2s var(--ease), color .2s var(--ease); }
.nav-links a:hover { background: rgba(0,0,0,.05); color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--accent); font-weight: 600; background: var(--accent-tint); }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(180deg,#3D3D42,#1D1D1F); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }

/* ---------- 首屏 ---------- */
.hero { border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow); padding: 52px 48px 46px; position: relative; overflow: hidden; }
.hero::after {  /* 右侧柔和光斑, 替代装饰印章 */
  content: ""; position: absolute; right: -80px; top: -100px; width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(0,113,227,.14), rgba(100,210,255,.06) 55%, transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 14px; position: relative; }
.hero p { color: var(--ink-2); font-size: 15px; max-width: 560px; line-height: 1.75; position: relative; }
.steps { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; position: relative; }
.step { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); background: var(--paper); padding: 10px 16px; border-radius: var(--radius-ctl); }
.step b { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }

/* ---------- 区块标题 ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 38px 0 18px; gap: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.section-head .live { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- 公告 / 播报 / 统计 ---------- */
.notice-bar { margin-top: 18px; display: none; align-items: baseline; gap: 10px; background: var(--card); box-shadow: var(--shadow); padding: 13px 18px; border-radius: var(--radius-ctl); font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.ticker { margin-top: 12px; display: none; align-items: center; gap: 10px; padding: 10px 18px; font-size: 13px; color: var(--ink-2); background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius-ctl); }
.ticker .ticker-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticker b { color: var(--accent); font-weight: 600; }
.stats-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.stats-band .s-item { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.stats-band .s-item .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-tint); display: grid; place-items: center; font-size: 16px; flex: none; }
.stats-band .s-item b { font-size: 19px; display: block; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stats-band .s-item span { font-size: 12px; color: var(--muted); }

/* ---------- 搜索 ---------- */
.search-sort { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-sort .input { width: 230px; padding: 10px 14px; font-size: 13.5px; }
.search-sort select.input { width: auto; }
.sort-sold { font-size: 12px; color: var(--muted); }

/* ---------- 商品网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.p-card { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 20px 20px 22px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.p-card.clickable { cursor: pointer; }
.p-card.clickable:hover .p-name { color: var(--accent); }
.p-card .p-name { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.p-card .p-desc { font-size: 13px; color: var(--muted); line-height: 1.7; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-meta { display: flex; align-items: baseline; justify-content: space-between; margin-top: 2px; gap: 8px; flex-wrap: wrap; }
.price { font-size: 23px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price small { font-size: 13px; font-weight: 700; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; background: rgba(52,168,83,.12); color: var(--green); }
.pill.warn { background: rgba(201,52,0,.10); color: var(--orange); }
.pill.off { background: rgba(0,0,0,.06); color: var(--muted); }
.stock-flash { animation: flash .9s ease 2; }
@keyframes flash { 0%,100% { background: var(--card); } 50% { background: #E8F3EC; } }
.p-actions { display: flex; gap: 10px; margin-top: 8px; }
.p-actions .btn { padding: 10px 14px; font-size: 13.5px; }

.p-img { height: 160px; border-radius: 14px; overflow: hidden; position: relative; background: linear-gradient(160deg,#EBEBF0,#F6F6F8); display: grid; place-items: center; }
.p-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-card:hover .p-img img { transform: scale(1.04); transition: transform .6s var(--ease); }
.p-img .ph { color: #C7C7CC; font-size: 46px; font-weight: 800; }
.p-img .kind-tag { position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--accent); font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }

/* ---------- 按钮（Shape Lock: 控件 12px） ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; background: var(--accent); color: #fff; cursor: pointer; font-size: 14.5px; font-weight: 600; padding: 12px 22px; border-radius: var(--radius-ctl); letter-spacing: .01em; }
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: rgba(0,0,0,.04); box-shadow: inset 0 0 0 1px var(--muted); }
.btn-danger { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px currentColor; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 28px; font-size: 15.5px; }

/* ---------- 面板 / 表单 ---------- */
.panel { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 32px; }
.panel-title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
.input, textarea.input, select.input { width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-input); font-size: 14.5px; font-family: inherit; background: var(--card); outline: none; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); color: var(--ink); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3.5px rgba(0,113,227,.15); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.crumb a { color: var(--accent); }
.info-table { width: 100%; font-size: 13.5px; color: var(--ink-2); margin-top: 8px; border-collapse: collapse; }
.info-table td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.info-table tr:last-child td { border-bottom: none; }
.info-table td:first-child { color: var(--muted); width: 92px; }
.buy-notice { margin-top: 20px; background: var(--paper); border-radius: 14px; padding: 16px 20px; font-size: 13px; color: var(--ink-2); line-height: 1.95; }
.buy-notice b { color: var(--ink); }

/* ---------- Tab（分段控件式） ---------- */
.tabs { display: flex; background: rgba(120,120,128,.12); border-radius: var(--radius-ctl); padding: 3px; margin-bottom: 24px; }
.tabs button { flex: 1; border: none; background: transparent; padding: 9px 6px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .2s var(--ease); }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* ---------- 订单 / 键值 ---------- */
.order-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 14px; }
.order-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.order-no { font-size: 12.5px; color: var(--muted); font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: 999px; background: rgba(52,168,83,.12); color: var(--green); }
.chip.paid { background: rgba(52,168,83,.12); color: var(--green); }
.chip.pending { background: rgba(201,52,0,.10); color: var(--orange); }
.chip.cancelled { background: rgba(0,0,0,.06); color: var(--muted); }
.chip.unsold { background: var(--accent-tint); color: var(--accent); }
.chip.used { background: rgba(0,0,0,.06); color: var(--muted); }
.key-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; background: var(--paper); border-radius: var(--radius-input); padding: 12px 14px; flex-wrap: wrap; }
.key-code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 15px; letter-spacing: 1.5px; font-weight: 600; color: var(--ink); }
.copy-btn { margin-left: auto; border: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 7px 15px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.copy-btn:hover { background: #3A3A3E; }
.account-line { font-size: 13.5px; margin-top: 6px; color: var(--ink-2); }
.account-line b { color: var(--ink); }
.order-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 收银台 ---------- */
.pay-wrap { max-width: 460px; margin: 32px auto; }
.pay-head { text-align: center; margin-bottom: 22px; }
.pay-amount { font-size: 46px; font-weight: 800; margin: 6px 0; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pay-amount span { font-size: 19px; font-weight: 700; }
.countdown { font-family: ui-monospace, Consolas, monospace; font-size: 15px; color: var(--red); font-weight: 700; }
.qr-box { width: 190px; height: 190px; margin: 18px auto; border-radius: 16px; padding: 12px; background: #fff; box-shadow: var(--shadow); }
.qr-grid { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(15, 1fr); grid-template-rows: repeat(15, 1fr); }
.qr-grid i { background: transparent; }
.qr-grid i.on { background: var(--ink); }
.pay-channel { display: flex; gap: 12px; justify-content: center; margin: 18px 0 22px; }
.channel { display: flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: var(--radius-ctl); border: 1.5px solid var(--line-2); font-size: 14px; font-weight: 600; cursor: pointer; background: var(--card); color: var(--ink-2); transition: all .2s var(--ease); }
.channel.on { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }
.success-icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: rgba(52,168,83,.12); color: var(--green); display: grid; place-items: center; font-size: 28px; }
.redeem-cta { margin-top: 22px; border-radius: 16px; padding: 20px; text-align: center; background: var(--card); box-shadow: var(--shadow); color: var(--ink-2); }
.redeem-cta b { color: var(--ink); }
.redeem-cta a { display: inline-block; margin-top: 12px; background: var(--accent); color: #fff; font-weight: 700; padding: 12px 28px; border-radius: var(--radius-ctl); }
.redeem-cta a:hover { background: var(--accent-2); text-decoration: none; }

/* ---------- Toast ---------- */
#toast { position: fixed; top: 78px; left: 50%; transform: translateX(-50%) translateY(-16px) scale(.97); background: rgba(29,29,31,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font-size: 14px; padding: 12px 22px; border-radius: 14px; opacity: 0; pointer-events: none; transition: all .3s var(--ease); z-index: 999; box-shadow: 0 10px 32px rgba(0,0,0,.24); max-width: 86vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
#toast.err { background: rgba(227,0,0,.94); }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.6); }
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 24px 20px; display: flex; gap: 22px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.footer-inner span { color: var(--muted); }
.footer-inner a { color: var(--ink-2); }
.footer-inner a:hover { color: var(--accent); }

/* ---------- 空态 ---------- */
.empty { text-align: center; color: var(--muted); padding: 76px 0; font-size: 15px; }
.empty .icon { font-size: 38px; margin-bottom: 12px; opacity: .5; }

/* ---------- 悬浮客服 ---------- */
.float-contact { position: fixed; right: 22px; bottom: 90px; z-index: 60; text-align: center; }
.float-contact .fc-btn { width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer; background: var(--card); box-shadow: var(--shadow-lift); color: var(--ink); font-size: 13px; font-weight: 700; writing-mode: vertical-lr; line-height: 1; padding: 0; }
.float-contact .fc-btn:hover { background: var(--accent); color: #fff; }
.fc-panel { display: none; position: absolute; right: 0; bottom: 62px; width: 240px; background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-radius: 16px; box-shadow: var(--shadow-lift); padding: 16px; text-align: left; border: 1px solid var(--line); }
.fc-panel.show { display: block; animation: spring-pop .38s var(--spring); }
.fc-panel b { font-size: 14px; }
.fc-panel .fc-line { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.65; word-break: break-all; }
.fc-panel .fc-line b { color: var(--accent); }

@media (max-width: 640px) {
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 25px; }
  .nav-links a { padding: 8px 10px; font-size: 13px; }
  .grid { grid-template-columns: 1fr; }
  .search-sort .input { width: 100%; }
  .float-contact { right: 14px; bottom: 70px; }
}

/* ============================================================
   物理触感 & 弹性阻尼动画层（保留）
   ============================================================ */
:root { --spring: cubic-bezier(.34,1.56,.64,1); --spring-soft: cubic-bezier(.22,1.18,.36,1); --press-scale: .96; }
.btn, .copy-btn, .copybtn, .mini-btn, .chip.clickable, .pill.clickable, .logo, .p-card.clickable, .channel, .fc-btn {
  transition: transform .38s var(--spring), background-color .2s var(--ease), box-shadow .38s var(--spring-soft), color .2s var(--ease), border-color .2s var(--ease);
  will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .p-card.clickable:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
  .logo:hover { transform: scale(1.05); }
}
.btn.pressed, .copy-btn.pressed, .copybtn.pressed, .mini-btn.pressed { transform: scale(var(--press-scale)) translateY(1px) !important; }
.pill.clickable.pressed, .chip.clickable.pressed, .channel.pressed { transform: scale(.96) !important; }
.p-card.clickable.pressed { transform: scale(.978) !important; }
.logo.pressed { transform: scale(.94) !important; }
.btn:active, .copy-btn:active { transform: scale(var(--press-scale)); }
.p-card.clickable:active { transform: scale(.978); }

@keyframes spring-pop {
  0%   { opacity: 0; transform: translateY(18px) scale(.94); }
  55%  { opacity: 1; transform: translateY(-4px) scale(1.018); }
  80%  { transform: translateY(1px)  scale(.997); }
  100% { opacity: 1; transform: none; }
}
.p-card, .panel, .order-card { animation: spring-pop .55s var(--spring) backwards; }
.p-card:nth-child(2){ animation-delay:.04s } .p-card:nth-child(3){ animation-delay:.08s }
.p-card:nth-child(4){ animation-delay:.12s } .p-card:nth-child(5){ animation-delay:.16s }
.p-card:nth-child(6){ animation-delay:.20s } .p-card:nth-child(7){ animation-delay:.24s }
.p-card:nth-child(8){ animation-delay:.28s }

@media (prefers-reduced-motion: reduce) {
  .p-card, .panel, .order-card, .fc-panel { animation: none; }
  .btn, .copy-btn, .copybtn, .mini-btn, .pill.clickable, .chip.clickable, .logo, .p-card.clickable, .channel { transition: none; will-change: auto; }
}
