/* ============================================================
 * 后台管理系统样式
 * 方向：克制工具台 — 墨青主色、扁平面板、少装饰
 * ============================================================ */

:root {
    --c-primary: #0f766e;
    --c-primary-dark: #0b5f58;
    --c-primary-soft: #ecfdf8;
    --c-success: #15803d;
    --c-warning: #b45309;
    --c-danger: #b91c1c;
    --c-info: #64748b;
    --c-text: #0f172a;
    --c-text-2: #475569;
    --c-text-3: #94a3b8;
    --c-border: #e2e8f0;
    --c-border-light: #f1f5f9;
    --c-bg: #f1f5f9;
    --c-white: #ffffff;
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --sidebar-active: #0f766e;
    --radius: 4px;
    --shadow-card: none;
    --shadow-pop: 0 8px 24px rgba(15, 23, 42, .12);
    --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
    --c-primary: #2dd4bf;
    --c-primary-dark: #14b8a6;
    --c-primary-soft: #134e4a;
    --c-success: #4ade80;
    --c-warning: #fbbf24;
    --c-danger: #f87171;
    --c-info: #94a3b8;
    --c-text: #e2e8f0;
    --c-text-2: #94a3b8;
    --c-text-3: #64748b;
    --c-border: #334155;
    --c-border-light: #1e293b;
    --c-bg: #0b1120;
    --c-white: #111827;
    --sidebar-bg: #030712;
    --sidebar-hover: #111827;
    --sidebar-active: #0f766e;
    --shadow-pop: 0 8px 24px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .data-table thead th,
[data-theme="dark"] .data-table thead .col-fixed { background: #0f172a; }
[data-theme="dark"] .data-table tbody tr:hover { background: #1e293b; }
[data-theme="dark"] .date-selector { background: #1e293b; }
[data-theme="dark"] .dropdown-menu a:hover { background: #1e293b; }
[data-theme="dark"] .flash-success { background: #14532d; color: #86efac; border-color: #166534; }
[data-theme="dark"] .flash-error   { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
[data-theme="dark"] .flash-warning { background: #78350f; color: #fcd34d; border-color: #92400e; }
[data-theme="dark"] .flash-info    { background: #134e4a; color: #99f6e4; border-color: #115e59; }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font);
    font-size: 13px;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }

.app-container { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
    width: 208px;
    flex: 0 0 208px;
    background: var(--sidebar-bg);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, .04);
    transition: width .2s;
}
.sidebar.collapsed { width: 56px; flex-basis: 56px; overflow: visible; }
.sidebar.collapsed .logo { justify-content: center; padding: 0; }
.sidebar.collapsed .logo-full { display: none; }
.sidebar.collapsed .logo-mini { display: block; }
.sidebar.collapsed .menu-text { display: none; }
.sidebar.collapsed .menu { padding: 8px; }
.sidebar.collapsed .menu-item { justify-content: center; padding: 0; margin: 2px 0; }
.sidebar.collapsed:hover {
    width: 208px; flex-basis: 208px;
    box-shadow: var(--shadow-pop); z-index: 80;
}
.sidebar.collapsed:hover .logo { justify-content: flex-start; padding: 0 18px; }
.sidebar.collapsed:hover .logo-full { display: block; }
.sidebar.collapsed:hover .logo-mini { display: none; }
.sidebar.collapsed:hover .menu-text { display: inline; }
.sidebar.collapsed:hover .menu-item { justify-content: flex-start; padding: 0 12px; }

.logo {
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 18px;
    color: #f8fafc;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .04em;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.logo-full { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.logo-full > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-mini { display: none; }
.logo-mark {
    display: inline-block;
    width: 8px; height: 8px;
    margin-right: 10px;
    background: var(--c-primary);
    border-radius: 1px;
    vertical-align: middle;
}
.sidebar-logo {
    width: 26px; height: 26px; border-radius: 7px; flex: 0 0 26px;
}
.sidebar-logo-mini {
    width: 28px; height: 28px; border-radius: 8px; display: block;
}

.menu { padding: 10px 8px; flex: 1; overflow-y: auto; }
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 12px;
    margin: 2px 0;
    border-radius: var(--radius);
    color: #94a3b8;
    font-size: 13px;
    transition: background .12s, color .12s;
}
.menu-item:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}
.menu-item.active {
    background: rgba(15, 118, 110, .18);
    color: #5eead4;
}
.menu-icon-wrap {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 18px;
    opacity: .85;
}
.menu-icon-wrap svg {
    width: 16px; height: 16px;
    stroke: currentColor; fill: none;
    stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.menu-item.active .menu-icon-wrap { opacity: 1; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: 52px;
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.toggle-btn {
    border: 1px solid var(--c-border);
    background: var(--c-white);
    width: 30px; height: 30px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--c-text-2);
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0;
}
.toggle-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.toggle-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.page-title { font-size: 14px; font-weight: 600; color: var(--c-text); letter-spacing: .02em; }

.topbar-right { position: relative; display: flex; align-items: center; gap: 8px; }
.user-dropdown { position: relative; cursor: pointer; padding: 4px 8px; border-radius: var(--radius); }
.user-dropdown:hover { background: var(--c-bg); }
.user-info { font-size: 13px; color: var(--c-text-2); display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-avatar-default {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--c-bg); border: 1px solid var(--c-border);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--c-text-3); font-size: 11px; font-weight: 600;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta b { font-weight: 600; color: var(--c-text); font-size: 12px; }
.user-role { font-style: normal; font-size: 11px; color: var(--c-text-3); }
.user-caret { font-size: 10px; color: var(--c-text-3); }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    min-width: 128px;
    display: none;
    z-index: 50;
    overflow: hidden;
}
.user-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: block;
    padding: 9px 14px;
    color: var(--c-text-2);
    font-size: 13px;
}
.dropdown-menu a:hover { background: var(--c-bg); color: var(--c-primary); }

.content { flex: 1; padding: 20px; overflow-x: hidden; }

.icon-btn {
    width: 30px; height: 30px; border-radius: var(--radius);
    border: 1px solid var(--c-border); background: var(--c-white);
    color: var(--c-text-3); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color .12s, border-color .12s;
}
.icon-btn:hover { color: var(--c-primary); border-color: var(--c-primary); }
.icon-btn svg { width: 15px; height: 15px; }
[data-theme="dark"] .icon-btn { background: var(--c-white); color: var(--c-text-2); }
[data-theme="dark"] .icon-btn:hover { color: var(--c-primary); }

/* ---------- Toast ---------- */
.toast-container {
    position: fixed; top: 16px; right: 16px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 14px; border-radius: var(--radius);
    background: var(--c-white); border: 1px solid var(--c-border);
    box-shadow: var(--shadow-pop);
    font-size: 13px; color: var(--c-text); line-height: 1.5;
    opacity: 0; transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.hide { opacity: 0; transform: translateY(-6px); }
.toast-success { border-left: 3px solid var(--c-success); }
.toast-error   { border-left: 3px solid var(--c-danger); }
.toast-warning { border-left: 3px solid var(--c-warning); }
.toast-info    { border-left: 3px solid var(--c-primary); }
.toast-msg { flex: 1; word-break: break-word; }
.toast-close {
    border: none; background: transparent; cursor: pointer;
    color: var(--c-text-3); font-size: 16px; line-height: 1;
    padding: 0 2px; flex: 0 0 auto;
}
.toast-close:hover { color: var(--c-text); }

.flash-wrap { margin-bottom: 16px; }
.flash {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 13px;
    border: 1px solid transparent;
}
.flash-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.flash-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.flash-info    { background: var(--c-primary-soft); color: #115e59; border-color: #99f6e4; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--c-white);
    border-radius: var(--radius);
    border: 1px solid var(--c-border);
    padding: 18px 20px;
    margin-bottom: 16px;
}
.card-title { margin: 0 0 16px; font-size: 14px; font-weight: 600; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-head .card-title { margin: 0; }
.perm-denied {
    text-align: center;
    padding: 48px 20px;
    color: var(--c-text-3);
}
.perm-denied .perm-icon {
    width: 40px; height: 40px; margin: 0 auto 12px;
    border: 1px solid var(--c-border); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--c-text-3); font-size: 14px; font-weight: 600;
}
.perm-denied h3 { margin: 0 0 10px; color: var(--c-text); font-size: 15px; }
.perm-denied p { margin: 0; line-height: 1.8; font-size: 13px; }

/* ---------- 表单 ---------- */
.form { max-width: 720px; }
.form-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}
.form-label {
    width: 130px;
    flex: 0 0 130px;
    text-align: right;
    padding-right: 14px;
    padding-top: 7px;
    font-size: 13px;
    color: var(--c-text-2);
}
.form-inline { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }

.input {
    width: 100%;
    height: 34px;
    padding: 0 11px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-white);
    color: var(--c-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .12s;
}
.input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 2px rgba(15, 118, 110, .12); }
textarea.input { height: auto; padding: 8px 11px; line-height: 1.5; resize: vertical; }
.input-lg { height: 40px; font-size: 14px; }
.input::placeholder { color: var(--c-text-3); }

.hint { color: var(--c-text-3); font-size: 12px; margin-top: 6px; line-height: 1.4; }
.muted { color: var(--c-text-3); }
.small { font-size: 12px; }

.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { display: none; }
.switch-slider {
    position: absolute; inset: 0;
    background: #cbd5e1; border-radius: 20px; cursor: pointer;
    transition: background .15s;
}
.switch-slider::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; background: #fff; border-radius: 50%;
    transition: transform .15s;
}
.switch input:checked + .switch-slider { background: var(--c-primary); }
.switch input:checked + .switch-slider::after { transform: translateX(16px); }

.radio { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; font-size: 13px; color: var(--c-text-2); cursor: pointer; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-white);
    color: var(--c-text-2);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
}
.btn:hover { color: var(--c-primary); border-color: #99f6e4; background: var(--c-primary-soft); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #fff; }
.btn-success { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.btn-success:hover { opacity: .92; color: #fff; }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-danger:hover { opacity: .92; color: #fff; }
.btn-warning { background: var(--c-warning); border-color: var(--c-warning); color: #fff; }
.btn-warning:hover { opacity: .92; color: #fff; }
.form-hint { font-size: 12px; color: var(--c-text-3); line-height: 1.45; }
.form-row-col { align-items: flex-start; }
.form-input-wrap { display: flex; flex-direction: column; gap: 5px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn-sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.disabled, .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-link {
    border: none; background: transparent; color: var(--c-primary);
    cursor: pointer; font-size: 13px; padding: 0 4px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link-danger { color: var(--c-danger); }

.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading * { visibility: hidden; }
.btn-loading::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 14px; height: 14px; margin: -7px 0 0 -7px;
    border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
    border-radius: 50%; animation: btn-spin .6s linear infinite; z-index: 2;
}
.btn:not(.btn-primary).btn-loading::after { border-color: rgba(0, 0, 0, .2); border-top-color: var(--c-primary); }
@keyframes btn-spin { to { transform: rotate(360deg); } }

.tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 2px;
    font-size: 12px;
    line-height: 18px;
    border: 1px solid transparent;
    font-weight: 500;
}
.tag-primary { background: var(--c-primary-soft); color: #0f766e; border-color: #99f6e4; }
.tag-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.tag-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.tag-danger  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.tag-info    { background: #f8fafc; color: #64748b; border-color: #e2e8f0; }
[data-theme="dark"] .tag-primary { background: #134e4a; color: #5eead4; border-color: #115e59; }
[data-theme="dark"] .tag-success { background: #14532d; color: #86efac; border-color: #166534; }
[data-theme="dark"] .tag-warning { background: #78350f; color: #fcd34d; border-color: #92400e; }
[data-theme="dark"] .tag-danger  { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
[data-theme="dark"] .tag-info    { background: #1e293b; color: #94a3b8; border-color: #334155; }

/* ---------- 表格 ---------- */
.table-container { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: var(--c-text);
    background: var(--c-white);
}
.data-table th, .data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border-light);
    text-align: left;
    white-space: nowrap;
}
.data-table thead th {
    background: #f8fafc;
    color: var(--c-text-2);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .02em;
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .col-fixed { position: sticky; right: 0; background: var(--c-white); }
.data-table thead .col-fixed { background: #f8fafc; }
.th-sort { color: var(--c-text-2); cursor: pointer; }
.th-sort:hover { color: var(--c-primary); }
.empty-row { text-align: center; color: var(--c-text-3); padding: 30px 0 !important; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.avatar-preview { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: block; margin-bottom: 8px; }
.active-dot { font-size: 10px; margin-left: 2px; }
.openid-text {
    display: inline-block; max-width: 220px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}
.points-cell { display: flex; align-items: center; gap: 6px; }
.inline-form { display: inline; }
.code-cell { display: flex; align-items: center; gap: 8px; }
.code-text { font-family: Consolas, Menlo, monospace; }

.table-card {
    background: var(--c-white);
    border-radius: var(--radius);
    padding: 0;
    border: 1px solid var(--c-border);
    overflow: hidden;
}
.data-table-card { background: transparent; }
.data-table-card thead th {
    background: #f8fafc;
    color: var(--c-text-2);
    border-top: none;
    padding: 11px 12px;
    font-weight: 600;
}
.data-table-card thead th:first-child,
.data-table-card thead th:last-child { border-radius: 0; }
.data-table-card tbody td { padding: 11px 12px; border-bottom: 1px solid var(--c-border-light); }
.data-table-card tbody tr:last-child td { border-bottom: none; }
.data-table-card tbody tr:hover { background: #f8fafc; }
.data-table-card .empty-row { padding: 40px 0 !important; color: var(--c-text-3); }
[data-theme="dark"] .table-card { background: var(--c-white); border-color: var(--c-border); }
[data-theme="dark"] .data-table-card thead th { background: #0f172a; color: var(--c-text-2); }
[data-theme="dark"] .data-table-card tbody tr:hover { background: #1e293b; }
[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td { border-color: var(--c-border-light); }

.search-bar, .toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin-bottom: 14px;
}
.search-input { width: 240px; }
.filter-select { width: 160px; }

.pagination {
    display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
    margin-top: 14px; font-size: 13px; color: var(--c-text-2);
}
.pg-total { color: var(--c-text-3); }
.pg-sizes .pg-select { width: 70px; height: 30px; }
.pg-nav { display: flex; align-items: center; gap: 10px; }
.pg-current { color: var(--c-text-3); }

/* ============================================================
 * 首页仪表盘
 * ============================================================ */
.home .section { margin-bottom: 24px; }
.section-title {
    font-size: 13px; font-weight: 600; margin: 0 0 12px;
    color: var(--c-text); letter-spacing: .04em;
    text-transform: none;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.quick-action {
    display: flex; flex-direction: column;
    gap: 4px; padding: 14px 16px; border-radius: var(--radius);
    background: var(--c-white);
    color: var(--c-text);
    border: 1px solid var(--c-border);
    transition: border-color .12s;
}
.quick-action:hover {
    border-color: var(--c-primary);
    color: var(--c-text);
}
.qa-text { font-size: 13px; font-weight: 600; color: var(--c-text); }
.qa-desc { font-size: 12px; color: var(--c-text-3); }
[data-theme="dark"] .quick-action { border-color: var(--c-border); }

.stats-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.date-selector {
    display: inline-flex;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 2px;
    gap: 2px;
}
.radio-pill {
    padding: 5px 12px; border-radius: 2px; color: var(--c-text-2);
    font-size: 12px; cursor: pointer; transition: background .12s, color .12s;
}
.radio-pill:hover { color: var(--c-text); }
.radio-pill.active { background: var(--c-primary); color: #fff; }
.date-picker { display: flex; align-items: center; gap: 8px; }
.date-input { width: 150px; }
.date-separator { color: var(--c-text-3); }

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.stat-card {
    border-radius: var(--radius);
    padding: 16px 18px;
    color: var(--c-text);
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-top: 2px solid var(--c-primary);
    position: relative;
}
.stat-value {
    font-size: 26px; font-weight: 650; line-height: 1.15;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.stat-label-wrap {
    display: flex; align-items: center; gap: 6px;
    margin-top: 8px; font-size: 12px; color: var(--c-text-3);
}
.stat-ic { display: none; }
.stat-hint { margin-top: 6px; font-size: 11px; color: var(--c-warning); }

/* 顶部分隔色条（替代彩虹渐变底） */
.grad-total-users, .grad-active-users, .grad-platform, .grad-rate-good { border-top-color: #0f766e; }
.grad-normal-users, .grad-new-users, .grad-rate-excellent { border-top-color: #15803d; }
.grad-permanent-vip, .grad-rate-warning { border-top-color: #b45309; }
.grad-normal-vip { border-top-color: #0e7490; }
.grad-total-parse, .grad-parse-count { border-top-color: #0369a1; }
.grad-total-ad, .grad-ad-view-count, .grad-rate-danger { border-top-color: #be123c; }
.grad-total-invite, .grad-invite-count { border-top-color: #0f766e; }
.grad-rate-empty { border-top-color: #94a3b8; }

.rate-sub {
    display: flex; align-items: center; gap: 10px;
    margin-top: 12px; font-size: 12px; color: var(--c-text-3);
}
.rate-sub span {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; background: var(--c-bg); border-radius: 2px;
    border: 1px solid var(--c-border);
    color: var(--c-text-2);
}
.platform-empty { padding: 20px 0; text-align: center; font-size: 13px; color: var(--c-text-3); }
.platform-row {
    display: grid; grid-template-columns: 80px 1fr 40px; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--c-border-light);
}
.platform-row:last-child { border-bottom: none; }
.platform-name { font-size: 13px; color: var(--c-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-count { font-size: 13px; font-weight: 600; text-align: right; color: var(--c-text); }
.mini-bar-track { height: 6px; background: var(--c-border-light); border-radius: 2px; overflow: hidden; }
.mini-bar-fill { height: 100%; background: var(--c-primary); border-radius: 2px; transition: width .35s ease; }

.duration-opts { display: flex; flex-direction: column; gap: 6px; }
.codes-list { display: flex; flex-direction: column; gap: 8px; }
.code-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: var(--c-bg); border-radius: var(--radius);
    border: 1px solid var(--c-border);
}

.settings-container { max-width: 1000px; }
.image-uploader { display: flex; align-items: flex-start; gap: 16px; }
.image-preview-wrapper {
    width: 160px; height: 130px; border: 1px dashed var(--c-border);
    border-radius: var(--radius); overflow: hidden; background: var(--c-bg);
    display: flex; align-items: center; justify-content: center;
}
.image-preview { max-width: 100%; max-height: 100%; }
.uploader-btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.avatar-uploader { display: flex; align-items: flex-start; gap: 16px; }
.profile-page .avatar-preview-wrapper,
.avatar-preview-wrapper {
    width: 96px; height: 96px; max-width: 96px; max-height: 96px;
    border: 1px dashed var(--c-border);
    border-radius: 50%; overflow: hidden; background: var(--c-bg);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.profile-page .avatar-preview-img,
.avatar-preview-img {
    width: 100%; height: 100%; max-width: 100%; max-height: 100%;
    object-fit: cover; display: block;
}

.recommend-table th, .recommend-table td { white-space: normal; vertical-align: top; }
.recommend-table .input { width: 100%; }
.rec-icon { position: relative; width: 60px; }
.rec-icon-img { width: 56px; height: 56px; border-radius: var(--radius); object-fit: cover; display: block; }
.rec-icon-btn { position: absolute; top: 0; left: 0; }
.sort-buttons { display: flex; flex-direction: column; gap: 4px; }

.modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .4);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }
.modal-box {
    background: var(--c-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
    border: 1px solid var(--c-border);
    width: 480px;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; font-size: 14px; font-weight: 600;
    border-bottom: 1px solid var(--c-border);
}
.modal-close { cursor: pointer; font-size: 18px; color: var(--c-text-3); line-height: 1; }
.modal-close:hover { color: var(--c-text); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-footer {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    padding: 12px 18px; border-top: 1px solid var(--c-border);
}

.points-log-table-container { max-height: 360px; overflow-y: auto; }

/* ============================================================
 * 登录 / 找回密码
 * ============================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    background: #0b1120;
}
.login-aside {
    flex: 1;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 70% 55% at 50% 45%, rgba(15, 118, 110, .28) 0%, transparent 70%),
        #0b1120;
}
.login-aside::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}
.login-platforms {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    display: block;
    -webkit-mask-image: none;
    mask-image: none;
}
.lp-chip {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(var(--s, 1));
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    color: rgba(248, 250, 252, .78);
    background: rgba(15, 23, 42, .45);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    white-space: nowrap;
    user-select: none;
    backdrop-filter: blur(4px);
    max-width: 140px;
    overflow: hidden;
    will-change: left, top, transform;
    animation: lp-bob 2.8s ease-in-out infinite;
}
.lp-chip:nth-child(3n) { animation-duration: 3.4s; animation-delay: -.6s; }
.lp-chip:nth-child(4n) { animation-duration: 2.4s; animation-delay: -1.2s; }
.lp-chip:nth-child(5n) { animation-duration: 3.8s; animation-delay: -.3s; }
@keyframes lp-bob {
    0%, 100% { filter: brightness(1); translate: 0 0; }
    50% { filter: brightness(1.08); translate: 0 -10px; }
}
.lp-chip img {
    width: 22px; height: 22px;
    border-radius: 6px;
    object-fit: cover;
    flex: 0 0 22px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .28);
}
.lp-chip b {
    font-weight: 550;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (prefers-reduced-motion: reduce) {
    .lp-chip { transition: none !important; }
}

.login-aside-inner {
    position: relative;
    z-index: 2;
    max-width: 440px;
    text-align: center;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    backdrop-filter: none;
}
.login-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: left;
}
.login-logo {
    width: 44px; height: 44px;
    border-radius: 12px;
    flex: 0 0 44px;
    display: block;
    box-shadow: 0 6px 20px rgba(15, 118, 110, .35);
}
.login-logo-lg {
    width: 56px; height: 56px;
    border-radius: 14px;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(15, 118, 110, .22);
}
.login-brand {
    font-size: 28px; font-weight: 650; color: #f8fafc;
    letter-spacing: .02em; margin: 0 0 6px;
    line-height: 1.25;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .55);
}
.login-brand-mark { display: none; }
.login-aside-inner > p,
.login-brand-row p {
    margin: 0; color: #cbd5e1; font-size: 14px; line-height: 1.7;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}
.login-main {
    flex: 1;
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 32px 24px;
    background: #f8fafc;
}
.login-box {
    width: 100%;
    max-width: 360px;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
.login-header { margin-bottom: 28px; text-align: center; }
.login-header h2 {
    margin: 0 0 6px; font-size: 20px; font-weight: 650;
    color: #0f172a; letter-spacing: .01em;
}
.login-header p { margin: 0; color: #64748b; font-size: 13px; }
.login-form .form-item { margin-bottom: 14px; }
.login-form .input {
    background: #fff;
    border-color: #e2e8f0;
    color: #0f172a;
}
.login-form .input:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, .15);
}
.login-button { width: 100%; margin-top: 4px; }
.login-remember { margin-bottom: 14px; }
.remember-me {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: #475569; cursor: pointer;
}
.login-captcha {
    display: flex; align-items: stretch; gap: 10px;
}
.login-captcha .input { flex: 1; min-width: 0; letter-spacing: .12em; text-transform: uppercase; }
.captcha-img {
    width: 120px; height: 40px; flex: 0 0 120px;
    border: 1px solid #e2e8f0; border-radius: var(--radius);
    background: #fff; cursor: pointer; object-fit: cover;
}
.captcha-img:hover { border-color: #0f766e; }
.login-extra { text-align: right; margin-top: 12px; }
.login-link { color: #0f766e; font-size: 13px; text-decoration: none; }
.login-link:hover { text-decoration: underline; }

@media (min-width: 860px) {
    .login-aside { display: flex; flex: 1; }
    .login-main { flex: 0 0 440px; max-width: 440px; }
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}
.chart-card {
    background: var(--c-white);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--c-border);
}
.chart-title { font-size: 13px; font-weight: 600; margin: 0 0 14px; color: var(--c-text); }
.chart-body { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-wrap { width: 140px; height: 140px; flex: 0 0 140px; }
.donut-arc-success { stroke: var(--c-success); }
.donut-arc-fail { stroke: var(--c-danger); }
.donut-rate { fill: var(--c-text); font-size: 22px; font-weight: 700; }
.donut-sub { fill: var(--c-text-3); font-size: 12px; }
[data-theme="dark"] .chart-card { background: var(--c-white); border-color: var(--c-border); }
.chart-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--c-text-2); }
.lg-item { display: flex; align-items: center; gap: 8px; }
.lg-item b { color: var(--c-text); }
.lg-dot { width: 8px; height: 8px; border-radius: 1px; flex: 0 0 8px; }
.lg-success { background: var(--c-success); }
.lg-fail { background: var(--c-danger); }
.lg-total { background: var(--c-info); }

.bars-wrap { width: 100%; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 48px; align-items: center; gap: 10px; }
.bar-label {
    font-size: 13px; color: var(--c-text-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar-track { background: var(--c-border-light); border-radius: 2px; height: 8px; overflow: hidden; }
.bar-fill {
    height: 100%; border-radius: 2px;
    background: var(--c-primary);
    transition: width .35s ease;
}
.bar-val { font-size: 13px; font-weight: 600; color: var(--c-text); text-align: right; }

.batch-toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 12px; padding: 10px 12px;
    background: var(--c-bg); border: 1px solid var(--c-border);
    border-radius: var(--radius);
}
.batch-checkall { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-text-2); cursor: pointer; }
.batch-select { width: 130px; height: 30px; }
.batch-count { font-size: 13px; color: var(--c-text-3); }
.batch-count b { color: var(--c-primary); }
[data-theme="dark"] .batch-toolbar { background: #0f172a; }

.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .4);
    z-index: 55; opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.sidebar-backdrop.show { opacity: 1; visibility: visible; }

@media (max-width: 768px) {
    .sidebar {
        position: fixed; top: 0; left: 0; z-index: 60; height: 100%;
        width: 208px; flex-basis: 208px;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.collapsed,
    .sidebar.collapsed:hover { width: 208px; flex-basis: 208px; overflow: visible; box-shadow: none; }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar-backdrop { display: block; }
    .form-label { width: 90px; flex-basis: 90px; }
    .stat-value { font-size: 22px; }
}

.session-card {
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.session-title { font-size: 12px; font-weight: 600; color: var(--c-text-2); margin-bottom: 10px; }
.session-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 5px 0; }
.session-row > span { color: var(--c-text-3); }
.session-row > b { color: var(--c-text); font-weight: 600; max-width: 62%; text-align: right; word-break: break-all; }
[data-theme="dark"] .session-card { background: #0f172a; }

.pwd-strength { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pwd-bar { flex: 1; height: 4px; background: var(--c-border-light); border-radius: 2px; overflow: hidden; }
.pwd-bar > span { display: block; height: 100%; width: 0; transition: width .2s ease, background .2s ease; }
.pwd-hint { font-size: 12px; min-width: 32px; }

.pwd-field { position: relative; display: flex; align-items: center; }
.pwd-field .input { flex: 1; padding-right: 38px; }
.pwd-toggle {
    position: absolute;
    right: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 4px 6px;
    color: var(--c-text-3);
    border-radius: 2px;
}
.pwd-toggle:hover { background: var(--c-bg); color: var(--c-text); }
