/* ============================================================
   星夜 · 鎏金 —— 激活码系统完整样式 v2
   深夜蓝黑底 + 鎏金主色 + 翡翠成功色
   覆盖前台（兑换/票券）与后台（四标签/统计/表格）
   ============================================================ */

:root {
  --bg: #0a0e16;
  --bg2: #0d1220;
  --card: #101726;
  --card2: #131b2e;
  --line: #1d2740;
  --txt: #e8ecf4;
  --dim: #8a93a8;
  --gold: #f2b94e;
  --gold2: #ffd97e;
  --gold-deep: #d99a2b;
  --gold-bg: rgba(242, 185, 78, .08);
  --green: #3ddc97;
  --green-bg: rgba(61, 220, 151, .1);
  --red: #ff7a6e;
  --red-bg: rgba(255, 122, 110, .1);
  --warn: #ffd97e;
  --warn-bg: rgba(255, 217, 126, .08);
  --shadow: 0 10px 34px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 85% -8%, rgba(242, 185, 78, .07), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, rgba(66, 99, 235, .08), transparent 55%),
    var(--bg);
  color: var(--txt);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.75;
}

a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 560px; margin: 0 auto; padding: 34px 16px 44px; }
.wrap.wide { max-width: 1120px; }

/* ---------------- 后台顶栏 ---------------- */
.top {
  display: flex; align-items: center; gap: 13px;
  margin-bottom: 16px;
}
.top .logo {
  width: 46px; height: 46px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 13px; font-weight: 800; font-size: 21px;
  color: #241a04;
  background: linear-gradient(145deg, var(--gold2), var(--gold-deep));
  box-shadow: 0 4px 14px rgba(242, 185, 78, .28);
}
.top .brand .name { font-weight: 700; font-size: 16px; }
.top .brand .slogan { font-size: 12px; color: var(--dim); }
.top .nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top .nav a {
  font-size: 13px; color: var(--dim);
  padding: 6px 12px; border-radius: 10px;
}
.top .nav a:hover { color: var(--txt); background: rgba(255, 255, 255, .05); text-decoration: none; }
.navbtn {
  font-size: 13px; font-family: inherit;
  color: var(--red); background: none;
  border: 1px solid rgba(255, 122, 110, .35); border-radius: 10px;
  padding: 6px 12px; cursor: pointer;
}
.navbtn:hover { background: var(--red-bg); }

/* ---------------- 前台品牌页头 ---------------- */
.masthead { text-align: center; padding: 26px 0 6px; }
.seal {
  width: 74px; height: 74px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px; font-weight: 800; font-size: 34px;
  color: #241a04;
  background: linear-gradient(145deg, var(--gold2), var(--gold-deep));
  box-shadow: 0 8px 26px rgba(242, 185, 78, .3), 0 2px 8px rgba(0, 0, 0, .4);
  animation: breath 3.6s ease-in-out infinite;
}
.mname { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.mslogan { font-size: 13px; color: var(--gold); margin-top: 3px; letter-spacing: 2px; }
.mline {
  width: 64px; height: 2px; margin: 14px auto;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.msteps {
  margin: 0; padding: 0; list-style: none;
  font-size: 12.5px; color: var(--dim); text-align: left;
  display: inline-block;
}
.msteps li { padding-left: 20px; position: relative; margin: 3px 0; }
.msteps li::before {
  content: counter(list-item); counter-increment: list-item;
  position: absolute; left: 0; top: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  font-size: 10px; line-height: 14px; text-align: center;
  color: var(--gold); border: 1px solid rgba(242, 185, 78, .4);
}

/* ---------------- 主体卡片 ---------------- */
.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 26px 24px 30px;
}

.h1 { font-size: 24px; font-weight: 800; margin: 4px 0 6px; letter-spacing: .5px; }
.h2 { font-size: 16px; font-weight: 700; margin: 26px 0 10px; color: var(--gold2); }
.h2::before { content: "◆ "; font-size: 11px; color: var(--gold); }
.sub { color: var(--dim); font-size: 13.5px; margin: 0 0 18px; }
.dim { color: var(--dim); }
.ok { color: var(--green); }
.mono { font-family: "SF Mono", Consolas, "Courier New", monospace; }

/* ---------------- 提示条 ---------------- */
.alert {
  border-radius: 13px; padding: 11px 15px;
  font-size: 13.5px; margin: 12px 0;
  border: 1px solid;
}
.alert.err  { color: #ffc2bc; background: var(--red-bg);  border-color: rgba(255, 122, 110, .4); }
.alert.ok   { color: #b5f2d4; background: var(--green-bg); border-color: rgba(61, 220, 151, .4); }
.alert.warn { color: #ffe7b3; background: var(--warn-bg); border-color: rgba(255, 217, 126, .4); }

/* ---------------- 仪式线 / 标签 ---------------- */
.rite { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.rite .tag {
  font-size: 12px; color: var(--gold);
  border: 1px solid rgba(242, 185, 78, .45);
  border-radius: 99px; padding: 3px 12px;
  letter-spacing: 1px; white-space: nowrap;
}
.rite .rule { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(242, 185, 78, .35), transparent); }

/* ---------------- 表单（三步框） ---------------- */
.framed { position: relative; border: 1px dashed rgba(242, 185, 78, .3); border-radius: 18px; padding: 20px 18px 6px; margin: 16px 0; }
.framed::before, .framed::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border-color: var(--gold); border-style: solid; opacity: .55;
}
.framed::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: 14px; }
.framed::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: 14px; }

.fgroup { display: flex; gap: 12px; margin-bottom: 18px; }
.fnum {
  flex: none; width: 26px; height: 26px; margin-top: 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 13px; font-weight: 700;
  color: #241a04; background: linear-gradient(145deg, var(--gold2), var(--gold-deep));
}
.fbody { flex: 1; min-width: 0; }
.f { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.fdesc { display: block; font-size: 12px; color: var(--dim); font-weight: 400; margin-top: 1px; }

.input {
  width: 100%;
  font-size: 15px; font-family: inherit; color: var(--txt);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line); border-radius: 13px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 185, 78, .14); }
