:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #9a9ea7;
  --border: #ededed;
  --accent: #111111;
  --price: #e4393c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* 顶栏 */
.topbar { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1000px; margin: 0 auto; padding: 0 16px; height: 54px; display: flex; align-items: center; gap: 24px; }
.logo { font-size: 18px; font-weight: 700; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--bg); }

.container { max-width: 1000px; margin: 0 auto; padding: 20px 16px 48px; }

/* 分类标签（下划线式，简洁） */
.tabs { display: flex; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 18px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active, .tabs a:hover { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }

/* 商品列表：整块白卡 + 细分割线 */
.list { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item .li-emoji { font-size: 36px; line-height: 1; flex-shrink: 0; }
.list-item .li-info { flex: 1; min-width: 0; }
.list-item .li-name { font-size: 15px; font-weight: 600; }
.list-item .li-desc { font-size: 12px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-right { text-align: right; flex-shrink: 0; }
.list-item .li-price { color: var(--price); font-weight: 700; font-size: 18px; }
.list-item .li-stock { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }

/* 按钮 */
.buy-btn { display: inline-block; background: var(--accent); color: #fff; border: none; padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; transition: opacity .15s; }
.buy-btn:hover { opacity: .85; }
.buy-btn:disabled { background: #d9d9d9; cursor: not-allowed; }
.btn { display: inline-block; background: var(--accent); color: #fff; border: none; padding: 10px 20px; border-radius: 6px; font-size: 15px; cursor: pointer; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn.block { width: 100%; }
.btn.ghost { background: #f2f3f5; color: #333; }
.btn.danger { background: #e4393c; }

/* 面板 */
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; }

/* 表单 */
label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
input[type=text], input[type=number], input[type=password], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; margin-bottom: 12px; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; color: #fff; font-size: 12px; }

/* 二维码 */
.qr-box { text-align: center; }
.qr-box .amount { font-size: 28px; font-weight: 700; color: var(--price); margin: 12px 0; }
.qr-box .status { margin: 14px 0; font-size: 15px; color: #e6a23c; }
.qr-box .status.paid { color: #52c41a; font-size: 20px; font-weight: 700; }
#qrcode { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
#qrcode img, #qrcode canvas { display: block; }

/* 卡密展示 */
.code-box { background: #fafafa; border: 1px dashed #d0d0d0; border-radius: 8px; padding: 16px; text-align: center; margin: 14px 0; }
.code-box .code { font-size: 18px; font-weight: 700; letter-spacing: 1px; word-break: break-all; }
.code-box .tip { font-size: 12px; color: var(--muted); margin-top: 6px; }

.footer { text-align: center; color: #b0b3b8; font-size: 12px; padding: 24px 0 36px; }
.muted { color: var(--muted); }
.row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.row span:first-child { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
