/* ============================================================
   传奇总代理提卡中心 · 主题样式（暗金）
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0b0a08;
  --bg2: #12100c;
  --panel: #171410;
  --panel2: #1d1913;
  --line: rgba(212, 175, 55, .18);
  --line2: rgba(212, 175, 55, .32);
  --gold: #d4af37;
  --gold2: #f0d67a;
  --red: #a3211d;
  --text: #ece4d4;
  --dim: #9d9280;
  --ok: #3fae6a;
  --bad: #d4534a;
  --warn: #d79a2b;
  --radius: 10px;
}

html, body { min-height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(212, 175, 55, .10), transparent 60%),
    radial-gradient(700px 400px at 0% 100%, rgba(163, 33, 29, .10), transparent 55%),
    linear-gradient(160deg, #0b0a08 0%, #100e0a 55%, #0b0a08 100%);
  background-attachment: fixed;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* ==================== 侧栏 ==================== */
.side {
  position: fixed; inset: 0 auto 0 0; width: 246px; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 22px 14px 18px;
  background: linear-gradient(180deg, rgba(23, 20, 16, .98), rgba(15, 13, 10, .98));
  border-right: 1px solid var(--line);
  z-index: 60; overflow-y: auto;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.brand-mark {
  width: 42px; height: 42px; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 23px; font-weight: 700; color: #1a1206;
  background: linear-gradient(145deg, var(--gold2), #b8912a);
  box-shadow: 0 6px 18px rgba(212, 175, 55, .22);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 15px; letter-spacing: .5px; color: #f3e9d2; }
.brand-text i {
  font-style: normal; font-size: 10px; letter-spacing: 2px;
  color: var(--dim); text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 8px;
  color: #b9ad97; font-size: 14px;
  border: 1px solid transparent;
  transition: .16s;
}
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(212, 175, 55, .06); color: #efe3c8; }
.nav a.on {
  color: #1a1206; font-weight: 600;
  background: linear-gradient(135deg, var(--gold2), #c9a236);
  box-shadow: 0 6px 18px rgba(212, 175, 55, .20);
}
.nav a.on svg { opacity: 1; }

.spacer { flex: 1; min-height: 18px; }

.me {
  border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, rgba(212, 175, 55, .06), rgba(212, 175, 55, .02));
  padding: 12px;
}
.me-top { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "STKaiti", "KaiTi", serif; font-size: 17px; color: #1a1206;
  background: linear-gradient(145deg, var(--gold2), #b8912a);
}
.me-top b { display: block; font-size: 13px; color: #f0e6d0; }
.me-top i { font-style: normal; font-size: 11px; color: var(--dim); }
.me-balance {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--dim);
}
.me-balance b { font-size: 15px; color: var(--gold2); }
.me-links { display: flex; gap: 14px; margin-top: 9px; }
.me-links a { font-size: 12px; color: #9c917c; }
.me-links a:hover { color: var(--gold2); }
.me-links a.out:hover { color: var(--bad); }

/* ==================== 主区 ==================== */
.main {
  margin-left: 246px; min-height: 100vh;
  padding: 28px 34px 64px; max-width: 1320px;
}

.page-head { margin-bottom: 20px; }
.page-head h1 {
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 26px; font-weight: 700; letter-spacing: 2px;
  color: #f5ead0;
}
.page-head h1 em { font-style: normal; color: var(--gold); }
.page-head p { color: var(--dim); font-size: 12.5px; margin-top: 4px; }

.flash {
  padding: 12px 16px; border-radius: 9px; margin-bottom: 18px;
  font-size: 13.5px; border: 1px solid;
}
.flash.ok { color: #9fe0b6; background: rgba(63, 174, 106, .10); border-color: rgba(63, 174, 106, .35); }
.flash.err { color: #f0a8a3; background: rgba(212, 83, 74, .10); border-color: rgba(212, 83, 74, .38); }

/* ==================== 卡片 ==================== */
.card {
  background: linear-gradient(180deg, rgba(29, 25, 19, .92), rgba(21, 18, 14, .92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.card h3 {
  font-size: 15px; font-weight: 600; margin-bottom: 14px;
  color: #efe2c4; display: flex; align-items: center; gap: 8px;
}
.card h3::before {
  content: ''; width: 4px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold2), #a9821f);
}
.card .hint { color: var(--dim); font-size: 12.5px; }
.card.gold { border-color: var(--line2); }

/* ==================== 数据卡 ==================== */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat {
  position: relative; overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
  background: linear-gradient(180deg, rgba(31, 27, 20, .95), rgba(20, 17, 13, .95));
}
.stat::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, .14), transparent 70%);
}
.stat .l { color: var(--dim); font-size: 12px; letter-spacing: .6px; }
.stat .n {
  font-size: 26px; font-weight: 700; margin-top: 6px;
  color: var(--gold2); letter-spacing: .5px;
}
.stat .s { color: #7f7565; font-size: 11.5px; margin-top: 4px; }
.stat.dark .n { color: #e9dfc9; font-size: 22px; }

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-family: inherit; font-weight: 600; cursor: pointer;
  color: #1a1206;
  background: linear-gradient(135deg, var(--gold2), #c19a2f);
  box-shadow: 0 8px 20px rgba(212, 175, 55, .18);
  transition: .16s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: rgba(212, 175, 55, .05); color: #d9c9a3;
  border-color: var(--line2); box-shadow: none;
}
.btn.ghost:hover { background: rgba(212, 175, 55, .10); color: #f3e9d2; }
.btn.danger { background: linear-gradient(135deg, #c34a42, #8f2420); color: #fff; box-shadow: none; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ==================== 表单 ==================== */
label { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px;
  color: var(--text); font-size: 14px; font-family: inherit;
  background: rgba(10, 9, 7, .75);
  border: 1px solid rgba(212, 175, 55, .22);
  border-radius: 8px; outline: none;
  transition: .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .12);
}
input::placeholder, textarea::placeholder { color: #6f6656; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field { margin-bottom: 14px; }
.form-actions { margin-top: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ==================== 表格 ==================== */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
.tb th {
  text-align: left; padding: 10px 12px; color: var(--dim);
  font-weight: 500; font-size: 12px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.tb td { padding: 11px 12px; border-bottom: 1px solid rgba(212, 175, 55, .08); vertical-align: middle; }
.tb tr:last-child td { border-bottom: 0; }
.tb tr:hover td { background: rgba(212, 175, 55, .035); }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; letter-spacing: .3px; }
.muted { color: var(--dim); }
.nowrap { white-space: nowrap; }

/* ==================== 标签 ==================== */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid;
}
.tag.ok { color: #86dcab; background: rgba(63, 174, 106, .10); border-color: rgba(63, 174, 106, .35); }
.tag.bad { color: #f0a8a3; background: rgba(212, 83, 74, .10); border-color: rgba(212, 83, 74, .38); }
.tag.warn { color: #f0cb7c; background: rgba(215, 154, 43, .10); border-color: rgba(215, 154, 43, .35); }
.tag.dim { color: #b3a893; background: rgba(157, 146, 128, .10); border-color: rgba(157, 146, 128, .30); }
.tag.gold { color: #1a1206; background: linear-gradient(135deg, var(--gold2), #c19a2f); border-color: transparent; }

/* ==================== 空状态 ==================== */
.empty { text-align: center; padding: 40px 16px; color: var(--dim); font-size: 13px; }
.empty b { display: block; font-size: 15px; color: #cbbfa6; margin-bottom: 6px; }

/* ==================== 代码框 ==================== */
.code-box {
  width: 100%; min-height: 130px; font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.9; letter-spacing: .6px;
  color: var(--gold2); background: rgba(0, 0, 0, .45);
  border: 1px dashed rgba(212, 175, 55, .35); border-radius: 8px; padding: 14px;
}

/* ==================== 分页 ==================== */
.pager { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.pager a, .pager span {
  padding: 6px 12px; border-radius: 7px; font-size: 12.5px;
  border: 1px solid var(--line); color: var(--dim);
  background: rgba(212, 175, 55, .04);
}
.pager a:hover { color: var(--gold2); border-color: var(--line2); }
.pager .on { color: #1a1206; background: linear-gradient(135deg, var(--gold2), #c19a2f); border-color: transparent; font-weight: 600; }

/* ==================== 移动端 ==================== */
.topbar {
  display: none; position: fixed; top: 0; left: 0; right: 0; height: 54px;
  align-items: center; gap: 12px; padding: 0 14px; z-index: 50;
  background: rgba(15, 13, 10, .92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .burger {
  width: 36px; height: 36px; flex: none; border-radius: 8px;
  border: 1px solid var(--line); background: transparent;
  display: grid; place-items: center; cursor: pointer;
}
.topbar .burger i, .topbar .burger i::before, .topbar .burger i::after {
  display: block; width: 15px; height: 1.8px; border-radius: 2px; background: var(--gold2);
  position: relative;
}
.topbar .burger i::before, .topbar .burger i::after { content: ''; position: absolute; left: 0; }
.topbar .burger i::before { top: -5px; }
.topbar .burger i::after { top: 5px; }
.tb-title { flex: 1; font-family: "STKaiti", "KaiTi", serif; font-size: 15px; color: #f0e5cc; letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-balance { font-size: 13px; font-weight: 700; color: var(--gold2); }

.backdrop {
  display: none; position: fixed; inset: 0; z-index: 55;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.backdrop.on { display: block; }

@media (max-width: 920px) {
  .topbar { display: flex; }
  .side { transform: translateX(-100%); width: 262px; box-shadow: 14px 0 40px rgba(0, 0, 0, .5); }
  .side.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 72px 14px 48px; }
  .page-head h1 { font-size: 21px; }
  .grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat .n { font-size: 21px; }
  .card { padding: 15px; }
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .tb { min-width: 620px; }
  .btn { padding: 10px 16px; }
  input, select, textarea { font-size: 16px; }  /* 手机端避免输入时自动放大 */
}

/* ==================== 登录页 ==================== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 26px 18px;
}
.login-box {
  width: 100%; max-width: 380px;
  border: 1px solid var(--line2); border-radius: 14px;
  background: linear-gradient(180deg, rgba(27, 23, 17, .97), rgba(17, 14, 11, .97));
  padding: 36px 30px 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
}
.login-box .mark {
  width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: "STKaiti", "KaiTi", serif; font-size: 30px; font-weight: 700; color: #1a1206;
  background: linear-gradient(145deg, var(--gold2), #b8912a);
  box-shadow: 0 10px 26px rgba(212, 175, 55, .25);
}
.login-box h1 {
  text-align: center; font-family: "STKaiti", "KaiTi", serif;
  font-size: 21px; letter-spacing: 3px; color: #f5ead0;
}
.login-box .sub { text-align: center; color: var(--dim); font-size: 11px; letter-spacing: 3px; margin: 4px 0 24px; text-transform: uppercase; }
.login-box .field { margin-bottom: 15px; }
.login-box .btn { width: 100%; padding: 12px; font-size: 15px; letter-spacing: 2px; }
.login-foot { text-align: center; color: #6b6252; font-size: 11.5px; margin-top: 20px; line-height: 1.8; }

/* ==================== QQ邮箱 / 验证码输入组 ==================== */
.qq-group {
  display: flex; align-items: center; gap: 8px;
  background: rgba(10, 9, 7, .75);
  border: 1px solid rgba(212, 175, 55, .22);
  border-radius: 8px; padding: 0 12px;
  transition: .15s;
}
.qq-group:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .12);
}
.qq-group input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; box-shadow: none;
  padding: 11px 0;
}
.qq-group input:focus { box-shadow: none; border: 0; background: transparent; }
.qq-suffix { color: var(--dim); font-size: 13px; white-space: nowrap; }

.code-group { display: flex; gap: 8px; align-items: center; }
.code-group input { flex: 1; min-width: 0; }
.code-group .btn { flex: none; height: 42px; padding: 0 14px; }

@media (max-width: 480px) {
  .code-group { flex-wrap: wrap; }
  .code-group .btn { width: 100%; height: 42px; margin-top: 2px; }
}

/* ==================== 首页手机端排版修复 ==================== */
.main > .card,
.main > .grid { width: 100%; }

@media (max-width: 920px) {
  /* 统计卡：余额占整行，下面两张并排 */
  .stats-3 { grid-template-columns: 1fr 1fr; }
  .stats-3 .stat:first-child { grid-column: 1 / -1; }

  /* 快捷操作：整宽卡片 + 2×2 按钮 */
  .quick .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .quick .form-actions .btn { width: 100%; }

  /* 最近提取 / 最近账变：强制单列 */
  .recent-grid { grid-template-columns: 1fr !important; }

  .card { padding: 14px; }
  .empty { padding: 26px 10px; }
  .empty b { font-size: 14px; }
  .table-wrap { width: 100%; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .stats-3 { gap: 9px; }
  .stats-3 .stat { padding: 13px; }
  .stats-3 .stat .n { font-size: 19px; }
  .quick .form-actions .btn { padding: 10px 8px; font-size: 13px; }
}

/* 快捷操作卡片：整宽、内容不溢出 */
.card.quick { width: 100%; height: auto; overflow: visible; }
.quick .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* 购买充值卡链接 */
.buy-link { color: var(--gold2); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.buy-link:hover { color: #fff; }
