/* ============================================================
   kk无限授权 · 黑金主题
   底色近黑 #0b0a08 · 卡片 #15130f · 香槟金 #d4af6a
   ============================================================ */
:root {
  color-scheme: dark;

  --bg:        #0b0a08;
  --card:      #15130f;
  --card-2:    #1b1813;
  --input:     #0e0c09;

  --gold:      #d4af6a;
  --gold-hi:   #f3dca4;
  --gold-lo:   #9c7a3c;
  --gold-grad: linear-gradient(135deg, #f6e2ae 0%, #d4af6a 48%, #a9843f 100%);
  --gold-soft: rgba(212, 175, 106, 0.08);

  --text:      #ece5d4;
  --text-2:    #c4baa3;
  --muted:     #877e6d;
  --line:      rgba(212, 175, 106, 0.14);
  --line-2:    rgba(212, 175, 106, 0.30);

  --ok:        #86c9a5;
  --ok-bg:     rgba(134, 201, 165, 0.09);
  --err:       #e8948d;
  --err-bg:    rgba(232, 148, 141, 0.09);
  --warn:      #e6c27a;
  --warn-bg:   rgba(230, 194, 122, 0.09);

  --radius:    16px;
  --shadow:    0 1px 0 rgba(246, 226, 174, 0.05) inset, 0 24px 48px -12px rgba(0, 0, 0, 0.6);
  --mono:      ui-monospace, "SF Mono", Consolas, "Courier New", monospace;
  --serif:     Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 560px at 50% -180px, rgba(212, 175, 106, 0.11), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: rgba(212, 175, 106, 0.32); color: #fff; }

a { color: var(--gold); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold-hi); }
code {
  background: var(--gold-soft);
  border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 6px;
  font-family: var(--mono); font-size: 13px; color: var(--gold-hi);
  letter-spacing: .3px; word-break: break-all;
}
.muted { color: var(--muted); font-size: 14px; }

/* ============================ 顶部 ============================ */
.hero {
  position: relative; overflow: hidden;
  text-align: center;
  padding: 56px 20px 112px;
  background:
    radial-gradient(560px 280px at 50% 0%, rgba(212, 175, 106, 0.20), transparent 70%),
    linear-gradient(180deg, #15120c 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero::before {               /* 细斜纹 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(212, 175, 106, 0.035) 0 1px, transparent 1px 14px);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 72%);
          mask-image: radial-gradient(ellipse at center, #000 25%, transparent 72%);
}
.hero::after {                /* 底部金线 */
  content: ""; position: absolute; left: 50%; bottom: -1px; width: 220px; height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero-mark { position: relative; display: inline-block; margin-bottom: 14px; filter: drop-shadow(0 6px 18px rgba(212, 175, 106, 0.35)); }
.hero-mark .mark { display: block; }
.hero h1 {
  position: relative; margin: 0 0 12px;
  font-size: 32px; font-weight: 700; letter-spacing: 6px;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .sub {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  color: var(--text-2); font-size: 13px; letter-spacing: 4px;
}
.hero .sub::before, .hero .sub::after { content: ""; width: 44px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.hero .sub::after { transform: scaleX(-1); }
.hero .dot { color: var(--gold); font-size: 8px; }

/* ============================ 容器 / 卡片 ============================ */
.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.pull-up { margin-top: -72px; position: relative; z-index: 2; }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card::before {               /* 顶部高光 */
  content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(246, 226, 174, 0.6), transparent);
}
.card + .card { margin-top: 20px; }
.card-main { padding: 32px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--gold-hi); font-size: 17px; font-weight: 600; letter-spacing: 1.5px;
  margin: 0 0 16px;
}
.brand::before { content: ""; flex: none; width: 3px; height: 1em; border-radius: 2px; background: var(--gold-grad); }
.lead { margin: -6px 0 20px; }

/* ============================ 输入 ============================ */
.query-box { display: flex; gap: 12px; }
.input-wrap { position: relative; flex: 1; }
.input-icon {
  position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%);
  color: var(--gold-lo); pointer-events: none; transition: color .2s;
}
.input-wrap:focus-within .input-icon { color: var(--gold); }

.query-box input,
.form input, .form select, .form textarea,
.filters select, .filters input {
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  outline: none;
  font: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.query-box input {
  width: 100%; height: 54px; padding: 0 18px 0 46px;
  font-family: var(--mono); font-size: 17px; letter-spacing: 2px; text-transform: uppercase;
}
.query-box input::placeholder { text-transform: none; letter-spacing: 1px; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; }
input::placeholder, textarea::placeholder { color: #5c5445; }
.query-box input:focus,
.form input:focus, .form select:focus, .form textarea:focus,
.filters select:focus, .filters input:focus {
  border-color: var(--gold);
  background: #100e0a;
  box-shadow: 0 0 0 4px rgba(212, 175, 106, 0.12);
}

/* ============================ 按钮 ============================ */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 11px;
  border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: 1px;
  cursor: pointer; white-space: nowrap; overflow: hidden;
  transition: transform .08s, box-shadow .2s, background .2s, border-color .2s, color .2s, filter .2s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .75; }
.btn-primary, .btn-pink {
  background: var(--gold-grad);
  color: #1b1408;
  border-color: rgba(246, 226, 174, 0.55);
  box-shadow: 0 8px 22px -6px rgba(212, 175, 106, 0.45), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}
.btn-primary::after, .btn-pink::after {     /* 掠过的光泽 */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg); transition: left .6s ease;
}
.btn-primary:hover, .btn-pink:hover { color: #1b1408; filter: brightness(1.06); }
.btn-primary:hover::after, .btn-pink:hover::after { left: 130%; }
.btn-ghost { background: transparent; color: var(--gold); border-color: var(--line-2); }
.btn-ghost:hover { color: var(--gold-hi); border-color: var(--gold); background: var(--gold-soft); }
.btn-ghost.copied { color: var(--ok); border-color: rgba(134, 201, 165, 0.5); }
.btn-danger { background: transparent; color: var(--err); border-color: rgba(232, 148, 141, 0.32); }
.btn-danger:hover { color: #f4b1ab; border-color: var(--err); background: var(--err-bg); }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 8px; letter-spacing: .5px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn.loading::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(27, 20, 8, 0.3); border-top-color: #1b1408;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ 兑换结果（票券） ============================ */
.ticket {
  position: relative; margin-top: 24px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background:
    radial-gradient(400px 160px at 100% 0%, rgba(212, 175, 106, 0.10), transparent 70%),
    linear-gradient(180deg, #1d1a14, #15130f);
}
.ticket.pop { animation: rise .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }

.ticket-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px 18px; }
.ticket-product { margin-top: 10px; font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: .5px; }
.ticket-meta { text-align: right; flex: none; }
.ticket-meta .k { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.ticket-meta .v { font-family: var(--mono); font-size: 14px; color: var(--text-2); margin-top: 2px; }

.ticket-cut { position: relative; height: 0; border-top: 1px dashed var(--line-2); margin: 0 14px; }
.ticket-cut::before, .ticket-cut::after {          /* 两侧打孔 */
  content: ""; position: absolute; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line-2);
}
.ticket-cut::before { left: -26px; clip-path: inset(0 0 0 50%); }
.ticket-cut::after  { right: -26px; clip-path: inset(0 50% 0 0); }

.ticket-body { padding: 18px 22px 20px; }
.ticket-foot { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 999px;
  font-weight: 600; font-size: 13px; letter-spacing: 1px;
  border: 1px solid transparent;
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status-ok   { background: rgba(212, 175, 106, 0.12); color: var(--gold-hi); border-color: var(--line-2); }
.status-info { background: rgba(236, 229, 212, 0.05); color: var(--text-2); border-color: rgba(236, 229, 212, 0.14); }
.status-err  { background: var(--err-bg);  color: var(--err); }
.status-warn { background: var(--warn-bg); color: var(--warn); }

.content-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; font-size: 12px; color: var(--muted); letter-spacing: 2px;
}
.content-box {
  position: relative;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  white-space: pre-wrap; word-break: break-all;
  font-family: var(--mono); font-size: 15px; line-height: 1.85; color: var(--gold-hi); letter-spacing: .3px;
}
.content-box::before, .content-box::after {        /* 金色描角 */
  content: ""; position: absolute; width: 12px; height: 12px; border: 1.5px solid var(--gold);
}
.content-box::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.content-box::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }
.note-box {
  margin-top: 12px; padding: 12px 16px;
  border-left: 2px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 10px 10px 0;
  color: var(--text-2); font-size: 14px; white-space: pre-wrap;
}

/* ============================ 信息格（后台详情） ============================ */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.info-item .k { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin-bottom: 3px; }
.info-item .v { font-size: 15px; font-weight: 600; color: var(--text); word-break: break-all; }

/* ============================ 使用说明 ============================ */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold); color: var(--gold-hi);
  font-family: var(--serif); font-size: 14px; font-weight: 700;
  background: radial-gradient(circle at 30% 30%, rgba(246, 226, 174, 0.18), rgba(212, 175, 106, 0.04));
}
.step .txt { font-size: 14px; color: var(--text-2); padding-top: 4px; }

/* ============================ 提示 ============================ */
.alert { padding: 12px 16px; border-radius: 11px; font-size: 14px; border: 1px solid transparent; margin-top: 16px; }
.alert:first-child, .card > .alert, .page-head + .alert { margin-top: 0; }
.alert-ok   { background: var(--ok-bg);   color: var(--ok);   border-color: rgba(134, 201, 165, 0.24); }
.alert-err  { background: var(--err-bg);  color: var(--err);  border-color: rgba(232, 148, 141, 0.24); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(230, 194, 122, 0.24); }
.alert a { color: inherit; text-decoration: underline; }

/* ============================ 表单 ============================ */
.form label { display: block; margin-bottom: 16px; font-size: 13px; color: var(--text-2); font-weight: 500; letter-spacing: .5px; }
.form input, .form select, .form textarea { display: block; width: 100%; margin-top: 7px; padding: 11px 13px; font-size: 14px; }
.form textarea { resize: vertical; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form label.check { display: flex; align-items: center; gap: 9px; font-weight: 400; margin-bottom: 12px; cursor: pointer; }
.form label.check input { width: auto; margin: 0; accent-color: var(--gold); }
.form-section {
  display: flex; align-items: baseline; gap: 10px;
  margin: 6px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  color: var(--gold-hi); font-size: 14px; font-weight: 600; letter-spacing: 2px;
}
.form-section .muted { font-size: 12px; font-weight: 400; letter-spacing: 0; }
.form-section ~ .form-section { margin-top: 10px; }
.inline-pair { display: flex; gap: 8px; }
.inline-pair input { margin-top: 7px; }
select option { background: var(--card); color: var(--text); }

/* ============================ 表格 ============================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { background: var(--gold-soft); color: var(--gold); font-weight: 500; font-size: 12px; letter-spacing: 1.5px; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover td { background: rgba(212, 175, 106, 0.035); }
table.data code { background: transparent; border: 0; padding: 0; }
.cell-content { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }

.pill { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; letter-spacing: .5px; border: 1px solid transparent; }
.pill-on  { color: var(--ok);  background: var(--ok-bg);  border-color: rgba(134, 201, 165, 0.24); }
.pill-new { color: var(--gold-hi); background: rgba(212, 175, 106, 0.10); border-color: var(--line-2); }
.pill-off { color: var(--muted); background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); }
.pill-exp { color: var(--err); background: var(--err-bg); border-color: rgba(232, 148, 141, 0.24); }

/* ============================ 后台 ============================ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; height: 64px;
  background: rgba(11, 10, 8, 0.82);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 2px; }
.topbar .logo span { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.topbar nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.topbar nav a, .nav-form button {
  position: relative; padding: 7px 12px; border-radius: 8px;
  color: var(--text-2); font: inherit; font-size: 14px; letter-spacing: 1px;
  background: none; border: 0; cursor: pointer;
}
.topbar nav a:hover, .nav-form button:hover { color: var(--gold-hi); background: var(--gold-soft); }
.topbar nav a.active { color: var(--gold-hi); }
.topbar nav a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gold-grad);
}
.nav-form { margin: 0 0 0 8px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav-form button { color: var(--muted); font-size: 13px; }

.admin-wrap { max-width: 1140px; margin: 28px auto; padding: 0 16px; }
.admin .card .brand { font-size: 15px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.page-head h2 { margin: 0; color: var(--gold-hi); font-size: 20px; font-weight: 600; letter-spacing: 2px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow);
}
.stat::after { content: ""; position: absolute; right: -34px; top: -34px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(212, 175, 106, 0.16), transparent 70%); }
.stat .n { font-family: var(--serif); font-size: 32px; font-weight: 700; line-height: 1.15; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 6px; letter-spacing: 2px; }

.batch-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px; padding: 18px 22px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: radial-gradient(500px 120px at 0% 0%, rgba(212, 175, 106, 0.16), transparent 70%), var(--card);
}
.batch-title { font-size: 16px; color: var(--text); margin-bottom: 2px; }
.batch-title b { font-family: var(--serif); font-size: 22px; color: var(--gold-hi); margin: 0 2px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select, .filters input { padding: 8px 12px; font-size: 14px; }
.filters .spacer { flex: 1; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 18px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { position: relative; padding: 9px 0 9px 28px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.check-list li:last-child { border-bottom: 0; }
.check-list li::before { position: absolute; left: 2px; top: 9px; font-weight: 700; }
.check-list li.ok::before  { content: "✓"; color: var(--ok); }
.check-list li.bad::before { content: "!"; color: var(--warn); left: 6px; }
.check-list li.bad { color: var(--warn); }

.code-block { background: #070605; color: var(--gold-hi); border: 1px solid var(--line); padding: 16px; border-radius: 10px; overflow-x: auto; font-size: 13px; }

/* ============================ 登录 / 安装 ============================ */
.auth-bg {
  background:
    radial-gradient(700px 420px at 50% 0%, rgba(212, 175, 106, 0.16), transparent 70%),
    var(--bg);
}
.auth-box { max-width: 400px; margin: 0 auto; padding: 64px 16px 40px; }
.auth-box-wide { max-width: 560px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head .mark { filter: drop-shadow(0 6px 18px rgba(212, 175, 106, 0.35)); }
.auth-head h1 { margin: 12px 0 2px; font-size: 24px; letter-spacing: 4px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-head p { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: 4px; }
.auth-box .card { padding: 30px; }

.footer { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 2px; padding: 40px 0 32px; }

/* ============================ 手机 ============================ */
@media (max-width: 600px) {
  .hero { padding: 40px 16px 100px; }
  .hero h1 { font-size: 26px; letter-spacing: 4px; }
  .hero .sub { letter-spacing: 2px; gap: 8px; font-size: 12px; }
  .hero .sub::before, .hero .sub::after { width: 20px; }
  .card, .card-main { padding: 20px; }
  .card::before { left: 18px; right: 18px; }
  .query-box { flex-direction: column; }
  .btn-lg { width: 100%; }
  .ticket-top { flex-direction: column; padding: 18px; }
  .ticket-meta { text-align: left; }
  .ticket-body { padding: 16px 18px 18px; }
  .info-grid, .form-grid { grid-template-columns: 1fr; }
  .topbar { position: static; flex-direction: column; align-items: flex-start; height: auto; padding: 12px 16px; gap: 6px; }
  .topbar nav a, .nav-form button { padding: 5px 9px; }
  .nav-form { margin-left: 0; }
  .stat .n { font-size: 26px; }
  .auth-box { padding-top: 40px; }
}
