:root {
  --brand: #ff3b30;
  --brand-2: #ff8a00;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #8e8e93;
  --line: #ececec;
  --ok: #34c759;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    Helvetica, "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 12px 40px; }

/* 顶部渐变头 */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 22px 16px 18px;
  text-align: center;
}
.hero h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.hero p { margin: 6px 0 0; font-size: 13px; opacity: 0.92; }

/* 分类导航 */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: #fff; box-shadow: var(--shadow);
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 12px; -webkit-overflow-scrolling: touch;
}
.nav::-webkit-scrollbar { display: none; }
.nav .chip {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 999px;
  background: #f2f2f7; color: #333; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; white-space: nowrap;
}
.nav .chip.active { background: var(--brand); color: #fff; }

/* 分类区块 */
.section { margin-top: 16px; }
.section h2 {
  font-size: 16px; font-weight: 800; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.section h2 .bar { width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(var(--brand), var(--brand-2)); }

/* 券卡 */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px; margin-bottom: 10px;
  display: flex; gap: 12px; align-items: center;
}
.card .thumb {
  width: 60px; height: 60px; border-radius: 12px; object-fit: cover;
  background: #f2f2f7; flex: 0 0 auto;
}
.card .thumb.ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.card .body { flex: 1 1 auto; min-width: 0; }
.card .title { font-weight: 700; font-size: 15px; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag { font-size: 11px; color: var(--brand); background: #fff1f0;
  border: 1px solid #ffd6d2; border-radius: 4px; padding: 1px 6px; }
.actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.btn {
  border: none; cursor: pointer; font-weight: 700; font-size: 13px;
  border-radius: 999px; padding: 8px 16px; white-space: nowrap;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
}
.btn:active { opacity: 0.85; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.block { display: block; width: 100%; text-align: center; padding: 14px; font-size: 16px; }
.btn[disabled] { opacity: 0.5; }

/* 提示条 */
.notice { background: #fffbe6; border: 1px solid #ffe58f; color: #ad6800;
  font-size: 13px; padding: 10px 12px; border-radius: 10px; margin: 12px 0; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(0,0,0,0.82); color: #fff; padding: 10px 18px;
  border-radius: 999px; font-size: 14px; z-index: 999; opacity: 0;
  transition: opacity .2s; pointer-events: none; max-width: 90%;
}
.toast.show { opacity: 1; }

/* 生成页 / 通用面板 */
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-top: 16px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 60px; }
.linkbox { word-break: break-all; background: #f7f7fa; border: 1px dashed #d9d9e3;
  border-radius: 10px; padding: 12px; font-size: 13px; color: #333; }
.qr { text-align: center; margin: 14px 0; }
.qr img { display: inline-block; border-radius: 12px; border: 1px solid var(--line); }
.muted { color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.spacer { height: 8px; }
