/* ============================================================
   D4 授权系统 · 通用样式（暗黑风）
   ============================================================ */
:root {
  --bg: #08090b;
  --bg-1: #0d0f12;
  --panel: #12151a;
  --panel-2: #171b21;
  --line: #232830;
  --line-2: #2f3641;
  --ink: #e8eaee;
  --ink-2: #9aa3b1;
  --ink-3: #646d7c;
  --gold: #d4af5f;
  --gold-2: #f2d79b;
  --blood: #c0392b;
  --blood-2: #e05a4a;
  --green: #4ea56b;
  --blue: #5a9bd8;
  --r: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 900px 500px at 15% -5%, rgba(192, 57, 43, .13), transparent 65%),
    radial-gradient(ellipse 800px 450px at 88% 0%, rgba(212, 175, 95, .08), transparent 65%);
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.narrow { max-width: 760px; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 9, 11, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  height: 62px; display: flex; align-items: center; gap: 26px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; letter-spacing: .04em; font-size: 15px; color: var(--ink);
}
.logo .mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: linear-gradient(140deg, var(--gold), #8a6d2c);
  color: #12100a; display: grid; place-items: center;
  font-size: 13px; font-weight: 800;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 13.5px; }
.nav-links a { color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.nav-links a.ghost {
  border: 1px solid var(--line-2); padding: 5px 13px; border-radius: 6px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; border-radius: 7px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: .16s; text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1408;
  box-shadow: 0 4px 16px rgba(212, 175, 95, .18);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--line-2);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-2); }
.btn-danger { background: rgba(192, 57, 43, .14); color: var(--blood-2); border-color: rgba(192, 57, 43, .35); }
.btn-danger:hover:not(:disabled) { background: rgba(192, 57, 43, .22); }
.btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }

/* ---------- 通用块 ---------- */
.section { padding: 84px 0; position: relative; z-index: 1; }
.section-head { text-align: center; margin-bottom: 44px; }
.eyebrow {
  font-size: 11px; letter-spacing: .22em; color: var(--gold);
  text-transform: uppercase; margin-bottom: 12px;
}
h1, h2, h3 { font-family: Georgia, "Songti SC", "SimSun", serif; font-weight: 600; letter-spacing: .01em; }
h2 { font-size: 30px; line-height: 1.35; }
.section-head p { color: var(--ink-2); margin-top: 12px; font-size: 14.5px; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
}

