/* 基础重置与跨页面通用组件：按钮、徽章、面板、表格、表单、分页 */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--ink-950);
    color: var(--text-body);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--text-strong); font-weight: 650; letter-spacing: 0.01em; }

::selection { background: rgba(238, 197, 105, 0.28); color: var(--text-strong); }

/* 细滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--ink-700) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--ink-700); border-radius: var(--radius-pill); }

/* ===== 文本工具 ===== */
.code { font-family: var(--font-mono); font-size: 0.88em; color: var(--gold-300); letter-spacing: 0.02em; white-space: nowrap; }
.muted { color: var(--text-muted); }
.good { color: var(--jade-400); }
.bad { color: var(--rose-400); }

/* ===== 按钮 ===== */
.button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: var(--grad-gold);
    color: #241a05;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.button:hover { box-shadow: var(--glow-gold); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.button.secondary {
    background: var(--surface-2);
    border-color: var(--stroke-2);
    color: var(--text-strong);
    font-weight: 500;
}
.button.secondary:hover { background: var(--surface-3); border-color: var(--stroke-gold); color: var(--gold-300); box-shadow: none; }

.button.danger {
    background: rgba(255, 143, 134, 0.1);
    border-color: rgba(255, 143, 134, 0.35);
    color: var(--rose-400);
    font-weight: 500;
}
.button.danger:hover { background: rgba(255, 143, 134, 0.18); box-shadow: 0 0 0 1px rgba(255, 143, 134, 0.2); }

.button.sm { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: var(--radius-sm); }

/* ===== 徽章 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--stroke-2);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.03em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { border-color: rgba(95, 211, 154, 0.35); background: rgba(95, 211, 154, 0.09); color: var(--jade-400); }
.badge.deleted { border-color: rgba(255, 143, 134, 0.35); background: rgba(255, 143, 134, 0.09); color: var(--rose-400); }

/* ===== 玻璃面板 ===== */
.panel {
    position: relative;
    border: 1px solid var(--stroke-1);
    border-radius: var(--radius-lg);
    background: var(--grad-panel), var(--ink-900);
    box-shadow: var(--shadow-2);
    padding: 22px;
}

/* ===== 表单 ===== */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; color: var(--text-muted); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; }
.field input, .toolbar input {
    width: 100%;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--stroke-2);
    border-radius: var(--radius-md);
    outline: none;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-strong);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
.field input::placeholder, .toolbar input::placeholder { color: var(--text-faint); }
.field input:focus, .toolbar input:focus {
    border-color: var(--stroke-gold);
    box-shadow: 0 0 0 3px rgba(238, 197, 105, 0.14);
    background: rgba(0, 0, 0, 0.5);
}
.validation { min-height: 22px; margin: 6px 0 10px; color: var(--rose-400); font-size: 13px; }

/* ===== 数据表格 ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    padding: 10px 14px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
    border-bottom: 1px solid var(--stroke-1);
}
.data-table td { padding: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: middle; }
.data-table tbody tr { transition: background var(--dur-fast); }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== 工具条与操作 ===== */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .search-box { position: relative; flex: 1 1 320px; max-width: 460px; }
.toolbar .search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-faint); pointer-events: none; }
.toolbar .search-box input { padding-left: 38px; }
.toolbar .check-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--stroke-2);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: border-color var(--dur-fast), color var(--dur-fast);
}
.toolbar .check-pill:hover { border-color: var(--stroke-gold); color: var(--text-strong); }
.toolbar .check-pill input { accent-color: var(--gold-400); margin: 0; }

.actions { display: flex; gap: 8px; align-items: center; }
.actions form { margin: 0; }

/* ===== 空状态与分页 ===== */
.empty-state { padding: 48px 20px; text-align: center; color: var(--text-faint); }
.empty-state svg { width: 34px; height: 34px; margin-bottom: 10px; color: var(--text-faint); opacity: 0.7; }

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 20px; }
.pager .page-indicator { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pager .page-indicator strong { color: var(--gold-300); font-weight: 600; }

/* ===== 页面进场动效 ===== */
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise-in 0.55s var(--ease-out) both; }
.rise.d1 { animation-delay: 0.06s; }
.rise.d2 { animation-delay: 0.12s; }
.rise.d3 { animation-delay: 0.18s; }
