:root {
  --bg: #0a0f1c;
  --panel: rgba(17, 24, 39, 0.92);
  --panel-solid: #111827;
  --panel2: #1a2332;
  --border: #263244;
  --border-light: #33415a;
  --text: #e8ecf3;
  --muted: #94a0b5;
  --gold: #d9b45c;
  --gold-bright: #f0cc7e;
  --gold-dark: #b8933f;
  --blue: #3b82f6;
  --green: #34d399;
  --red: #f87171;
  --orange: #fbbf24;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  min-height: 100vh;
  background-image:
    linear-gradient(180deg, rgba(10,15,28,0.45) 0%, rgba(10,15,28,0.86) 42%, rgba(10,15,28,0.97) 100%),
    url("/img/hero-bg.svg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}
a { color: var(--gold); text-decoration: none; }
::selection { background: rgba(217,180,92,0.35); }

/* ---------- 顶栏 ---------- */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 64px;
  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.logo { font-size: 19px; font-weight: bold; color: var(--gold); display: flex; align-items: center; gap: 10px; letter-spacing: 1px; }
.logo .mark {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-bright));
  color: #10151f; font-size: 18px; font-weight: bold;
}
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--muted); font-size: 14px; cursor: pointer; transition: 0.2s; padding: 6px 0; }
.nav-links a:hover { color: var(--gold); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.nav-user .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #10151f; font-size: 14px; font-weight: bold;
  cursor: pointer; transition: 0.18s; letter-spacing: 0.5px;
}
.btn:hover { filter: brightness(1.12); box-shadow: 0 4px 18px rgba(217,180,92,0.3); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-light); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); box-shadow: none; }
.btn-red { background: linear-gradient(135deg, #c24545, #e05252); color: #fff; }
.btn-red:hover { box-shadow: 0 4px 18px rgba(224,82,82,0.3); }
.btn-green { background: linear-gradient(135deg, #1d8f63, #34d399); color: #06281c; }
.btn-green:hover { box-shadow: 0 4px 18px rgba(52,211,153,0.3); }
.btn-blue { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 6px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; filter: none; }

/* ---------- 首页布局 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.hero {
  text-align: center; padding: 88px 24px 72px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(217,180,92,0.1); border: 1px solid rgba(217,180,92,0.35);
  color: var(--gold); font-size: 13px; padding: 6px 16px; border-radius: 20px; margin-bottom: 22px;
}
.hero h1 { font-size: 46px; letter-spacing: 2px; margin-bottom: 14px; text-shadow: 0 2px 30px rgba(0,0,0,0.6); }
.hero h1 span {
  background: linear-gradient(120deg, var(--gold-bright), var(--gold), var(--gold-bright));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: #b6c0d4; font-size: 16px; margin-bottom: 36px; letter-spacing: 3px; }

.version-card {
  display: inline-flex; flex-direction: column; align-items: center; gap: 18px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 30px 56px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.version-meta { display: flex; gap: 32px; color: var(--muted); font-size: 13.5px; }
.version-meta b { color: var(--text); font-size: 15px; display: block; text-align: center; margin-bottom: 3px; }
.dl-btn { font-size: 16.5px; padding: 14px 60px; border-radius: 10px; }

/* 特性区 */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 30px 0 10px; }
.feature {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 26px 24px; backdrop-filter: blur(8px); transition: 0.2s;
}
.feature:hover { border-color: rgba(217,180,92,0.45); transform: translateY(-3px); }
.feature .ico {
  width: 44px; height: 44px; border-radius: 10px; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(217,180,92,0.12); margin-bottom: 14px;
}
.feature h3 { font-size: 16px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* 通用区块 */
.section-title {
  font-size: 19px; margin: 44px 0 18px; display: flex; align-items: center; gap: 10px;
}
.section-title::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: linear-gradient(180deg, var(--gold-bright), var(--gold-dark)); }

.card-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px 28px; backdrop-filter: blur(8px); box-shadow: var(--shadow);
}

/* 公告 */
.ann-item { padding: 16px 0; border-bottom: 1px dashed var(--border); }
.ann-item:last-child { border-bottom: none; }
.ann-title { font-weight: bold; margin-bottom: 7px; font-size: 15px; }
.ann-content { color: var(--muted); font-size: 14px; white-space: pre-wrap; word-break: break-all; line-height: 1.7; }
.ann-time { color: #5c6780; font-size: 12px; margin-top: 8px; }
.empty { color: var(--muted); text-align: center; padding: 26px; font-size: 14px; }

/* 卡密兑换 */
.redeem-row { display: flex; gap: 10px; margin-top: 14px; }
.redeem-row input {
  flex: 1; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 12px 16px; font-size: 14px; outline: none; letter-spacing: 2px;
  font-family: Consolas, monospace;
}
.redeem-row input:focus { border-color: var(--gold); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  display: none; position: fixed; inset: 0; background: rgba(4, 8, 16, 0.72);
  backdrop-filter: blur(4px);
  z-index: 100; align-items: center; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--panel-solid); border: 1px solid var(--border-light); border-radius: 18px;
  width: 380px; max-width: 92vw; padding: 34px 32px; box-shadow: var(--shadow);
  animation: pop 0.22s ease;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { text-align: center; margin-bottom: 4px; font-size: 20px; }
.modal .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.modal input {
  width: 100%; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 12px 14px; font-size: 14px; outline: none; margin-bottom: 13px;
}
.modal input:focus { border-color: var(--gold); }
.modal .btn { width: 100%; padding: 12px; margin-top: 4px; }
.modal .switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.modal .switch a { cursor: pointer; }
.modal .close-x {
  position: absolute; top: 14px; right: 18px; color: var(--muted); cursor: pointer; font-size: 20px;
}
.modal-wrap { position: relative; }

/* toast */
.toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  background: var(--panel-solid); border: 1px solid var(--green); color: var(--text);
  padding: 11px 26px; border-radius: 10px; z-index: 300; display: none; font-size: 14px;
  box-shadow: var(--shadow);
}

/* ---------- 管理后台 ---------- */
.admin-body { background: none; }
.admin-wrap { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
  width: 208px; background: rgba(13, 19, 33, 0.95); border-right: 1px solid var(--border);
  padding: 22px 0; flex-shrink: 0;
}
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 13px 26px; color: var(--muted);
  font-size: 14.5px; cursor: pointer; border-left: 3px solid transparent; transition: 0.15s;
}
.sidebar a.active { color: var(--gold); border-left-color: var(--gold); background: rgba(217,180,92,0.07); }
.sidebar a:hover { color: var(--text); }
.admin-main { flex: 1; padding: 30px 36px; overflow-x: auto; }
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 21px; }
.page-head .desc { color: var(--muted); font-size: 13px; margin-top: 5px; }

.stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.stat {
  flex: 1; min-width: 150px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 24px; backdrop-filter: blur(8px);
}
.stat .num { font-size: 27px; font-weight: bold; color: var(--gold); }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 5px; }

.form-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
input.inp, select.inp, textarea.inp {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px 14px; font-size: 14px; outline: none; transition: 0.15s;
}
input.inp:focus, select.inp:focus, textarea.inp:focus { border-color: var(--gold); }
textarea.inp { width: 100%; min-height: 92px; resize: vertical; }
label.inp-label { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: normal; font-size: 12.5px; }
tr:hover td { background: rgba(255,255,255,0.025); }

.tag { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 12px; }
.tag-unused { background: rgba(52,211,153,0.14); color: var(--green); }
.tag-used { background: rgba(59,130,246,0.15); color: #7ea9f8; }
.tag-banned { background: rgba(248,113,113,0.14); color: var(--red); }
.tag-type { background: rgba(217,180,92,0.13); color: var(--gold); }
.key-text { font-family: Consolas, monospace; letter-spacing: 1px; user-select: all; font-size: 13.5px; }
.muted { color: var(--muted); }
.mt16 { margin-top: 16px; }
.mt8 { margin-top: 8px; }
.hidden { display: none !important; }

/* 页脚 */
.footer {
  margin-top: 70px; padding: 26px 24px; text-align: center; color: #5c6780; font-size: 13px;
  border-top: 1px solid var(--border); background: rgba(10,15,28,0.6);
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll;
    background-image:
      linear-gradient(180deg, rgba(10,15,28,0.5) 0%, rgba(10,15,28,0.9) 45%, rgba(10,15,28,0.98) 100%),
      url("/img/hero-bg.svg");
  }
  .navbar { padding: 0 14px; height: 56px; }
  .logo { font-size: 16px; }
  .logo .mark { width: 27px; height: 27px; font-size: 15px; border-radius: 6px; }
  .nav-links { display: none; }
  .nav-right { gap: 7px; }
  .nav-user { font-size: 12px; }
  .btn { padding: 8px 14px; font-size: 13px; }
  .btn-sm { padding: 5px 10px; font-size: 12px; }
  .container { padding: 0 14px; }

  .hero { padding: 46px 6px 40px; }
  .hero h1 { font-size: 27px; letter-spacing: 1px; }
  .hero p { font-size: 13px; letter-spacing: 1.5px; margin-bottom: 24px; }
  .hero-badge { font-size: 11.5px; padding: 5px 12px; margin-bottom: 16px; }
  .version-card { width: 100%; padding: 20px 18px; gap: 15px; }
  .version-meta { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .version-meta > div { text-align: center; }
  .version-meta b { font-size: 13px; }
  .version-meta, .version-meta div { font-size: 11.5px; }
  .dl-btn { width: 100%; font-size: 15.5px; padding: 13px 20px; }

  .features { grid-template-columns: 1fr; gap: 12px; margin: 20px 0 4px; }
  .feature { padding: 20px 18px; }
  .feature .ico { width: 38px; height: 38px; font-size: 19px; margin-bottom: 10px; }
  .feature h3 { font-size: 15px; }
  .feature p { font-size: 13px; }

  .section-title { font-size: 16.5px; margin: 30px 0 13px; }
  .card-panel { padding: 16px 15px; border-radius: 12px; }
  .ann-title { font-size: 14px; }
  .ann-content { font-size: 13px; }
  .redeem-row { flex-direction: column; }
  .redeem-row .btn { width: 100%; }

  .modal { padding: 26px 20px; border-radius: 14px; }
  .modal h3 { font-size: 18px; }
  .modal input { padding: 11px 12px; font-size: 15px; }

  .footer { margin-top: 44px; padding: 20px 14px; font-size: 12px; }

  /* 管理后台手机端：侧栏变顶部横条 */
  .admin-wrap { flex-direction: column; }
  .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 0; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar a { border-left: none; border-bottom: 3px solid transparent; padding: 12px 15px; white-space: nowrap; font-size: 13.5px; flex-shrink: 0; }
  .sidebar a.active { border-bottom-color: var(--gold); background: none; }
  .admin-main { padding: 16px 13px; }
  .page-head h2 { font-size: 18px; }
  .stats { gap: 9px; }
  .stat { min-width: calc(50% - 5px); flex: 1 1 44%; padding: 13px 14px; }
  .stat .num { font-size: 20px; }
  .form-row .btn { flex-shrink: 0; }
  .form-row input.inp, .form-row select.inp { flex: 1 1 130px; min-width: 0; }
  /* 表格横向滚动 */
  .card-panel { overflow-x: auto; }
  th, td { padding: 9px 8px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 23px; }
  .version-meta { grid-template-columns: repeat(3, 1fr); }
  .stat { min-width: 100%; }
}
