:root {
  --bg: #f5f6fa;
  --card: #fff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --primary: #0a66ff;
  --primary-dark: #0050d0;
  --ok: #1a9f53;
  --warn: #d97706;
  --err: #d92d20;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

header.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 20px; font-weight: 700; color: var(--text); }
.logo span { color: var(--primary); }
nav a { margin-left: 20px; color: var(--muted); font-size: 15px; }
nav a:hover { color: var(--text); }

.hero { padding: 48px 0 28px; text-align: center; }
.hero h1 { font-size: 34px; margin: 0 0 10px; }
.hero p { color: var(--muted); margin: 0; font-size: 16px; }
.badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.badges span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 13px; color: var(--muted); }

.tabs { display: flex; gap: 10px; justify-content: center; margin: 10px 0 24px; }
.tab { border: 1px solid var(--line); background: #fff; padding: 9px 22px; border-radius: 999px; cursor: pointer; font-size: 15px; color: var(--text); }
.tab.active { background: var(--text); color: #fff; border-color: var(--text); }
.cat-desc { text-align: center; color: var(--muted); margin: -10px 0 22px; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; padding-bottom: 40px; }
.product {
  background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); transition: transform .15s, box-shadow .15s;
}
.product:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.08); }
.face {
  height: 130px; display: flex; flex-direction: column; justify-content: space-between;
  padding: 16px 18px; color: #fff;
}
.face.apple { background: linear-gradient(135deg, #1d1d1f, #4a4a50); }
.face.openai { background: linear-gradient(135deg, #0f7b63, #10a37f); }
.face .brand { font-size: 14px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.face .usd { font-size: 36px; font-weight: 700; letter-spacing: -.5px; }
.product .info { padding: 14px 18px 16px; }
.product .name { font-size: 15px; }
.product .price { margin-top: 6px; display: flex; align-items: baseline; justify-content: space-between; }
.product .price b { color: var(--err); font-size: 22px; }
.product .price small { color: var(--muted); font-size: 12px; }

.section { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 26px 28px; margin-bottom: 24px; }
.section h2 { margin: 0 0 14px; font-size: 20px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.step { padding: 14px; border-radius: 10px; background: var(--bg); }
.step b { display: block; margin-bottom: 4px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
details:last-child { border-bottom: 0; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 8px 0 0; font-size: 14px; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0 40px; }

/* modal */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.mask.show { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 440px; padding: 24px; max-height: 92vh; overflow: auto; }
.modal h3 { margin: 0 0 4px; font-size: 20px; }
.modal .sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
label { display: block; font-size: 14px; margin: 14px 0 6px; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }
input, textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 40px; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-size: 18px; cursor: pointer; }
.qty input { width: 70px; text-align: center; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 0 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.total b { font-size: 26px; color: var(--err); }
.btn {
  display: inline-block; border: 0; background: var(--primary); color: #fff; padding: 12px 20px;
  border-radius: 10px; font-size: 16px; cursor: pointer; text-align: center; font-family: inherit;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.row-btns { display: flex; gap: 10px; margin-top: 12px; }
.row-btns .btn { flex: 1; }
.err { color: var(--err); font-size: 14px; min-height: 20px; margin-top: 8px; }
.tip { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* order page */
.order-box { max-width: 560px; margin: 40px auto; }
.status { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.st-pending { background: #fff4e5; color: var(--warn); }
.st-paid, .st-mismatch { background: #e8f0ff; color: var(--primary); }
.st-delivered { background: #e7f7ee; color: var(--ok); }
.st-failed, .st-closed, .st-refunded { background: #fdecea; color: var(--err); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 15px; margin: 16px 0; }
.kv div:nth-child(odd) { color: var(--muted); }
.delivery { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
.notice { background: var(--bg); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: var(--muted); margin-top: 16px; }

/* admin */
table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
th { background: var(--bg); position: sticky; top: 60px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 20px 0; }
.toolbar input, .toolbar select { width: auto; }

@media (max-width: 600px) {
  .hero h1 { font-size: 26px; }
  nav a { margin-left: 12px; font-size: 14px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .face { height: 100px; padding: 12px; }
  .face .usd { font-size: 26px; }
  .product .info { padding: 10px 12px 12px; }
  .product .price b { font-size: 18px; }
  .section { padding: 20px; }
}
