:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --border: #e5e7eb;
  --danger: #dc2626;
  --warning: #f59e0b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(135deg, #eefcf4 0%, #f8fafc 45%, #fff7ed 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 34px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar strong { display: block; font-size: 20px; }
.topbar span { color: var(--muted); font-size: 13px; }
.topbar nav { display: flex; gap: 14px; flex-wrap: wrap; }
.topbar a { color: #047857; text-decoration: none; font-weight: 700; }
.layout { width: min(1180px, calc(100% - 32px)); margin: 28px auto 60px; }
.panel {
  padding: 28px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}
.login-panel { max-width: 520px; margin: 80px auto; }
h1, h2, p { margin-top: 0; }
p, .tip { color: var(--muted); line-height: 1.7; }
.form-row { display: grid; gap: 8px; margin: 16px 0; }
.form-row label { font-weight: 800; }
input {
  height: 46px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
}
button { border: 0; border-radius: 12px; cursor: pointer; font-weight: 800; }
.primary {
  width: 100%;
  height: 48px;
  margin: 8px 0 14px;
  color: #fff;
  background: var(--primary);
  font-size: 17px;
}
.primary:hover, .primary-small:hover { background: var(--primary-dark); }
.ghost { height: 40px; padding: 0 16px; color: #334155; background: #f1f5f9; }
.small { height: 34px; padding: 0 12px; color: #334155; background: #f1f5f9; }
.primary-small { color: #fff; background: var(--primary); }
.dashboard-head, .section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0; }
.stats div { padding: 18px; border-radius: 18px; background: #f8fafc; border: 1px solid var(--border); }
.stats strong { display: block; font-size: 30px; color: #047857; }
.stats span { color: var(--muted); }
.grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr); gap: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.product-card, .cart-item, .order-card { border: 1px solid var(--border); border-radius: 18px; background: #fff; }
.product-card { padding: 16px; }
.product-card .cover {
  display: grid;
  place-items: center;
  height: 110px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dcfce7, #e0f2fe);
  font-size: 42px;
}
.product-card h3 { margin-bottom: 6px; }
.price { color: #dc2626; font-size: 20px; font-weight: 900; }
.stock { color: var(--muted); font-size: 14px; }
.product-card button { width: 100%; height: 38px; margin-top: 12px; color: #fff; background: #0ea5e9; }
.product-card button:disabled { background: #cbd5e1; cursor: not-allowed; }
.list, .orders { display: grid; gap: 12px; }
.cart-item, .order-card { padding: 14px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.cart-item button, .order-card button { height: 32px; padding: 0 10px; color: #fff; background: var(--danger); }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.order-actions .pay { background: var(--primary); }
.order-actions .cancel { background: var(--warning); }
.badge { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 13px; font-weight: 800; }
.orders-section, .bug-section { margin-top: 24px; }
.bug-section { padding: 18px; border-radius: 18px; background: #fffbeb; border: 1px solid #fde68a; }
.empty { color: var(--muted); padding: 18px; border-radius: 16px; background: #f8fafc; border: 1px dashed #cbd5e1; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: #111827;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}
.hidden { display: none !important; }
@media (max-width: 860px) {
  .topbar, .dashboard-head, .section-title { align-items: flex-start; flex-direction: column; }
  .grid, .stats { grid-template-columns: 1fr; }
}