.input::placeholder { color: #5a6377; }
.input.sm { width: auto; max-width: 220px; font-size: 13px; padding: 6px 10px; border-radius: 9px; }
select.input { cursor: pointer; }
select.input option { background: var(--card); color: var(--txt); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-block;
  font-size: 14.5px; font-weight: 700; font-family: inherit;
  color: #241a04; border: none; border-radius: 13px;
  padding: 11px 22px; margin-top: 10px;
  cursor: pointer;
  background: linear-gradient(145deg, var(--gold2), var(--gold-deep));
  box-shadow: 0 6px 18px rgba(242, 185, 78, .22);
  transition: transform .12s, box-shadow .18s, filter .18s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; box-shadow: 0 8px 22px rgba(242, 185, 78, .3); }
.btn:active { transform: scale(.97); }
.btn.ghost {
  background: none; color: var(--gold2);
  border: 1px solid rgba(242, 185, 78, .4); box-shadow: none;
}
.btn.ghost:hover { background: var(--gold-bg); }
.btn.sm { font-size: 12.5px; padding: 5px 13px; border-radius: 9px; margin-top: 0; }
.xsubmit { width: 100%; margin-top: 4px; animation: breath 3.6s ease-in-out infinite; }

.form-inline { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.form-inline .input { width: auto; flex: 0 1 auto; min-width: 120px; font-size: 14px; padding: 8px 12px; margin-top: 0; }
.form-inline .btn { margin-top: 0; }
.editrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }

/* ---------------- 成功票券 ---------------- */
.done-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.done-badge {
  flex: none; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 22px; font-weight: 800;
  color: #05261a; background: linear-gradient(145deg, #6ff0bb, #17b877);
  box-shadow: 0 6px 18px rgba(61, 220, 151, .35);
  animation: pop .4s cubic-bezier(.34, 1.56, .64, 1);
}
.meta-line { font-size: 13px; color: var(--dim); margin: 4px 0 0; }

.ticket {
  position: relative; overflow: hidden;
  text-align: center;
  border: 1px solid rgba(242, 185, 78, .5);
  border-radius: 20px;
  background:
    radial-gradient(500px 200px at 50% -40%, rgba(242, 185, 78, .12), transparent),
    var(--card2);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(242, 185, 78, .12);
  padding: 20px 16px 22px;
  margin: 16px 0;
  animation: rise .5s ease;
}
.tlabel { font-size: 12px; letter-spacing: 4px; color: var(--gold); }
.codebig {
  display: inline-flex; gap: 16px; margin-top: 10px;
  cursor: pointer; position: relative;
  font-size: clamp(38px, 11vw, 52px);
  font-weight: 800; letter-spacing: 4px;
  font-family: "SF Mono", Consolas, monospace;
  color: var(--gold2);
  text-shadow: 0 2px 18px rgba(242, 185, 78, .35);
}
.codebig .seg { padding: 0 6px; }
.codebig::after {
  content: ""; position: absolute; top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 224, 150, .22), transparent);
  animation: shine 2.8s linear infinite;
}
.sep { width: 100%; height: 1px; margin: 16px auto 10px; background: linear-gradient(90deg, transparent, rgba(242, 185, 78, .4), transparent); }
.thint { font-size: 12.5px; color: var(--dim); margin: 0; }

