/* 游戏租号平台 - 全站基础样式（前台 + 后台共用） */
:root {
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-2: #f0f2f8;
    --border: #e3e6ee;
    --text: #1a1d29;
    --text-2: #4b5163;
    --muted: #8a90a2;
    --primary: #5550f0;
    --primary-hover: #4540dc;
    --primary-weak: #eceafe;
    --success: #14915a;
    --success-weak: #e3f6ec;
    --warning: #c27408;
    --warning-weak: #fdf2e0;
    --danger: #d43b3b;
    --danger-weak: #fce9e9;
    --vip: #a76b00;
    --vip-weak: #fbf0d6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 4px 16px rgba(20, 24, 40, .06);
    --shadow-lg: 0 12px 40px rgba(20, 24, 40, .18);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --mono: "SF Mono", Consolas, "Cascadia Mono", Menlo, monospace;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1117;
        --surface: #171a23;
        --surface-2: #1f232f;
        --border: #2a2f3d;
        --text: #e8eaf1;
        --text-2: #b4b9c8;
        --muted: #7c8296;
        --primary: #7c78ff;
        --primary-hover: #918eff;
        --primary-weak: #25234a;
        --success: #3cc985;
        --success-weak: #143326;
        --warning: #f0a53a;
        --warning-weak: #3a2a12;
        --danger: #f06a6a;
        --danger-weak: #3b1a1c;
        --vip: #f2c050;
        --vip-weak: #3a2f12;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
        --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar .container { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), #9b5cf6); color: #fff; font-size: 16px;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav a:hover, .nav a.active { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.avatar {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: var(--primary-weak); color: var(--primary); font-weight: 700; font-size: 12px;
}
@media (max-width: 640px) {
    .topbar .container { gap: 10px; }
    .nav { display: none; }
    .brand span:last-child { display: none; }
    .user-chip .email { display: none; }
    .nav-right { margin-left: auto; }
}

/* ---------- 按钮 / 表单 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
    border: 1px solid transparent; background: var(--surface-2); color: var(--text);
    font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--border); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-weak); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

/* 复制按钮：主色高亮，便于一眼看到 */
.copy-btn {
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    background: var(--primary-weak) !important;
    font-weight: 700;
    letter-spacing: .5px;
}
.copy-btn:hover { background: var(--primary) !important; color: #fff !important; }
.copy-btn:active { transform: translateY(1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
    width: 100%; height: 40px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.captcha-img { height: 48px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border); flex-shrink: 0; background: #fff; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text-2); }

/* ---------- 卡片 / 布局 ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; }
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.section-sub { color: var(--muted); margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 140px; height: 34px; }
.toolbar .spacer { flex: 1; }

/* ---------- 分段选择 ---------- */
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 9px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

/* ---------- 徽标 ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
    border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
    background: var(--surface-2); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.no-dot::before { display: none; }
.b-success { background: var(--success-weak); color: var(--success); }
.b-warning { background: var(--warning-weak); color: var(--warning); }
.b-danger { background: var(--danger-weak); color: var(--danger); }
.b-primary { background: var(--primary-weak); color: var(--primary); }
.b-vip { background: var(--vip-weak); color: var(--vip); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    text-align: left; font-weight: 600; color: var(--muted); font-size: 12px;
    padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table td.wrap { white-space: normal; min-width: 220px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.table td.nowrap, .table th.nowrap { white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.pagination .pages { display: flex; gap: 6px; align-items: center; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .icon { font-size: 34px; margin-bottom: 8px; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask {
    position: fixed; inset: 0; z-index: 200; background: rgba(10, 12, 20, .5);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    animation: fade .15s ease;
}
.modal {
    width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
    background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
    animation: pop .18s ease;
}
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-head h3 { font-size: 17px; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 4px; }
.modal-body { padding: 12px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toast-box { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
    padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--surface);
    box-shadow: var(--shadow-lg); font-weight: 500; animation: pop .18s ease; max-width: calc(100vw - 32px);
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; }
.alert-info { background: var(--primary-weak); color: var(--primary); }
.alert-warning { background: var(--warning-weak); color: var(--warning); }
.alert-success { background: var(--success-weak); color: var(--success); }
.alert-danger { background: var(--danger-weak); color: var(--danger); }

.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 账号凭据 / 令牌 ---------- */
.cred { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 10px; }
.cred .label { width: 72px; flex-shrink: 0; color: var(--muted); font-size: 12px; }
.cred .value { flex: 1; min-width: 0; font-family: var(--mono); font-size: 15px; font-weight: 600; word-break: break-all; }
.totp {
    display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-weak), var(--surface-2)); border: 1px solid var(--border);
}
.totp-code { font-family: var(--mono); font-size: 34px; font-weight: 800; letter-spacing: 6px; color: var(--primary); cursor: pointer; }
.totp-ring { width: 44px; height: 44px; flex-shrink: 0; }
.totp-ring circle { fill: none; stroke-width: 4; }
.totp-ring .bg { stroke: var(--border); }
.totp-ring .fg { stroke: var(--primary); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; transition: stroke-dashoffset 1s linear; }
.totp-ring text { font-size: 13px; font-weight: 700; fill: var(--text-2); text-anchor: middle; dominant-baseline: central; }

.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 32px 16px; }
