:root {
  --bg: #ffffff;
  --bg2: #f5f5f7;
  --bg3: #fbfbfd;
  --t1: #1d1d1f;
  --t2: #6e6e73;
  --t3: #86868b;
  --b1: #d2d2d7;
  --b2: #e8e8ed;
  --gold: #d4880a;
  --gold-bg: #fef3dc;
  --green: #1d8348;
  --green-bg: #e9f7ee;
  --blue: #0066cc;
  --red: #c0392b;
  --red-bg: #fdecea;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --max: 1100px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, 'PingFang SC', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box }
html { font-size: 16px; -webkit-font-smoothing: antialiased }
body { font-family: var(--font); background: var(--bg2); color: var(--t1); line-height: 1.5 }
a { color: inherit; text-decoration: none }
button, input, select { font-family: var(--font) }
button { cursor: pointer }

.preview-note {
  background: #1d1d1f; color: #f5f5f7;
  padding: 10px 24px; font-size: 12px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.preview-note a { color: #f5c542; text-decoration: underline }
.preview-note strong { color: #fff }

.ap-nav {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--b2);
  position: sticky; top: 0; z-index: 50;
}
.nav-w {
  max-width: var(--max); margin: auto;
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.ap-logo { font-size: 18px; font-weight: 800; letter-spacing: -.4px }
.ap-logo span { color: var(--gold) }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap }
.nav-links a {
  font-size: 13px; font-weight: 500; color: var(--t2);
  padding: 8px 12px; border-radius: 100px;
}
.nav-links a.on, .nav-links a:hover { background: var(--bg2); color: var(--t1) }

.wrap { max-width: var(--max); margin: 0 auto; padding: 28px 24px 64px }

.hero-mini {
  background: linear-gradient(180deg, #fff 0%, var(--bg2) 100%);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  padding: 28px 28px 24px;
  margin-bottom: 24px;
}
.hero-mini .kicker {
  font-size: 12px; font-weight: 600; color: var(--gold);
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px;
}
.hero-mini h1 { font-size: 28px; letter-spacing: -.6px; margin-bottom: 8px }
.hero-mini p { color: var(--t2); font-size: 14px; max-width: 640px }

.grid-2 {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px;
}
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr } }

.panel {
  background: #fff; border: 1px solid var(--b2);
  border-radius: var(--r-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.panel h2 { font-size: 16px; margin-bottom: 14px }
.panel .sub { font-size: 13px; color: var(--t2); margin: -8px 0 16px }

.field { margin-bottom: 14px }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--t2); margin-bottom: 6px }
.field input, .field select {
  width: 100%; height: 42px; border: 1px solid var(--b1);
  border-radius: var(--r-sm); padding: 0 12px; font-size: 14px; background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid rgba(0,102,204,.25); border-color: var(--blue) }
.row { display: flex; gap: 10px; align-items: end }
.row .field { flex: 1 }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 100px; border: none;
  font-size: 13px; font-weight: 700;
}
.btn-primary { background: var(--t1); color: #fff }
.btn-primary:hover { opacity: .9 }
.btn-gold { background: var(--gold); color: #fff }
.btn-gold:hover { filter: brightness(.95) }
.btn-ghost { background: var(--bg2); color: var(--t1); border: 1px solid var(--b1) }
.btn-wa { background: #25d366; color: #fff }
.btn-block { width: 100% }
.btn:disabled { opacity: .5; cursor: not-allowed }

.hint {
  font-size: 12px; color: var(--t3); margin-top: 10px;
  background: var(--bg2); border-radius: var(--r-sm); padding: 10px 12px;
}
.hint code { background: #fff; border: 1px solid var(--b2); padding: 1px 6px; border-radius: 4px; font-size: 11px }

.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 100px;
}
.badge-green { background: var(--green-bg); color: var(--green) }
.badge-gold { background: var(--gold-bg); color: #9a6200 }
.badge-blue { background: #e8f1fc; color: var(--blue) }
.badge-gray { background: var(--bg2); color: var(--t2) }
.badge-red { background: var(--red-bg); color: var(--red) }

.table { width: 100%; border-collapse: collapse; font-size: 13px }
.table th {
  text-align: left; font-size: 11px; color: var(--t3); font-weight: 600;
  padding: 0 8px 10px; border-bottom: 1px solid var(--b2);
}
.table td { padding: 12px 8px; border-bottom: 1px solid var(--b2); vertical-align: middle }
.table tr:last-child td { border-bottom: none }
.stock { font-weight: 700; letter-spacing: -.2px }
.muted { color: var(--t2); font-size: 12px }
.price { font-weight: 800 }
.actions { display: flex; gap: 8px; flex-wrap: wrap }

.steps {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px;
}
.step {
  flex: 1; min-width: 120px;
  background: var(--bg2); border: 1px solid var(--b2);
  border-radius: var(--r-md); padding: 12px;
}
.step.on { background: #fff; border-color: var(--t1) }
.step .n { font-size: 11px; font-weight: 700; color: var(--t3); margin-bottom: 4px }
.step .t { font-size: 13px; font-weight: 700 }
.step .d { font-size: 11px; color: var(--t2); margin-top: 4px }

.card-item {
  display: grid; grid-template-columns: 88px 1fr auto; gap: 14px;
  align-items: center; padding: 14px 0; border-bottom: 1px solid var(--b2);
}
.card-item:last-child { border-bottom: none }
.thumb {
  width: 88px; height: 66px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, #e8e8ed, #f5f5f7);
  border: 1px solid var(--b2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--t3); font-weight: 600;
}
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  background: var(--t1); color: #fff; padding: 12px 16px;
  border-radius: var(--r-md); font-size: 13px; display: none;
  box-shadow: var(--shadow-md); max-width: 320px;
}
.toast.on { display: block }

.flow-box {
  border: 1px dashed var(--b1); border-radius: var(--r-lg);
  padding: 20px; background: var(--bg3); margin-top: 16px;
}
.checkbox {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12px; color: var(--t2); margin: 14px 0;
}
.checkbox input { margin-top: 3px }

/* Auth nav account menu (portal shell) */
.ap-auth-slot { display: inline-flex; align-items: center; position: relative; }
.ap-account { position: relative; display: inline-flex; align-items: center; }
.ap-account__toggle {
  cursor: pointer; border: none; background: transparent;
  font: inherit; font-weight: 700; color: inherit; padding: 4px 0;
  display: inline-flex; align-items: center; gap: 4px;
}
.ap-account__name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-account__caret { font-size: 10px; opacity: .75; }
.ap-account__menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 140px;
  background: #fff; border: 1px solid var(--b1); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 6px; z-index: 80;
  display: flex; flex-direction: column; gap: 2px;
}
.ap-account__menu[hidden] { display: none !important; }
.ap-account__menu a,
.ap-account__menu button {
  display: block; width: 100%; text-align: left; padding: 8px 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--t1);
  font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.ap-account__menu a:hover,
.ap-account__menu button:hover { background: var(--bg2); }

