* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg1: #aebfd4; --bg2: #c5cfe0; --bg3: #dfe5ee;
  --ink: #3a4660; --ink-soft: #6b7790; --card: #ffffff;
  --accent: #5b6b86; --accent-soft: #eef1f7; --line: #e6eaf1;
  --price: #c97f7f;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(165deg, var(--bg1) 0%, var(--bg2) 45%, var(--bg3) 100%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  padding: 0 0 60px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Hero */
.hero {
  text-align: center;
  padding: 48px 18px 30px;
}
.logo {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 300;
  font-size: 54px;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1;
}
.tagline {
  font-size: 13px;
  color: rgba(255,255,255,.9);
  letter-spacing: 4px;
  margin-top: 12px;
  font-weight: 300;
}
.hero-sub {
  font-size: 12.5px;
  color: rgba(255,255,255,.78);
  margin-top: 18px;
  line-height: 1.8;
}

/* Layout */
.wrap { max-width: 560px; margin: 0 auto; padding: 0 18px; }

/* Section */
.sec { margin-top: 26px; }
.sec-h {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0 4px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sec-h::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

/* Card */
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 4px;
  box-shadow: 0 6px 24px rgba(90,107,134,.12);
  overflow: hidden;
}
.card-pad { padding: 22px; }

/* Product list */
.product {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  gap: 14px;
}
.product:last-child { border-bottom: none; }
.product-info { flex: 1; min-width: 0; }
.product-name { font-weight: 600; font-size: 15.5px; color: var(--ink); }
.product-desc { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.6; }
.product-meta { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; }
.product-meta .stock-ok { color: #739673; }
.product-meta .stock-out { color: #c97f7f; }
.product-price {
  font-size: 18px;
  color: var(--price);
  font-weight: 700;
  margin: 0 4px;
  white-space: nowrap;
}
.product-price small { font-size: 11px; font-weight: 400; opacity: .7; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
}
.btn:hover { background: #4a5872; text-decoration: none; color: white; }
.btn:disabled { background: #c5cad5; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 11.5px; }
.btn-block { display: block; width: 100%; padding: 12px; font-size: 14px; border-radius: 12px; }
.btn-secondary { background: #8b95a9; }
.btn-danger { background: #c97f7f; }
.btn-success { background: #7a9678; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

/* FAQ accordion */
.faq { border-bottom: 1px solid var(--line); }
.faq:last-child { border-bottom: none; }
.faq-q {
  padding: 16px 18px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: color .2s;
  color: var(--ink);
}
.faq-q:hover { color: var(--accent); }
.faq-q .arrow {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--ink-soft);
  transition: transform .3s;
}
.faq.open .faq-q .arrow { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq.open .faq-a { max-height: 600px; }
.faq-a-inner {
  padding: 0 18px 18px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-soft);
  white-space: pre-wrap;
}
.faq-a-inner b { color: var(--accent); }

/* Step guide */
.guide { padding: 18px; }
.gstep {
  display: flex;
  gap: 13px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.gstep:last-child { border-bottom: none; }
.gnum {
  flex: 0 0 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.gtext { flex: 1; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; }
.gtext b { color: var(--accent); }
.code {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 6px 11px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 12.5px;
  color: var(--accent);
  display: inline-block;
  word-break: break-all;
}

/* QR codes */
.qr-wrap {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 22px 18px 10px;
}
.qr-box {
  text-align: center;
  background: #fafbfd;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--line);
}
.qr-box img { display: block; width: 200px; height: 200px; }
.qr-box .label { margin-top: 8px; font-weight: 600; font-size: 13px; }
.qr-box .label.alipay { color: #1677ff; }
.qr-box .label.wechat { color: #07c160; }

/* Order status */
.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #e0ede0; color: #3a5c39; }
.status-expired { background: #fae0e0; color: #882d2d; }

/* Card content display */
.card-content {
  background: #2c3548;
  color: #f1f4fa;
  padding: 18px;
  border-radius: 12px;
  margin: 8px 18px 18px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 13.5px;
  line-height: 1.9;
}

/* Tables (admin) */
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
th { background: #f7f9fc; font-weight: 600; color: var(--ink); }

/* Forms */
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  background: white;
  color: var(--ink);
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13px;
}
label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 500; color: var(--ink); }
.form-row { margin-bottom: 14px; }
.form-row-inline { display: flex; gap: 10px; align-items: end; }

/* Admin nav */
.nav {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav a {
  padding: 14px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 13.5px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

.flash {
  background: #e0ede0;
  color: #3a5c39;
  padding: 11px 15px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13.5px;
}
.warn {
  background: #fff4d6;
  color: #92400e;
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 12.5px;
  line-height: 1.7;
}
.muted { color: var(--ink-soft); font-size: 12px; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.kpi {
  background: white;
  padding: 18px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(90,107,134,.08);
}
.kpi-value { font-size: 24px; font-weight: 700; color: var(--accent); }
.kpi-label { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

/* Contact card */
.contact {
  background: white;
  border-radius: 18px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(90,107,134,.12);
}
.contact-h { font-size: 15px; font-weight: 700; color: var(--ink); }
.contact-info {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 12px;
  line-height: 2;
  white-space: pre-wrap;
}
.contact-info b { color: var(--accent); font-size: 15px; }

/* Footer */
.foot {
  text-align: center;
  margin-top: 30px;
  font-size: 11px;
  color: rgba(255,255,255,.65);
  letter-spacing: 3px;
}

/* Admin container — slightly different from buyer */
.admin-bg { background: #f5f6f8; min-height: 100vh; }
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}
.admin-bg .card { background: white; border-radius: 12px; padding: 22px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.admin-bg .card h2 { margin: 0 0 12px; font-size: 17px; }
