/* ============================================================
   Nexus API · User App Styles
   ============================================================ */
:root {
  --bg: #0b0d10;
  --bg-soft: #0f1216;
  --card: #14181f;
  --card-2: #1a2029;
  --line: rgba(226, 232, 240, .08);
  --line-2: rgba(226, 232, 240, .16);
  --text: #e8edf4;
  --muted: #8b98ab;
  --muted-2: #5c697c;
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --violet: #a78bfa;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 10px;
  --shadow: 0 10px 32px rgba(0, 0, 0, .45);
  --grad: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a3342; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--accent-2); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: .16s;
  background: #1c222c; color: var(--text); white-space: nowrap;
}
.btn:hover { background: #242c38; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-2); color: #fff; }
.btn-primary:hover { background: #0b96d5; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); background: rgba(56, 189, 248, .08); }
.btn-danger { background: rgba(248, 113, 113, .1); color: #fca5a5; border-color: rgba(248, 113, 113, .25); }
.btn-danger:hover { background: rgba(248, 113, 113, .18); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-link { background: none; border: none; color: var(--accent-2); cursor: pointer; font-size: 12.5px; padding: 0 4px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: #fca5a5; }

.card {
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title h3 svg { color: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  font-size: 11.5px; font-weight: 600; border-radius: 20px; line-height: 1.4;
}
.badge-green { background: rgba(16, 185, 129, .12); color: #34d399; border: 1px solid rgba(16,185,129,.25); }
.badge-red { background: rgba(244, 63, 94, .12); color: #fb7185; border: 1px solid rgba(244,63,94,.25); }
.badge-amber { background: rgba(245, 158, 11, .12); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
.badge-blue { background: rgba(91, 124, 250, .14); color: #93a8ff; border: 1px solid rgba(91,124,250,.3); }
.badge-purple { background: rgba(139, 92, 246, .14); color: #b79cff; border: 1px solid rgba(139,92,246,.3); }
.badge-gray { background: rgba(148, 163, 184, .1); color: var(--muted); border: 1px solid var(--line); }

.tag-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-2);
  background: #0d1117; color: var(--text); font-size: 13.5px; outline: none; transition: .15s;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: #48566b; }
select.input option { background: #10151d; }

.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.tbl th {
  text-align: left; padding: 11px 14px; background: rgba(148,163,184,.06);
  color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: .15s; }
table.tbl tbody tr:hover { background: rgba(91, 124, 250, .05); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted-2); }
.empty .e-icon { font-size: 34px; margin-bottom: 10px; opacity: .6; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 18px; right: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 12px;
  background: #17203a; border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-size: 13.5px; display: flex; align-items: center; gap: 10px;
  animation: slideIn .25s cubic-bezier(.2,.9,.3,1.2);
}
.toast.ok { border-color: rgba(16,185,129,.4); }
.toast.err { border-color: rgba(244,63,94,.4); }
.toast.info { border-color: rgba(91,124,250,.4); }
.toast .t-ico { font-size: 16px; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { min-height: 100vh; display: flex; }
.auth-left {
  flex: 1.05; position: relative; overflow: hidden; display: flex; flex-direction: column;
  justify-content: center; padding: 64px;
  background:
    linear-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .045) 1px, transparent 1px),
    radial-gradient(900px 480px at 18% -8%, rgba(14, 165, 233, .12), transparent 55%),
    linear-gradient(160deg, #0e1116 0%, #0b0d10 100%);
  background-size: 44px 44px, 44px 44px, auto, auto;
}
.auth-left .inner { position: relative; z-index: 2; max-width: 520px; }
.brand-line { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.logo-box {
  width: 42px; height: 42px; border-radius: 9px; background: #0c1118;
  border: 1px solid rgba(56, 189, 248, .45);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800;
  color: var(--accent); font-family: Consolas, monospace;
}
.brand-line .b-name { font-size: 19px; font-weight: 800; letter-spacing: .4px; }
.brand-line .b-sub { font-size: 11px; color: var(--muted-2); font-family: Consolas, monospace; letter-spacing: 1.5px; }
.auth-left h1 { font-size: 30px; line-height: 1.4; font-weight: 800; margin-bottom: 14px; }
.auth-left h1 .hl { color: var(--accent); }
.auth-left p.lead { color: var(--muted); font-size: 13.5px; line-height: 2; margin-bottom: 36px; }
.auth-stats { display: flex; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: rgba(12, 17, 24, .7); }
.auth-stats .as { flex: 1; padding: 14px 16px; border-right: 1px solid var(--line); }
.auth-stats .as:last-child { border-right: none; }
.auth-stats .as b { display: block; font-size: 18px; color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
.auth-stats .as span { font-size: 11px; color: var(--muted-2); }
.auth-right {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px;
  background: var(--bg);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card .ac-head { text-align: center; margin-bottom: 26px; }
.auth-card .ac-head .logo-box { margin: 0 auto 16px; width: 54px; height: 54px; }
.auth-card .ac-head h2 { font-size: 22px; font-weight: 800; }
.auth-card .ac-head p { color: var(--muted-2); margin-top: 6px; font-size: 13px; }
.auth-tabs {
  display: flex; background: #0d1117; border: 1px solid var(--line); border-radius: 9px; padding: 4px; margin-bottom: 24px;
}
.auth-tabs button {
  flex: 1; padding: 9px; border: none; background: transparent; color: var(--muted);
  font-size: 13.5px; font-weight: 600; border-radius: 6px; cursor: pointer; transition: .18s;
}
.auth-tabs button.on { background: var(--accent-2); color: #fff; }
.cap-row { display: flex; gap: 10px; align-items: center; }
.cap-row .input { flex: 1; }
.cap-row .cap-img { cursor: pointer; border-radius: 10px; border: 1px solid var(--line-2); display: block; }
.auth-extra { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px; font-size: 12.5px; color: var(--muted); }
.auth-extra .chk { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.auth-submit { width: 100%; padding: 12px; font-size: 15px; }
.auth-note { text-align: center; color: var(--muted-2); font-size: 12px; margin-top: 18px; line-height: 1.8; }
.auth-demo {
  margin-top: 20px; padding: 12px 14px; border-radius: 10px; font-size: 12.5px;
  background: rgba(91,124,250,.07); border: 1px dashed rgba(91,124,250,.35); color: var(--muted); line-height: 1.9;
}
.auth-demo b { color: var(--accent-2); }

/* 模拟收件箱 */
.inbox-pop {
  position: fixed; top: 74px; right: 22px; width: 350px; z-index: 999;
  background: #131c31; border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; animation: slideIn .3s;
}
.inbox-pop .ip-head { display: flex; align-items: center; gap: 10px; padding: 13px 15px; background: rgba(91,124,250,.1); border-bottom: 1px solid var(--line); }
.inbox-pop .ip-head .dot { width: 9px; height: 9px; background: var(--green); border-radius: 50%; box-shadow: 0 0 8px var(--green); }
.inbox-pop .ip-head b { font-size: 13.5px; flex: 1; }
.inbox-pop .ip-head .x { cursor: pointer; color: var(--muted-2); font-size: 15px; padding: 2px 6px; }
.inbox-pop .ip-body { padding: 14px 16px; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.inbox-pop .ip-body .mail-box {
  margin: 10px 0; padding: 14px; background: #0c1322; border-radius: 10px; border: 1px solid var(--line);
}
.inbox-pop .ip-body .code-big { font-size: 22px; font-weight: 800; letter-spacing: 5px; color: var(--accent-2); text-align: center; padding: 6px 0; font-variant-numeric: tabular-nums; }
.inbox-pop .ip-body .mail-foot { text-align: center; color: var(--muted-2); font-size: 11px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex-shrink: 0; background: var(--bg-soft); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.sb-brand .logo-box { width: 30px; height: 30px; font-size: 15px; border-radius: 7px; }
.sb-brand .t { font-weight: 800; font-size: 14.5px; }
.sb-brand .t small { display: block; font-weight: 500; font-size: 10px; color: var(--muted-2); letter-spacing: .8px; font-family: Consolas, monospace; }
.sb-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.sb-nav .nav-sec { font-size: 10.5px; color: var(--muted-2); letter-spacing: 1.5px; padding: 14px 10px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 2px;
  transition: .14s; border: 1px solid transparent; position: relative;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: rgba(56, 189, 248, .07); color: var(--text); }
.nav-item.on {
  background: rgba(14, 165, 233, .12);
  color: #fff; border-color: rgba(56, 189, 248, .22);
}
.nav-item.on::before { content: ''; position: absolute; left: -12px; top: 20%; bottom: 20%; width: 3px; border-radius: 3px; background: var(--accent-2); }
.sb-foot { padding: 14px; border-top: 1px solid var(--line); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.avatar {
  width: 30px; height: 30px; border-radius: 8px; background: #1c2530; border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent); font-size: 12.5px; flex-shrink: 0;
}
.sb-user .u-info { flex: 1; min-width: 0; }
.sb-user .u-info .n { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .u-info .m { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 26px;
  border-bottom: 1px solid var(--line); background: rgba(10,14,23,.8); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.tb-title { font-size: 16.5px; font-weight: 800; }
.tb-title small { display: block; font-size: 11px; color: var(--muted-2); font-weight: 500; margin-top: 2px; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.balance-chip {
  display: flex; align-items: center; gap: 9px; padding: 6px 12px; border-radius: 8px;
  background: #10151c; border: 1px solid rgba(56, 189, 248, .3); cursor: pointer; transition: .15s;
}
.balance-chip:hover { border-color: var(--accent); }
.balance-chip .b-ico { width: 20px; height: 20px; border-radius: 6px; background: var(--accent-2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.balance-chip .b-val { font-weight: 800; font-size: 13.5px; color: #fff; font-variant-numeric: tabular-nums; }
.balance-chip .b-txt { font-size: 10px; color: var(--muted); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); background: rgba(91,124,250,.1); }

.content { padding: 24px 26px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------- 仪表盘 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 16px 20px; position: relative;
}
.stat-card::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--sc, var(--accent-2)); opacity: .85; }
.stat-card .s-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.stat-card .s-value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-card .s-value small { font-size: 12.5px; font-weight: 600; color: var(--muted-2); }
.stat-card .s-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 7px; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-legend { display: flex; flex-direction: column; gap: 10px; }
.chart-legend .lg-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); }
.chart-legend .lg-item .nm { flex: 1; }
.chart-legend .lg-item b { color: var(--text); }
.home-greet { margin-bottom: 18px; }
.home-greet h2 { font-size: 21px; font-weight: 800; }
.home-greet p { color: var(--muted); margin-top: 5px; font-size: 13.5px; }
.announce {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 10px;
  background: #141a23; border-left: 3px solid var(--accent-2); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-bottom: 20px; font-size: 13px; color: var(--text); line-height: 1.75;
}
.announce .a-ico { font-size: 15px; margin-top: 1px; color: var(--accent); }

/* ---------- 模型广场 ---------- */
.filter-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tabs button {
  padding: 8px 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: .16s;
}
.filter-tabs button:hover { border-color: var(--accent); color: var(--text); }
.filter-tabs button.on { background: var(--grad); border-color: transparent; color: #fff; }
.search-box { flex: 1; min-width: 200px; max-width: 300px; position: relative; }
.search-box .input { padding-left: 36px; }
.search-box .s-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 16px; }
.model-card {
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: .16s; position: relative;
  display: flex; flex-direction: column; gap: 12px;
}
.model-card:hover { transform: translateY(-2px); border-color: rgba(56, 189, 248, .4); }
.model-card .mc-top { display: flex; align-items: center; gap: 12px; }
.model-ico {
  width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff; flex-shrink: 0;
  background: var(--mc, #0ea5e9);
}
.model-card .mc-title { flex: 1; min-width: 0; }
.model-card .mc-title b { font-size: 14px; display: block; }
.model-card .mc-title span { font-size: 11.5px; color: var(--muted-2); font-family: Consolas, monospace; }
.model-card .mc-desc { font-size: 12.5px; color: var(--muted); line-height: 1.7; min-height: 42px; }
.model-card .mc-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.mc-meta span { font-size: 11px; color: var(--muted); background: rgba(148,163,184,.08); padding: 3px 8px; border-radius: 6px; }
.model-card .mc-price { display: flex; gap: 16px; padding: 9px 11px; background: #0f1319; border: 1px solid var(--line); border-radius: 8px; }
.model-card .mc-price .p { flex: 1; }
.model-card .mc-price .p small { display: block; font-size: 10.5px; color: var(--muted-2); margin-bottom: 3px; }
.model-card .mc-price .p b { font-size: 13.5px; }
.model-card .mc-price .p b em { font-style: normal; font-size: 10px; color: var(--muted-2); font-weight: 500; }
.model-card .mc-foot { display: flex; gap: 8px; }
.model-card .mc-foot .btn { flex: 1; }

/* ---------- 对话 ---------- */
.play-layout { display: grid; grid-template-columns: 250px 1fr; gap: 16px; height: calc(100vh - 190px); min-height: 480px; }
.play-side { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.play-side .card { padding: 16px; }
.ps-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.model-opt {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; transition: .15s;
  border: 1px solid transparent; margin-bottom: 4px;
}
.model-opt:hover { background: rgba(91,124,250,.08); }
.model-opt.on { background: rgba(91,124,250,.14); border-color: rgba(91,124,250,.35); }
.model-opt .mo-ico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff; flex-shrink: 0; background: var(--mc, #5b7cfa); }
.model-opt .mo-info { flex: 1; min-width: 0; }
.model-opt .mo-info b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-opt .mo-info span { font-size: 11px; color: var(--muted-2); }
.chat-panel {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; position: relative;
}
.chat-head {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.chat-head .ch-model { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; }
.chat-head .ch-model .mo-ico { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 800; color: #fff; background: var(--mc, #5b7cfa); }
.chat-head .ch-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chat-body { flex: 1; overflow-y: auto; padding: 24px; }
.msg { display: flex; gap: 12px; margin-bottom: 22px; animation: fadeUp .25s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg .m-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 800;
}
.msg.user .m-avatar { background: #16202c; color: var(--accent); border: 1px solid rgba(56, 189, 248, .35); }
.msg.ai .m-avatar { background: #0ea5e9; color: #fff; }
.msg .m-main { flex: 1; min-width: 0; }
.msg .m-name { font-size: 12px; color: var(--muted-2); margin-bottom: 5px; font-weight: 600; }
.msg .m-bubble {
  background: #10151d; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-size: 13.5px; line-height: 1.85; color: var(--text); word-break: break-word; position: relative;
}
.msg.ai .m-bubble { background: rgba(14, 165, 233, .05); border-color: rgba(56, 189, 248, .15); }
.msg.user .m-bubble { background: #171e28; border-color: rgba(56, 189, 248, .2); }
.m-bubble p { margin: 6px 0; }
.m-bubble h1, .m-bubble h2, .m-bubble h3 { margin: 10px 0 6px; font-size: 15px; }
.m-bubble ul, .m-bubble ol { padding-left: 20px; margin: 6px 0; }
.m-bubble li { margin: 3px 0; }
.m-bubble code.inline { background: rgba(148,163,184,.15); padding: 1.5px 6px; border-radius: 5px; font-family: Consolas, monospace; font-size: 12.5px; color: #93a8ff; }
.m-bubble pre {
  background: #0a101d; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  overflow-x: auto; margin: 8px 0; font-family: Consolas, monospace; font-size: 12.5px; line-height: 1.6; color: #c9d6f0;
}
.m-bubble pre code { font-family: inherit; }
.m-bubble blockquote { border-left: 3px solid var(--accent); padding: 4px 12px; margin: 8px 0; color: var(--muted); background: rgba(91,124,250,.06); border-radius: 0 8px 8px 0; }
.m-bubble table { border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.m-bubble th, .m-bubble td { border: 1px solid var(--line-2); padding: 6px 10px; }
.reason-box {
  margin-bottom: 10px; border: 1px dashed rgba(167, 139, 250, .4); border-radius: 8px; overflow: hidden; background: rgba(167, 139, 250, .04);
}
.reason-box summary { padding: 8px 13px; cursor: pointer; font-size: 12px; color: #c4b5fd; font-weight: 600; user-select: none; }
.reason-box .r-body { padding: 4px 13px 12px; font-size: 12.5px; color: var(--muted); line-height: 1.8; white-space: pre-wrap; border-top: 1px dashed rgba(167, 139, 250, .25); }
.m-foot { display: flex; gap: 14px; margin-top: 8px; font-size: 11.5px; color: var(--muted-2); align-items: center; }
.m-foot .copy-btn { color: var(--muted-2); cursor: pointer; background: none; border: none; font-size: 11.5px; }
.m-foot .copy-btn:hover { color: var(--accent-2); }
.typing-dots { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.chat-input-bar { border-top: 1px solid var(--line); padding: 14px 18px; background: rgba(255,255,255,.02); }
.chat-input-bar .ci-wrap {
  display: flex; align-items: flex-end; gap: 10px; background: #0d1117; border: 1px solid var(--line-2);
  border-radius: 10px; padding: 10px 11px 10px 15px; transition: .16s;
}
.chat-input-bar .ci-wrap:focus-within { border-color: var(--accent); }
.chat-input-bar textarea {
  flex: 1; background: none; border: none; outline: none; color: var(--text); resize: none;
  font-size: 13.5px; line-height: 1.6; max-height: 160px; min-height: 24px;
}
.chat-input-bar .ci-send {
  width: 34px; height: 34px; border-radius: 8px; border: none; background: var(--accent-2); color: #fff;
  font-size: 15px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: .15s;
}
.chat-input-bar .ci-send:hover { background: #0b96d5; }
.chat-input-bar .ci-send svg { width: 16px; height: 16px; }
.chat-input-bar .ci-send:disabled { opacity: .4; cursor: not-allowed; }
.ci-tip { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--muted-2); }
.sample-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.sample-chip {
  font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 18px;
  padding: 5px 13px; cursor: pointer; transition: .15s; background: transparent;
}
.sample-chip:hover { color: #fff; border-color: var(--accent); background: rgba(91,124,250,.1); }

/* ---------- 密钥 / 日志 ---------- */
.key-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); margin-bottom: 12px; transition: .15s;
}
.key-item:hover { border-color: var(--line-2); }
.key-item .k-ico { width: 38px; height: 38px; border-radius: 10px; background: rgba(91,124,250,.12); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.key-item .k-info { flex: 1; min-width: 0; }
.key-item .k-info .n { font-weight: 700; font-size: 13.5px; }
.key-item .k-info .s { font-family: Consolas, monospace; font-size: 12px; color: var(--muted); margin-top: 3px; }
.key-item .k-info .m { font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.code-block {
  background: #0c0f14; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 14px;
}
.code-block .cb-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; background: rgba(148,163,184,.06); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.code-block pre { padding: 14px 16px; overflow-x: auto; font-family: Consolas, monospace; font-size: 12.3px; line-height: 1.7; color: #c9d6f0; }

/* ---------- 钱包 ---------- */
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wallet-balance { position: relative; overflow: hidden; border-radius: var(--radius); padding: 24px; background: linear-gradient(135deg, rgba(14,165,233,.14), rgba(37,99,235,.06)), var(--card); border: 1px solid rgba(56, 189, 248, .28); }
.wallet-balance::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(34,211,238,.16); right: -70px; top: -70px; filter: blur(40px); }
.wallet-balance .w-label { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.wallet-balance .w-val { font-size: 38px; font-weight: 800; }
.wallet-balance .w-val small { font-size: 16px; color: var(--muted-2); font-weight: 600; }
.wallet-balance .w-plan { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 14px; }
.amount-grid button {
  padding: 11px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card);
  color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; transition: .15s;
}
.amount-grid button:hover { border-color: var(--accent); }
.amount-grid button.on { background: rgba(91,124,250,.18); border-color: var(--accent); color: #fff; }
.pay-methods { display: flex; gap: 10px; margin-bottom: 16px; }
.pay-method {
  flex: 1; padding: 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--card);
  cursor: pointer; text-align: center; transition: .15s;
}
.pay-method .pm-ico { font-size: 21px; margin-bottom: 5px; }
.pay-method .pm-name { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pay-method.on { border-color: var(--accent); background: rgba(91,124,250,.14); }
.pay-method.on .pm-name { color: #fff; }

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4,8,18,.7); backdrop-filter: blur(6px);
  z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .18s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 460px; background: #151a23; border: 1px solid var(--line-2);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; animation: pop .2s;
  max-height: 90vh; display: flex; flex-direction: column;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.wide { max-width: 600px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal-head b { font-size: 15.5px; }
.modal-head .x { cursor: pointer; color: var(--muted-2); font-size: 18px; padding: 2px 6px; border-radius: 6px; }
.modal-head .x:hover { color: var(--text); background: rgba(148,163,184,.1); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 15px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: rgba(255,255,255,.02); }

/* 二维码 */
.qr-box { display: flex; flex-direction: column; align-items: center; padding: 6px 0 2px; }
.qr-box svg { border-radius: 12px; background: #fff; padding: 10px; }
.qr-box .qr-amt { font-size: 24px; font-weight: 800; margin: 12px 0 4px; }
.qr-box .qr-tip { color: var(--muted-2); font-size: 12px; }
.count-down { color: var(--amber); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 个人中心 ---------- */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.secret-box {
  display: flex; align-items: center; gap: 10px; background: #0d1117; border: 1px dashed rgba(56, 189, 248, .45);
  border-radius: 8px; padding: 11px 13px;
}
.secret-box code { flex: 1; font-family: Consolas, monospace; font-size: 12.5px; color: var(--accent); word-break: break-all; }
.secret-box .btn { flex-shrink: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .wallet-grid, .profile-grid { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .play-layout { grid-template-columns: 1fr; }
  .play-side { flex-direction: row; overflow-x: auto; }
  .play-side .card { min-width: 240px; }
}
@media (max-width: 640px) {
  .sidebar { width: 64px; }
  .sidebar .sb-brand .t, .nav-item span, .sb-user .u-info, .sb-foot { display: none; }
  .nav-item { justify-content: center; }
  .content { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr; }
}
