:root {
  /* 官网主题色体系（www.jingzi-ai.com） */
  --primary: #7C3AED;
  --primary-light: #A855F7;
  --secondary: #2563EB;
  --secondary-light: #3B82F6;
  --gradient: linear-gradient(135deg, #7C3AED 0%, #2563EB 100%);
  --gradient-text: linear-gradient(135deg, #7C3AED 0%, #4F46E5 50%, #2563EB 100%);
  --bg-light: #F8FAFF;

  --text: #1E293B;
  --text-sub: #64748B;
  --text-light: #94A3B8;
  --bg: #F8FAFF;
  --card: #ffffff;
  --border: #E2E8F0;

  /* 状态语义色 */
  --success: #07C160;   /* 未使用 / 已支付 */
  --warn: #E6A23C;      /* 待支付 */
  --danger: #FA5151;    /* 价格 / 缺码 */

  --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.08);
  --shadow-md: 0 8px 30px rgba(124, 58, 237, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; }

/* 顶部渐变（官网紫蓝渐变） */
.hero {
  background: var(--gradient);
  color: #fff;
  padding: 32px 20px 28px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(168, 85, 247, .5) 0%, transparent 70%);
  top: -80px; right: -60px;
  pointer-events: none;
}
.hero h1 { font-size: 22px; font-weight: 700; position: relative; z-index: 1; }
.hero p { font-size: 13px; opacity: .92; margin-top: 6px; position: relative; z-index: 1; }
.demo-badge {
  display: inline-block; background: rgba(255,255,255,.22);
  border-radius: 20px; padding: 3px 12px; font-size: 12px; margin-top: 10px;
  position: relative; z-index: 1;
}

/* 商品卡片 */
.card {
  background: var(--card); border-radius: 16px; margin: 14px 16px;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.card .name { font-size: 17px; font-weight: 600; }
.card .desc { color: var(--text-sub); font-size: 13px; margin-top: 2px; }
.card .price { margin-top: 10px; font-size: 26px; font-weight: 700; color: var(--danger); }
.card .price em { font-style: normal; font-size: 15px; }
.card .features { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.card .features span {
  font-size: 12px; color: #4F46E5; background: #EEF2FF; padding: 4px 10px; border-radius: 6px;
}

/* 按钮（官网渐变主按钮） */
.btn {
  display: block; width: 100%; text-align: center; border: none; cursor: pointer;
  border-radius: 12px; font-size: 16px; font-weight: 600; padding: 13px 0;
  background: var(--gradient); color: #fff; margin-top: 14px;
  box-shadow: 0 4px 16px rgba(124, 58, 237, .25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 25px rgba(124, 58, 237, .4); }
.btn:active { transform: translateY(0); filter: brightness(.95); }
.btn:disabled { background: #c6c6c6; box-shadow: none; }
.btn.ghost { background: #EEF2FF; color: var(--secondary); box-shadow: none; }

/* 通用信息区 */
.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row .k { color: var(--text-sub); }

/* 结果页激活码 */
.code-box {
  background: linear-gradient(135deg, #F5F3FF, #EFF6FF);
  border: 1.5px dashed var(--primary-light); border-radius: 12px;
  padding: 20px; text-align: center; margin: 16px 0;
}
.code-box .code {
  font-size: 22px; font-weight: 800; letter-spacing: 1px;
  word-break: break-all; font-family: "SF Mono", Consolas, monospace;
  background: var(--gradient-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.code-box .tip { font-size: 12px; color: var(--text-sub); margin-top: 8px; }

.status-icon { text-align: center; font-size: 56px; margin: 20px 0 4px; }
.status-title { text-align: center; font-size: 18px; font-weight: 700; }
.status-sub { text-align: center; color: var(--text-sub); font-size: 13px; margin-top: 6px; }

/* 后台 */
.admin-top {
  background: #1E1B4B; color: #fff; padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.admin-top h1 { font-size: 18px; }
.admin-top button { background: transparent; color: #fff; border: 1px solid #555; padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }

.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--border); }
.tabs div { flex: 1; text-align: center; padding: 13px 0; cursor: pointer; font-size: 15px; color: var(--text-sub); }
.tabs div.active { color: var(--primary); font-weight: 600; border-bottom: 2px solid var(--primary); }

.panel { display: none; padding: 16px; }
.panel.active { display: block; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 10px; padding: 14px; text-align: center; box-shadow: var(--shadow-sm); }
.stat .num { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat .num.red { color: var(--danger); }
.stat .num.green { color: var(--success); }
.stat .label { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

textarea {
  width: 100%; height: 130px; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; font-size: 14px; font-family: inherit; resize: vertical; outline: none;
}
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }

input[type="text"], input[type="number"], input[type="password"] {
  font-family: inherit;
}

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f2f2f2; }
th { background: #FAFAFA; color: var(--text-sub); font-weight: 500; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag.unused { background: #E8F7EE; color: var(--success); }
.tag.used { background: #F2F2F2; color: #8A8A8A; }
.tag.pending { background: #FFF4E6; color: var(--warn); }
.tag.paid { background: #E8F7EE; color: var(--success); }
.tag.out { background: #FDEAEA; color: var(--danger); }

.login-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex;
  align-items: center; justify-content: center; z-index: 99;
}
.login-box { background: #fff; border-radius: 14px; padding: 26px; width: 320px; }
.login-box h2 { font-size: 18px; margin-bottom: 6px; }
.login-box p { font-size: 12px; color: var(--text-sub); margin-bottom: 16px; }
.login-box input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; font-size: 15px; outline: none; margin-bottom: 12px;
}
.login-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 23, 42, .85); color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 13px; z-index: 999;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.toast.show { opacity: 1; }

.empty { text-align: center; color: var(--text-sub); padding: 40px 0; font-size: 14px; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.filter-bar button { flex: 1; padding: 8px 0; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 13px; }
.filter-bar button.active { background: var(--gradient); color: #fff; border-color: transparent; }

label { font-size: 13px; color: var(--text-sub); }