/* ---------- Hero ---------- */
.hero { padding: 96px 0 76px; text-align: center; position: relative; z-index: 1; }
.hero h1 {
  font-size: 50px; line-height: 1.22; margin-bottom: 22px;
}
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero .lead {
  color: var(--ink-2); font-size: 16.5px; max-width: 620px; margin: 0 auto 34px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: 62px; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; background: var(--line);
}
.hero-stats > div {
  background: var(--bg-1); padding: 20px 16px;
}
.hero-stats .v { font-size: 24px; font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.hero-stats .k { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; letter-spacing: .05em; }

/* ---------- 功能 ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px 22px; transition: .18s;
}
.feature:hover { border-color: var(--line-2); transform: translateY(-2px); }
.feature .ico {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(212, 175, 95, .1); color: var(--gold); margin-bottom: 15px;
}
.feature .ico svg { width: 18px; height: 18px; }
.feature h4 { font-size: 15px; margin-bottom: 7px; font-weight: 600; }
.feature p { font-size: 13.2px; color: var(--ink-2); line-height: 1.65; }

/* ---------- 价格 ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan {
  background: linear-gradient(180deg, var(--panel), var(--bg-1));
  border: 1px solid var(--line); border-radius: 12px;
  padding: 26px 22px; display: flex; flex-direction: column; position: relative;
  transition: .18s;
}
.plan:hover { border-color: var(--line-2); }
.plan.hot {
  border-color: rgba(212, 175, 95, .55);
  box-shadow: 0 0 0 1px rgba(212, 175, 95, .12), 0 14px 40px rgba(212, 175, 95, .07);
  background: linear-gradient(180deg, #191d24, var(--bg-1));
}
.plan .badge {
  position: absolute; top: -9px; right: 18px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1408; font-size: 10.5px; font-weight: 700;
  padding: 2px 9px; border-radius: 4px; letter-spacing: .05em;
}
.plan .name { font-size: 15px; font-weight: 600; color: var(--ink); }
.plan .days { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.plan .price { margin: 16px 0 4px; display: flex; align-items: baseline; gap: 5px; }
.plan .price .cur { font-size: 15px; color: var(--gold); }
.plan .price .num { font-size: 38px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.plan .perday { font-size: 11.5px; color: var(--ink-3); margin-bottom: 18px; }
.plan ul { list-style: none; margin: 0 0 22px; flex: 1; }
.plan li {
  font-size: 12.8px; color: var(--ink-2); padding: 5px 0 5px 17px; position: relative;
}
.plan li::before {
  content: '·'; position: absolute; left: 4px; top: -1px; color: var(--gold); font-size: 18px;
}

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.faq details { background: var(--bg-1); }
.faq summary {
  padding: 17px 22px; cursor: pointer; font-size: 14px; font-weight: 500;
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--gold); font-size: 17px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq .ans { padding: 0 22px 18px; font-size: 13.4px; color: var(--ink-2); line-height: 1.75; }

/* ---------- 提示条 ---------- */
.notice {
  border-radius: 8px; padding: 14px 18px; font-size: 13px; line-height: 1.7;
  border-left: 2px solid var(--gold);
  background: linear-gradient(90deg, rgba(212, 175, 95, .07), transparent);
  color: var(--ink-2);
}
.notice.danger { border-left-color: var(--blood-2); background: linear-gradient(90deg, rgba(192, 57, 43, .1), transparent); }
.notice.info { border-left-color: var(--blue); background: linear-gradient(90deg, rgba(90, 155, 216, .09), transparent); }
.notice b { color: var(--ink); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .03em;
}
input, select, textarea {
  width: 100%; background: #0a0c0f; border: 1px solid var(--line-2);
  border-radius: 7px; padding: 10px 13px; color: var(--ink);
  font-size: 14px; font-family: inherit; outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
input::placeholder { color: #4a5260; }
input.mono, .mono { font-family: "SF Mono", Consolas, "Cascadia Code", monospace; letter-spacing: .04em; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4, 5, 7, .78); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-mask.on { display: flex; }
.modal {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px;
  width: 100%; max-width: 420px; padding: 26px; box-shadow: var(--shadow);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
.modal h3 { font-size: 18px; margin-bottom: 4px; }
.modal .sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  background: var(--panel-2); text-align: left; padding: 10px 13px;
  font-weight: 600; font-size: 12px; color: var(--ink); white-space: nowrap;
  border-bottom: 1px solid var(--line-2);
}
td { padding: 10px 13px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .015); }

/* ---------- 状态标签 ---------- */
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px;
  font-weight: 600; letter-spacing: .03em;
}
.tag.unused { background: rgba(90, 155, 216, .14); color: #7db8ea; }
.tag.active { background: rgba(78, 165, 107, .14); color: #6cc78b; }
.tag.expired { background: rgba(120, 128, 140, .16); color: #99a1ad; }
.tag.frozen { background: rgba(212, 175, 95, .15); color: var(--gold); }
.tag.revoked { background: rgba(192, 57, 43, .16); color: var(--blood-2); }
.tag.pending { background: rgba(212, 175, 95, .12); color: #d9b96b; }
.tag.paid, .tag.delivered { background: rgba(78, 165, 107, .14); color: #6cc78b; }
.tag.closed, .tag.refunded { background: rgba(120, 128, 140, .16); color: #99a1ad; }

/* ---------- 卡密展示 ---------- */
.keybox {
  background: #06070a; border: 1px dashed rgba(212, 175, 95, .45);
  border-radius: 9px; padding: 20px; text-align: center; margin: 18px 0;
}
.keybox .k {
  font-family: "SF Mono", Consolas, monospace; font-size: 21px;
  color: var(--gold-2); letter-spacing: .12em; word-break: break-all;
}
.keybox .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 9px; }

/* ---------- 页脚 ---------- */
footer {
  border-top: 1px solid var(--line); padding: 40px 0 60px; margin-top: 40px;
  font-size: 12.5px; color: var(--ink-3); position: relative; z-index: 1;
}
footer .row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer a { color: var(--ink-2); }

/* ---------- 通用工具类 ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.dim { color: var(--ink-2); }
.center { text-align: center; }
.hide { display: none !important; }
.gold { color: var(--gold-2); }
.green { color: var(--green); }
.red { color: var(--blood-2); }
.spin {
  width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: var(--gold); border-radius: 50%; animation: sp .7s linear infinite;
  display: inline-block;
}
@keyframes sp { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink);
  padding: 11px 20px; border-radius: 8px; font-size: 13.5px; z-index: 300;
  opacity: 0; transition: .22s; pointer-events: none; box-shadow: var(--shadow);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(192, 57, 43, .5); color: var(--blood-2); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .grid-3, .plans { grid-template-columns: 1fr; }
  .hero h1 { font-size: 33px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .nav-links a:not(.ghost) { display: none; }
  .section { padding: 56px 0; }
  h2 { font-size: 24px; }
}