/* ---------------- 步骤 / 提示 / Toast ---------------- */
.steps { margin: 18px 0 0; padding-left: 0; list-style: none; font-size: 13.5px; }
.steps li { position: relative; padding-left: 34px; margin: 9px 0; counter-increment: step; }
.steps { counter-reset: step; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
  color: var(--gold); border: 1.5px solid rgba(242, 185, 78, .5);
}
.tip { font-size: 12.5px; color: var(--dim); margin: 16px 0 0; }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: rgba(20, 27, 46, .96); border: 1px solid rgba(242, 185, 78, .5);
  color: var(--gold2); font-size: 13.5px;
  border-radius: 12px; padding: 10px 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 99; box-shadow: var(--shadow);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 行布局 ---------------- */
.row { display: flex; gap: 10px; align-items: center; }
.row .btn { margin-top: 0; }
.between { justify-content: space-between; }

/* ---------------- 统计卡 ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 4px; }
.stat {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 15px; padding: 13px 8px 11px; text-align: center;
}
.stat .k { font-size: 11.5px; color: var(--dim); }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 2px; }
.stat .v.ok { color: var(--green); }

/* ---------------- 表格 ---------------- */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--gold);
  font-size: 12px; white-space: nowrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
  position: sticky; top: 0;
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid rgba(255, 255, 255, .04); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255, 255, 255, .025); }

.badge {
  display: inline-block; font-size: 11.5px;
  border-radius: 99px; padding: 2px 11px; white-space: nowrap;
  border: 1px solid;
}
.badge.free { color: var(--green); background: var(--green-bg); border-color: rgba(61, 220, 151, .4); }
.badge.used { color: var(--dim); background: rgba(255, 255, 255, .04); border-color: var(--line); }
.actcode { color: var(--green); font-weight: 600; }

/* 点击即复制的码 */
.cp { cursor: pointer; border-bottom: 1px dashed rgba(242, 185, 78, .5); }
.cp:hover { color: var(--gold2); }

/* ---------------- 后台标签页 ---------------- */
.atabs { display: flex; gap: 7px; margin: 14px 0 18px; flex-wrap: wrap; }
.atab {
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  color: var(--dim); background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 7px 18px; cursor: pointer;
  transition: all .15s;
}
.atab:hover { color: var(--txt); }
.atab.on {
  color: #241a04; background: linear-gradient(145deg, var(--gold2), var(--gold-deep));
  border-color: transparent; box-shadow: 0 4px 14px rgba(242, 185, 78, .25);
}
.panel { display: none; }
.panel.on { display: block; animation: rise .3s ease; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

/* ---------------- 页脚 ---------------- */
.foot {
  text-align: center; font-size: 12px; color: var(--dim);
  margin-top: 22px; display: flex; flex-direction: column; gap: 2px;
}
.foot .mono { color: var(--gold2); }

/* ---------------- 公告弹窗 ---------------- */
.notice-mask {
  display: none;
  position: fixed; inset: 0; z-index: 999;
  background: rgba(4, 7, 14, .66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.notice-mask.on { display: flex; animation: rise .25s ease; }
.notice-box {
  position: relative; width: 100%; max-width: 400px;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid rgba(242, 185, 78, .55);
  border-radius: 20px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(242, 185, 78, .12);
  padding: 22px 22px 20px;
  text-align: center;
}
.notice-box::before {
  content: ""; position: absolute; top: -1px; left: 24px; right: 24px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
}
.notice-head { font-size: 16px; font-weight: 800; color: var(--gold2); letter-spacing: 1px; }
.notice-body { font-size: 13.5px; color: var(--txt); line-height: 1.8; margin: 12px 0 16px; text-align: left; }
.notice-qqrow { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 12px; }
.notice-qq {
  font-size: 24px; font-weight: 800; letter-spacing: 2px;
  color: var(--gold2);
  background: var(--gold-bg);
  border: 1px dashed rgba(242, 185, 78, .5);
  border-radius: 12px; padding: 8px 18px;
}
.notice-close { width: 100%; }

/* ---------------- 动画 ---------------- */
@keyframes breath { 0%, 100% { opacity: 1; } 50% { opacity: .88; } }
@keyframes shine { to { left: 130%; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .wrap { padding: 22px 12px 34px; }
  .card { padding: 20px 16px 24px; border-radius: 20px; }
  .input { font-size: 16px; }          /* 防 iOS 聚焦缩放 */
  .btn { min-height: 44px; }
  .btn.sm { min-height: 30px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .codebig { gap: 10px; }
  .form-inline .input { min-width: 100px; }
  .top .nav a { padding: 5px 9px; }
}
@media (min-width: 880px) {
  .wrap { display: grid; grid-template-columns: 250px minmax(420px, 600px); gap: 26px; align-items: start; padding: 60px 24px 60px; }
  .wrap.wide { display: block; max-width: 1120px; }
  .masthead { position: sticky; top: 40px; padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
