/* ==========================================================
   《坑走大坏蛋killui的功德》统一风格
   - 配色：暗夜金（黑底 + 金色点缀 + 暖白文字）
   - 字体：系统无衬线
   ========================================================== */

:root {
    --bg-0: #0c0e10;
    --bg-1: #15181c;
    --bg-2: #1d2126;
    --bg-3: #262b32;
    --fg-0: #f5ecd0;
    --fg-1: #c9bf9c;
    --fg-2: #8a8369;
    --gold: #d4af37;
    --gold-soft: #b8932c;
    --gold-glow: rgba(212, 175, 55, 0.35);
    --danger: #e5484d;
    --success: #4caf7d;
    --warning: #e8a93c;
    --info: #6cb6ff;
    --border: rgba(212, 175, 55, 0.18);
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 30px rgba(212, 175, 55, 0.18);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --font-mono: "JetBrains Mono", "Sarasa Mono SC", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font-sans);
    background: radial-gradient(ellipse at top, #1a1d22 0%, var(--bg-0) 60%);
    color: var(--fg-0);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; transition: color .15s; }
a:hover { color: var(--fg-0); text-shadow: 0 0 8px var(--gold-glow); }

button, input, textarea, select {
    font-family: inherit; font-size: inherit; color: inherit;
}
button { cursor: pointer; }

/* ---------- 通用按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--gold-soft);
    background: linear-gradient(180deg, rgba(212,175,55,0.18), rgba(212,175,55,0.06));
    color: var(--gold);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all .18s;
    user-select: none;
}
.btn:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(212,175,55,0.30), rgba(212,175,55,0.12));
    box-shadow: 0 0 18px var(--gold-glow);
    transform: translateY(-1px);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.btn-primary {
    background: linear-gradient(180deg, var(--gold), var(--gold-soft));
    color: #1a1208;
    border-color: var(--gold);
}
.btn.btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 24px var(--gold-glow);
    filter: brightness(1.08);
}
.btn.btn-ghost {
    background: transparent; border-color: var(--border); color: var(--fg-1);
}
.btn.btn-ghost:hover { color: var(--fg-0); border-color: var(--gold-soft); }
.btn.btn-danger {
    background: linear-gradient(180deg, rgba(229,72,77,0.25), rgba(229,72,77,0.08));
    border-color: rgba(229,72,77,0.55); color: var(--danger);
}
.btn.btn-danger:hover:not(:disabled) { box-shadow: 0 0 18px rgba(229,72,77,0.4); }
.btn.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn.btn-lg { padding: 14px 32px; font-size: 17px; }

/* ---------- 输入框 ---------- */
.input, .textarea, .select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--fg-0);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.input:focus, .textarea:focus, .select:focus {
    border-color: var(--gold-soft);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
}
.input::placeholder, .textarea::placeholder { color: var(--fg-2); }
.textarea { resize: vertical; min-height: 90px; font-family: inherit; }

label.field { display: block; margin-bottom: 14px; }
label.field > .label-text {
    display: block; margin-bottom: 6px;
    font-size: 13px; color: var(--fg-1); font-weight: 500;
}
label.field > .hint {
    font-size: 12px; color: var(--fg-2); margin-top: 4px;
}

/* ---------- 容器 ---------- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
}
.container-narrow { max-width: 480px; }
.container-wide   { max-width: 1280px; }

.card {
    background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(12, 14, 16, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex; align-items: center; gap: 16px;
}
.topbar .brand {
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(90deg, var(--gold), var(--fg-0));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.4px;
}
.topbar .grow { flex: 1; }
.topbar .merit-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--gold-soft);
    border-radius: 999px;
    background: rgba(212,175,55,0.08);
    color: var(--gold);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 14px;
}
.topbar .merit-pill .merit-num {
    font-size: 16px;
    min-width: 24px; text-align: right;
}
.topbar .merit-pill .label { font-size: 12px; color: var(--fg-1); font-family: var(--font-sans); }

/* ---------- 提示 toast ---------- */
.toast-container {
    position: fixed; right: 18px; bottom: 18px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 9999;
}
.toast {
    background: var(--bg-3);
    color: var(--fg-0);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-width: 380px;
    animation: toast-in .25s ease;
    border-left: 3px solid var(--info);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ---------- 标题 ---------- */
.page-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.6px;
}
.page-subtitle {
    color: var(--fg-1);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ---------- 装饰：金线 ---------- */
.gold-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
    margin: 20px 0;
    opacity: 0.5;
}

/* ---------- 网格 ---------- */
.grid {
    display: grid;
    gap: 14px;
}
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 720px) {
    .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
}

/* ---------- 表格 ---------- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th {
    color: var(--fg-1);
    font-weight: 600;
    background: rgba(212,175,55,0.05);
}
.table tr:hover td { background: rgba(212,175,55,0.04); }

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge.admin   { background: rgba(229,72,77,0.18); color: var(--danger); border: 1px solid rgba(229,72,77,0.4); }
.badge.user    { background: rgba(108,182,255,0.15); color: var(--info); border: 1px solid rgba(108,182,255,0.35); }
.badge.gold    { background: rgba(212,175,55,0.18); color: var(--gold); border: 1px solid var(--gold-soft); }

/* ---------- 排队提示 ---------- */
.queue-banner {
    background: linear-gradient(90deg, rgba(232,169,60,0.18), rgba(232,169,60,0.04));
    border: 1px solid rgba(232,169,60,0.45);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--warning);
    font-size: 14px;
    margin-bottom: 12px;
}

/* ---------- 加载点动画 ---------- */
.dots span {
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--gold);
    border-radius: 50%;
    margin: 0 2px;
    animation: dots 1.2s infinite ease-in-out;
}
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dots {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ---------- 隐藏工具 ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-8 { gap: 8px; }
.p-8 { padding: 8px; }
.ml-8 { margin-left: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--fg-2); }
.text-gold { color: var(--gold); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
