:root {
  --bg: #fff8fc;
  --bg2: #f8fbff;
  --card: rgba(255, 255, 255, 0.95);
  --text: #3a3341;
  --muted: #8a7f90;
  --primary: #ff7eb6;
  --primary-dark: #ff5ea3;
  --primary-gradient: linear-gradient(135deg, #ff7eb6 0%, #ff5ea3 100%);
  --primary-hover: linear-gradient(135deg, #ff8fc0 0%, #ff6eb0 100%);
  --line: #f1dceb;
  --ok: #28a36a;
  --shadow-sm: 0 2px 8px rgba(255,126,182,0.06);
  --shadow-md: 0 8px 24px rgba(255,126,182,0.1);
  --shadow-lg: 0 12px 32px rgba(255,126,182,0.14);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: 
    radial-gradient(circle at 15% 20%, rgba(255,233,243,0.8) 0%, transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(234,244,255,0.8) 0%, transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(255,216,236,0.4) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(247,217,234,0.6);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
}
.brand-left { font-weight: 900; color: #a54679; letter-spacing: .5px; }
.topbar-min { min-height: 56px; }
nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
a { text-decoration: none; }
main { max-width: 980px; margin: 22px auto; padding: 0 14px 34px; }
.home-main {
  max-width: 640px;
  min-height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 10px 14px;
}
.card {
  background: var(--card);
  border: 1px solid rgba(248,219,232,0.6);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255,126,182,0.4);
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
h2, h3 { margin: 0 0 10px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 10px; line-height: 1.55; }
label { font-size: 13px; color: #6e5f74; }
input, textarea {
  width: 100%;
  margin: 6px 0 10px;
  border: 1px solid #efd6e5;
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
}
input:focus, textarea:focus {
  outline: none;
  border-color: #ff9cc8;
  box-shadow: 0 0 0 3px rgba(255,126,182,.2);
}
button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  min-height: 52px;
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(255,126,182,0.25);
  position: relative;
  overflow: hidden;
}
button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}
button:hover { 
  background: var(--primary-hover); 
  transform: translateY(-2px); 
  box-shadow: 0 6px 16px rgba(255,126,182,0.35);
}
button:hover::before {
  left: 100%;
}
button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255,126,182,0.25);
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}
button.ghost { background: #fff0f7; color: #a54679; }
button.ghost:hover { background: #ffe3f1; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
.result { margin-top: 8px; font-weight: 700; color: var(--ok); }
ul { margin: 0; padding-left: 20px; }
li { margin-bottom: 8px; }
.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #ffe8f2;
  color: #a54679;
  margin-left: 6px;
}
.page-intro { margin-bottom: 14px; }
.home-main .page-intro { margin-bottom: 0; width: 100%; }
.center-all { text-align: center; }
.center-all .row, .center-all .inline-actions { justify-content: center; }
.center-all #claimBtn { margin: 6px auto 0; display: inline-block; width: clamp(220px, 78vw, 420px); min-height: 52px; font-size: 16px; }
.hero-card { 
  border: 1px solid rgba(243,196,220,0.7); 
  box-shadow: 0 16px 40px rgba(255,126,182,0.18);
  background: rgba(255,255,255,0.92);
}
.hero-badge { 
  display:inline-block; 
  padding:6px 12px; 
  border-radius:999px; 
  background: linear-gradient(135deg, #fff0f7 0%, #ffe3f1 100%);
  color:#a54679; 
  font-size:12px; 
  font-weight:700; 
  margin-bottom:12px; 
  box-shadow: 0 2px 8px rgba(255,126,182,0.1);
}
.hero-badge { display:inline-block; padding:4px 10px; border-radius:999px; background:#fff0f7; color:#a54679; font-size:12px; font-weight:700; margin-bottom:8px; }
.product-grid { gap: 12px; }
.product-card { 
  padding: 16px; 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
}
.product-card:hover { 
  transform: translateY(-4px); 
  box-shadow: 0 12px 28px rgba(255,126,182,0.16); 
  border-color: rgba(255,126,182,0.5);
}
.product-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.product-name { font-weight: 800; }
.stock-badge { 
  font-size:12px; 
  border-radius:999px; 
  padding:4px 10px; 
  border:1px solid transparent;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}
.stock-badge.ok { background:#ecfdf3; color:#157347; border-color:#b7ebc9; }
.stock-badge.warn { background:#fff9e8; color:#9a6700; border-color:#f6df9f; }
.stock-badge.danger { background:#fff1f2; color:#b42318; border-color:#fecdd3; }
.kpi-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; margin-top:10px; }
.kpi { background:#fff4fa; border:1px solid #f6c7df; border-radius:12px; padding:10px; }
.kpi .label { font-size:12px; color:#8a7f90; }
.kpi .value { font-size:20px; font-weight:800; color:#a54679; }
.section-title { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.inline-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.center-wrap { justify-content: center; }
.responsive-btn {
  width: clamp(180px, 55vw, 320px);
  max-width: 100%;
  text-align: center;
}
.list-compact li { padding:8px 0; border-bottom:1px dashed #f3d3e4; }
.list-compact li:last-child { border-bottom:0; }
.tip {
  margin-top: 12px;
  font-size: 13px;
  color: #9a5d80;
  background: linear-gradient(135deg, #fff4fa 0%, #fffafc 100%);
  border: 1px solid rgba(246,199,223,0.7);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.tip-strong {
  color: #8a2452;
  font-weight: 700;
  background: linear-gradient(135deg, #fff1f7 0%, #fff8fa 100%);
  border-color: rgba(255,126,182,0.4);
}
.bottom-contact { width: 100%; text-align: center; margin-top: 10px; }
.bottom-contact a { color: #2563eb; font-weight: 600; text-decoration: none; }
.bottom-contact a:hover { text-decoration: underline; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 60;
}
.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
}
.modal-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:8px; }
.modal-head h3 { margin: 0; }
.history-item {
  list-style: none;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fff;
}
.history-time {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}
.history-code-box {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #1e2b4f;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px 10px;
}

body.theme-dark {
  --bg: #12151f;
  --bg2: #1a2130;
  --card: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --line: #374151;
  background: linear-gradient(180deg, #12151f 0%, #1a2130 100%);
}
body.theme-dark .topbar {
  background: rgba(17,24,39,.85);
  border-bottom-color: #374151;
}
body.theme-dark .card,
body.theme-dark input,
body.theme-dark textarea {
  border-color: #374151;
  background: #111827;
  color: #e5e7eb;
}
body.theme-dark .tip,
body.theme-dark .kpi {
  background: #1f2937;
  border-color: #374151;
  color: #cbd5e1;
}
body.theme-dark button.ghost {
  background: #273449;
  color: #e5e7eb;
}
body.theme-dark .bottom-contact a { color: #60a5fa; }
body.theme-dark .modal-card { background: #111827; border-color: #374151; color: #e5e7eb; }
body.theme-dark .history-item { background: #111827; border-color: #374151; }
body.theme-dark .history-time { color: #9ca3af; }
body.theme-dark .history-code-box { background: #1f2937; border-color: #4b5563; color: #e5e7eb; }

.brand-topbar { justify-content: space-between; }
.brand-left { font-weight: 900; color: #a54679; letter-spacing: .5px; }
.app-toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 88px; background: rgba(26,26,26,.9); color:#fff;
  padding: 8px 12px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .2s;
  z-index: 99;
}
.app-toast.show { opacity: 1; }

@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar { padding: 10px 10px; gap: 8px; }
  .topbar h1 { font-size: 15px; margin: 0; }
  main { margin: 12px auto; padding: 0 10px 24px; }
  .home-main { padding: 8px 10px; min-height: calc(100vh - 64px); }
  .card { border-radius: 14px; padding: 12px; }
  .grid2, .kpi-grid { grid-template-columns: 1fr; }
  .kpi .value { font-size: 18px; }
  input, textarea, select { font-size: 16px; padding: 10px 11px; }
  .center-all #claimBtn, .responsive-btn {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
  }
  nav button { padding: 8px 10px; }
}
