/* =========================================================
   雪糕付费系统 · 后台样式（无第三方依赖）
   ========================================================= */

:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --ink: #1b2434;
    --ink-2: #3c4a61;
    --muted: #6b7a90;
    --line: #e5eaf2;
    --line-2: #eff3f9;
    --brand: #3b6ef6;
    --brand-dark: #2b56cc;
    --brand-soft: #eaf0ff;
    --dark: #101a2c;
    --dark-2: #17233a;
    --success: #0f9d58;
    --warn: #c97c12;
    --danger: #d63b3a;
    --info: #2f7fd1;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 26, 44, .06), 0 8px 24px rgba(16, 26, 44, .05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: .2px; }

/* ---------------- 布局 ---------------- */

.layout { min-height: 100vh; }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 232px;
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 100%);
    display: flex;
    flex-direction: column;
    z-index: 30;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px 18px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #5b8bff, #3159d8);
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(59, 110, 246, .35);
    flex: 0 0 auto;
}

.brand-text { min-width: 0; }
.brand-name { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px; white-space: nowrap; }
.brand-sub { color: #7d8ca6; font-size: 11px; letter-spacing: 1px; }

.nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 12px 12px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    margin-bottom: 4px;
    border-radius: 9px;
    color: #a9b6cb;
    font-size: 14px;
    transition: background .15s, color .15s;
}

.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.nav-item.is-active {
    background: rgba(59, 110, 246, .18);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(92, 138, 255, .35);
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4b5b75;
    flex: 0 0 auto;
}

.nav-item.is-active .nav-dot { background: #6b96ff; box-shadow: 0 0 0 4px rgba(107, 150, 255, .18); }

.nav-label { flex: 1; }

.nav-caret { font-size: 11px; color: #6b7a92; }

.nav-toggle {
    width: 100%;
    background: none;
    border: 0;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.nav-toggle:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.nav-toggle.is-open .nav-caret { color: #9db8ff; }

.nav-sub {
    display: none;
    margin: -2px 0 6px 12px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .1);
}

.nav-sub.is-open { display: block; }

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 7px;
    color: #8f9db4;
    font-size: 13px;
    transition: background .15s, color .15s;
}

.nav-sub-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.nav-sub-item.is-active {
    background: rgba(59, 110, 246, .14);
    color: #fff;
}

.nav-sub-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #4b5b75;
    flex: 0 0 auto;
}

.nav-sub-item.is-active .nav-sub-dot { background: #6b96ff; }

.nav-sub-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-sub-empty { padding: 6px 10px; font-size: 12px; color: #6b7a92; }

.nav-badge {
    background: #e0453f;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 20px;
    font-weight: 600;
}

.sidebar-foot {
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.who { display: flex; align-items: center; gap: 10px; }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #dfe7f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex: 0 0 auto;
}

.who-text { min-width: 0; }
.who-name { color: #e7edf8; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { color: #7d8ca6; font-size: 11px; }

.logout {
    display: block;
    margin-top: 12px;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    color: #b7c3d6;
    font-size: 13px;
}
.logout:hover { background: rgba(224, 69, 63, .16); color: #ff9a96; }

.main {
    margin-left: 232px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-title { font-size: 17px; color: var(--ink); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.chip {
    background: var(--brand-soft);
    color: var(--brand-dark);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    width: 36px;
    height: 32px;
    cursor: pointer;
    color: var(--ink-2);
    font-size: 15px;
}

.content { padding: 22px 28px 40px; }

/* ---------------- 卡片 / 表单 ---------------- */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0;
    overflow: hidden;
}

.card-pad { padding: 20px 22px; }

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line-2);
}

.card-head h2 { font-size: 15px; }
.card-head .muted { font-size: 12px; }
.card-head .spacer { flex: 1; }

.page-head {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}
.page-head h2 { font-size: 16px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.page-head .spacer { flex: 1; }

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-2);
    background: #fbfcfe;
}

.filters .spacer { flex: 1; }

/* 无筛选项时（管理员端列表）只留右上角的新增按钮 */
.filters-plain { justify-content: flex-end; }

.input, select.input, textarea.input {
    height: 36px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

textarea.input { height: auto; padding: 10px 11px; line-height: 1.7; resize: vertical; }

.input:focus, select.input:focus, textarea.input:focus {
    border-color: #9db8ff;
    box-shadow: 0 0 0 3px rgba(59, 110, 246, .12);
}

.input-sm { height: 32px; font-size: 13px; }
.input-full { width: 100%; }
.filters .input { min-width: 132px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}

.btn:hover { background: #f5f7fc; border-color: #d8e0ee; color: var(--ink); }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(59, 110, 246, .22); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-danger { background: #fdecec; border-color: #f6d2d1; color: var(--danger); }
.btn-danger:hover { background: #fbdcdb; border-color: #f2bcba; color: #b52e2d; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f0f3f9; color: var(--ink); }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }

.link-btn {
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    color: var(--brand);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.link-btn:hover { color: var(--brand-dark); }
.link-danger { color: var(--danger); }
.link-danger:hover { color: #b52e2d; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 22px;
    padding: 22px;
}

.form-grid .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .req { color: var(--danger); margin-left: 2px; }

.form-actions {
    display: flex;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--line-2);
    background: #fbfcfe;
}

/* ---------------- 表格 ---------------- */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table th {
    text-align: left;
    font-weight: 600;
    color: var(--muted);
    background: #fafbfe;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line-2);
    white-space: nowrap;
    font-size: 12.5px;
    letter-spacing: .3px;
}

.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-2);
    color: var(--ink-2);
    vertical-align: middle;
}

.table tbody tr:hover td { background: #fafcff; }
.table td.nowrap, .table th.nowrap { white-space: nowrap; }
.table .mono { font-family: "SFMono-Regular", Consolas, "Courier New", monospace; font-size: 12.5px; color: var(--ink); }
.table .num { font-variant-numeric: tabular-nums; }
.table .strong { color: var(--ink); font-weight: 600; }

.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions form { margin: 0; }

.empty-state { padding: 56px 20px; text-align: center; }
.empty-state .ico { font-size: 26px; color: #c2ccdc; }
.empty-state p { color: var(--muted); margin: 10px 0 18px; }

/* ---------------- 徽章 / 提示 ---------------- */

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.6;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: #e7f7ee; color: #0b7d46; }
.badge-warn    { background: #fdf3e2; color: #a4650a; }
.badge-danger  { background: #fdecec; color: #b52e2d; }
.badge-info    { background: #eaf2fd; color: #2264ab; }
.badge-muted   { background: #f0f2f7; color: #6b7a90; }
.badge-brand   { background: var(--brand-soft); color: var(--brand-dark); }

.alert {
    padding: 11px 16px;
    border-radius: 9px;
    margin-bottom: 14px;
    font-size: 13.5px;
    border: 1px solid transparent;
}

.alert-success { background: #e9f8f0; border-color: #c9eedd; color: #0b7d46; }
.alert-danger  { background: #fdecec; border-color: #f6d2d1; color: #b52e2d; }
.alert-warning { background: #fdf5e6; border-color: #f5e2bd; color: #9a6108; }
.alert-info    { background: #eaf2fd; border-color: #cfdefa; color: #2264ab; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------------- 统计卡片 ---------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat::after {
    content: "";
    position: absolute;
    right: -28px;
    top: -28px;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: var(--brand-soft);
    opacity: .8;
}

.stat-label { font-size: 12.5px; color: var(--muted); letter-spacing: .3px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--ink); margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--muted); margin-top: 6px; position: relative; z-index: 1; }
.stat-foot .up { color: var(--success); font-weight: 600; }

/* ---------------- 详情页 ---------------- */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.detail-item {
    padding: 14px 22px;
    border-bottom: 1px solid var(--line-2);
}

.detail-item .k { font-size: 12.5px; color: var(--muted); }
.detail-item .v { margin-top: 4px; color: var(--ink); font-size: 14px; word-break: break-all; }

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------------- 分页 ---------------- */

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--line-2);
    flex-wrap: wrap;
}

.pager-info { color: var(--muted); font-size: 12.5px; }
.pager-links { display: flex; gap: 6px; flex-wrap: wrap; }

.pager-btn {
    min-width: 32px;
    height: 30px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink-2);
    font-size: 12.5px;
}

.pager-btn:hover { border-color: #cfdbf0; background: #f5f8ff; color: var(--brand); }
.pager-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager-btn.is-disabled { color: #b7c1d1; background: #fafbfe; pointer-events: none; }
.pager-gap { color: var(--muted); padding: 0 2px; }

/* ---------------- 登录页 ---------------- */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 12% 8%, rgba(59, 110, 246, .16), transparent 70%),
        radial-gradient(700px 500px at 88% 92%, rgba(24, 160, 200, .12), transparent 70%),
        #101a2c;
}

.auth-card {
    width: 100%;
    max-width: 392px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(6, 12, 24, .42);
    padding: 34px 32px 30px;
}

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }

.auth-title { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.auth-sub { font-size: 12.5px; color: var(--muted); letter-spacing: .4px; margin-top: 2px; }

.auth-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.auth-field label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.auth-field input {
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.auth-field input:focus { border-color: #9db8ff; box-shadow: 0 0 0 3px rgba(59, 110, 246, .13); }

.auth-actions { margin-top: 22px; }
.auth-actions .btn { height: 42px; font-size: 14.5px; font-weight: 600; }

.auth-foot { margin-top: 20px; text-align: center; font-size: 12px; color: #9aa7bb; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, .3);
    }
    .sidebar.is-open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .content { padding: 18px 16px 32px; }
    .topbar { padding: 0 16px; }
    .form-grid, .detail-grid, .split { grid-template-columns: minmax(0, 1fr); }
    .page-title { font-size: 15.5px; }
}

/* ---------------- 模板预览图 ---------------- */

.thumb {
    display: block;
    width: 150px;
    height: auto;
    border-radius: 4px;
    border: 1px solid #e3e8ef;
    background: #f5f7fa;
    flex: 0 0 auto;
}

.thumb:hover { border-color: #9db8ff; }

.thumb-lg { width: 168px; height: 108px; border-radius: 8px; object-fit: cover; }

.thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 84px;
    font-size: 12px;
    color: #9aa7bb;
    font-weight: 400;
}

input[type="file"].input { padding: 8px 10px; background: #fff; cursor: pointer; }

/* ---------- 管理员端项目模板数据表 ---------- */
.stats-table thead th {
    text-align: center;
    background: #fafbfc;
    color: #1f2a3d;
    font-weight: 600;
    border-bottom: 1px solid #e9edf3;
}

.stats-table tbody td {
    text-align: center;
    padding: 16px 14px;
    color: #3a4557;
    border-bottom: 1px solid #f1f3f7;
}

.stats-table tbody tr:hover td { background: #fafcff; }

.stats-table .num {
    color: #00a870;
    font-weight: 600;
}

.stats-table .tpl-id { color: #8a94a6; }

.stats-table .tpl-remark { color: #5b687d; }

.stats-table input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

.stats-table .promo { display: flex; align-items: center; justify-content: center; gap: 6px; }

.stats-table .promo-link {
    color: #2b6cff;
    font-size: 12.5px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.stats-table .promo-link:hover { text-decoration: underline; }

.stats-table .promo-copy {
    flex: none;
    height: 24px;
    padding: 0 8px;
    border: 1px solid #e2e8f2;
    border-radius: 6px;
    background: #fff;
    color: #5b687d;
    font-size: 12px;
    cursor: pointer;
}

.stats-table .promo-copy:hover { border-color: #2b6cff; color: #2b6cff; }

.stats-table .promo-copy.is-copied { border-color: #00a870; color: #00a870; }

.batch-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px 0;
}

.batch-bar form { display: flex; align-items: center; gap: 12px; margin: 0; }

.btn-danger:disabled { opacity: .55; cursor: not-allowed; }

form.inline { display: inline; margin: 0; }

/* ---------- 单选卡片（选择模板页面） ---------- */
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #e3e8ef;
    border-radius: 7px;
    background: #fff;
    color: #3a4557;
    font-size: 13.5px;
    font-weight: 400;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.radio-item:hover { border-color: #b9cdfd; background: #fafcff; }

.radio-item input[type="radio"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #2b6cff;
    cursor: pointer;
}

.radio-item input[type="radio"]:checked + span { color: #2b6cff; font-weight: 600; }

.radio-item:has(input[type="radio"]:checked) { border-color: #2b6cff; background: #f5f8ff; }

/* 带缩略图的模板页面选项 */
.radio-card {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
    grid-column: span 1;
}

.radio-card input[type="radio"] { align-self: flex-start; }

.radio-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    background: #f5f7fa;
    border: 1px solid #eef1f5;
    overflow: hidden;
}

.radio-thumb-frame {
    width: 400%;
    height: 400%;
    border: 0;
    transform: scale(0.25);
    transform-origin: top left;
    pointer-events: none;
    background: #fff;
}
.radio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.radio-thumb-empty {
    color: #b3bccb;
    font-size: 12px;
    font-weight: 400;
}

.radio-card .radio-name {
    font-size: 13px;
    color: #3a4557;
    line-height: 1.4;
    word-break: break-all;
}

.radio-card:has(input[type="radio"]:checked) .radio-name { color: #2b6cff; font-weight: 600; }

/* ---------- 弹窗 ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 16px 24px;
    overflow-y: auto;
}

.modal.is-open { display: flex; }

.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .45);
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 760px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
    overflow: hidden;
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    border-bottom: 1px solid #eef1f5;
}

.modal-head h3 {
    margin: 0;
    font-size: 15px;
    color: #1f2a3d;
}

.modal-head .modal-close {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #8a94a6;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.modal-head .modal-close:hover { background: #f3f5f9; color: #1f2a3d; }

.modal-body {
    padding: 18px 22px;
    max-height: 68vh;
    overflow-y: auto;
}

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid #eef1f5;
    background: #fafbfc;
}

.modal .form-grid { padding: 0; }

/* ---------- 管理员端项目模板卡片 ---------- */
/* 卡片样式见下方「项目模板卡片」新版规则，旧版 .tpl-grid/.tpl-card 已合并删除 */
/* 退款列表用户头像 */
.refund-avatar{width:36px;height:36px;border-radius:50%;object-fit:cover;display:block}
.refund-avatar-fallback{display:inline-flex;align-items:center;justify-content:center;background:#eef3fb;color:#3b82f6;font-size:14px;font-weight:600}
/* 列表编辑/详情弹窗 */
.modal-wide{max-width:1000px}
.modal-loading{padding:44px 0;text-align:center;color:#8a94a6;font-size:13px}
.modal-body .split{display:block}
.modal-body .split > div + div{margin-top:16px}
.modal-body .card{margin:0}
/* user 端操作结果 / 二次确认弹窗 */
.modal-confirm{z-index:70}
.modal-center{align-items:center;padding:16px}
.modal-result{display:flex;align-items:flex-start;gap:12px;padding:4px 0}
.modal-result-icon{width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;flex:0 0 34px;font-size:18px;font-weight:700}
.modal-result-success .modal-result-icon{background:#e9f8f0;color:#0b7d46}
.modal-result-danger .modal-result-icon{background:#fdecec;color:#c73939}
.modal-result-warning .modal-result-icon{background:#fff7e6;color:#a86a00}
.modal-result-text{padding-top:5px;line-height:1.8;color:#344054;font-size:14px}
.modal-result-text p{margin:0}
.modal-result-text p + p{margin-top:6px}
.modal-flash-box{max-width:250px;animation:modal-flash-in .18s ease-out}
.modal-flash-result{align-items:center;justify-content:center;padding:20px 22px;gap:8px}
.modal-flash-title{font-size:16px;font-weight:600;color:#1f2a3d;line-height:1.2}
@keyframes modal-flash-in{from{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:none}}
/* ---------------- user 端右上角账号模块 ---------------- */

.topbar-user {
    position: relative;
    display: flex;
    align-items: center;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}

.topbar-user-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: -6px -8px;
    padding: 6px 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.topbar-user-trigger:hover {
    background: #f4f7fc;
}

.topbar-user .avatar {
    width: 32px;
    height: 32px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 700;
}

.topbar-user .who-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 150px;
}

.topbar-user .who-name {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.35;
}

.topbar-user .who-role {
    color: #8492a6;
    font-size: 11px;
    line-height: 1.3;
}

.user-caret {
    color: #8492a6;
    font-size: 12px;
    line-height: 1;
    transition: transform .15s ease;
}

.topbar-user-trigger[aria-expanded="true"] .user-caret {
    transform: rotate(180deg);
}

.topbar-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    min-width: 168px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(23, 40, 70, .16);
}

.topbar-user-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.topbar-user-menu button:hover {
    background: #f1f5fb;
}

.topbar-user-menu button.is-danger {
    color: var(--danger);
}

.topbar-user-menu button.is-danger:hover {
    background: #fdecec;
}

@media (max-width: 560px) {
    .topbar-user {
        padding-left: 0;
        border-left: 0;
    }
    .topbar-user .who-text { display: none; }
    .topbar-user-trigger { margin: 0; padding: 4px; }
}
/* ---------------- user 端左侧 + 顶栏统一下深蓝 ---------------- */

.side-user .sidebar {
    background: #0f2347;
}

.side-user .topbar {
    background: #0f2347;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 6px 18px rgba(8, 20, 42, .18);
    backdrop-filter: none;
}

.side-user .page-title {
    color: #f1f5ff;
}

.side-user .menu-toggle {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .18);
    color: #eaf1ff;
}

.side-user .topbar-user {
    border-left-color: rgba(255, 255, 255, .18);
}

.side-user .topbar-user .avatar {
    background: rgba(255, 255, 255, .16);
    color: #ffffff;
}

.side-user .topbar-user .who-name {
    color: #f1f5ff;
}

.side-user .topbar-user .who-role {
    color: #a8b9d9;
}

.side-user .topbar-user-trigger:hover {
    background: rgba(255, 255, 255, .1);
}

.side-user .user-caret {
    color: #a8b9d9;
}

.side-user .topbar-user-menu {
    background: #152b52;
    border-color: rgba(255, 255, 255, .16);
    box-shadow: 0 12px 32px rgba(4, 12, 28, .45);
}

.side-user .topbar-user-menu button {
    color: #eaf1ff;
}

.side-user .topbar-user-menu button:hover {
    background: rgba(255, 255, 255, .1);
}

.side-user .topbar-user-menu button.is-danger {
    color: #ff9a96;
}

.side-user .topbar-user-menu button.is-danger:hover {
    background: rgba(224, 69, 63, .18);
}
/* ---------------- 项目模板编辑弹窗：页面模板预览 ---------------- */

.tpl-edit-page-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.tpl-edit-page-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tpl-page-thumb {
    width: 76px;
    height: 48px;
    border: 1px solid #e3e8ef;
    border-radius: 6px;
    background: #f5f7fa;
    overflow: hidden;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa7bb;
    font-size: 11px;
}

.tpl-page-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpl-page-thumb.is-empty {
    background: #f7f9fc;
}

.tpl-edit-page-name {
    color: #3c4a61;
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ---------------- user 端顶栏：Bark 通知 ---------------- */

.bark-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 18px;
    background: rgba(255, 255, 255, .1);
    color: #eaf1ff;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.bark-top-btn:hover {
    background: rgba(255, 255, 255, .18);
}

.bark-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9fb0cf;
    flex: 0 0 auto;
}

.bark-top-btn.is-on .bark-dot {
    background: #39d98a;
    box-shadow: 0 0 0 2px rgba(57, 217, 138, .18);
}

.bark-note {
    padding: 12px 14px;
    border: 1px solid #e5eaf2;
    border-radius: 8px;
    background: #f7f9fc;
    color: #6b7c95;
    font-size: 12px;
    line-height: 1.7;
}

.bark-note a {
    color: #1f5fd0;
    text-decoration: none;
    margin-left: 4px;
}

.bark-note a:hover {
    text-decoration: underline;
}

.bark-test-btn {
    margin-right: auto;
}
/* ---------------- 项目模板管理（admin 端） ---------------- */

.tpl-admin-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 26px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: linear-gradient(120deg, #0f2347 0%, #1b3f6e 100%);
    color: #fff;
    box-shadow: 0 10px 26px rgba(15, 35, 71, .16);
}

.tpl-hero-copy { min-width: 0; }
.tpl-hero-copy h2 { margin: 4px 0 6px; font-size: 22px; color: #fff; }
.tpl-hero-copy p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .72); }
.tpl-eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .58); }

.tpl-hero-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.tpl-hero-actions .btn { border-color: rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .10); color: #fff; }
.tpl-hero-actions .btn:hover { background: rgba(255, 255, 255, .18); }
.tpl-hero-actions .btn-primary { border-color: #fff; background: #fff; color: #17345f; }
.tpl-hero-actions .btn-primary:hover { background: #eef4ff; }

.tpl-admin-section { padding: 20px 22px; margin-bottom: 18px; }
.tpl-section-head { display: flex; align-items: flex-start; gap: 14px; padding-bottom: 14px; }
.tpl-section-head .spacer { flex: 1; }
.tpl-section-head h3 { margin: 0 0 4px; font-size: 15px; }
.tpl-section-head p { margin: 0; font-size: 12.5px; color: var(--muted); }
.tpl-section-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.tpl-cat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.tpl-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfe;
}
.tpl-cat-item.is-off { opacity: .62; background: #f6f7f9; }
.tpl-cat-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tpl-cat-name { font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.tpl-cat-name:hover { color: #1f5fd0; }
.tpl-cat-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tpl-cat-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tpl-cat-actions form { margin: 0; }

.tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
    padding: 18px;
}

.tpl-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease;
}
.tpl-card:hover { transform: translateY(-2px); border-color: #b9cdfd; box-shadow: 0 10px 24px rgba(24, 46, 80, .10); }

.tpl-card-cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: #edf2f9;
    color: #8798ad;
    text-decoration: none;
    overflow: hidden;
}
.tpl-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-cover-placeholder { font-size: 12.5px; }
.tpl-card-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 9px;
    border-radius: 20px;
    background: rgba(15, 35, 71, .78);
    color: #fff;
    font-size: 11px;
    line-height: 1.6;
}

.tpl-card-main { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px; flex: 1; }
.tpl-card-title { margin: 0; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-card-sub { margin-top: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-card-desc { margin: 0; min-height: 34px; font-size: 12.5px; line-height: 1.55; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-card-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.tpl-card-meta b { color: var(--ink); font-size: 14px; }
.tpl-card-promo { padding: 6px 8px; border-radius: 6px; background: #f5f8fd; font-family: Consolas, monospace; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-card-promo a { color: #1f5fd0; text-decoration: none; }
.tpl-card-promo a:hover { text-decoration: underline; }
.tpl-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; margin-top: auto; border-top: 1px solid var(--line-2); }
.tpl-card-actions form { margin: 0; }
.tpl-card-actions .spacer { flex: 1; }

.tpl-empty { padding: 44px 20px; text-align: center; }
.tpl-empty h3 { margin: 0 0 6px; font-size: 15px; }
.tpl-empty p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }

.tpl-detail-cover { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-bottom: 14px; background: #edf2f9; }
.tpl-cover-empty { display: flex; align-items: center; justify-content: center; height: 160px; color: #8798ad; font-size: 13px; }

@media (max-width: 760px) {
    .tpl-admin-hero { flex-direction: column; align-items: stretch; padding: 20px; }
    .tpl-hero-actions { margin-left: 0; }
    .tpl-cat-item { flex-direction: column; align-items: stretch; }
    .tpl-cat-actions { justify-content: flex-start; }
    .tpl-grid { grid-template-columns: 1fr; padding: 14px; }
    .tpl-admin-section { padding: 16px; }
}
/* ---------------- 控制面板：12 项指标 + 七日收益 ---------------- */

.dashboard-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-stat-grid .stat {
    min-height: 132px;
    padding: 20px 22px 17px;
    border: 1px solid #e7edf5;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #fbfdff 55%, #f4faf8 100%);
    box-shadow: 0 8px 20px rgba(23, 48, 84, .06);
}

.dashboard-stat-grid .stat::after {
    display: none;
}

.dashboard-stat-grid .stat-label {
    max-width: calc(100% - 58px);
    font-size: 12.5px;
    color: #7f8ca2;
    letter-spacing: .3px;
}

.dashboard-stat-grid .stat-value {
    max-width: calc(100% - 54px);
    margin-top: 10px;
    font-size: 31px;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -.4px;
    color: #26364f;
}

.dashboard-stat-grid .stat-foot {
    margin-top: 9px;
    font-size: 12px;
    color: #8b98aa;
}

.dashboard-stat-foot {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dashboard-stat-foot.is-up {
    color: #17a673;
}

.dashboard-trend {
    color: #17a673;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.dashboard-stat-foot b {
    color: #17a673;
    font-weight: 600;
}

.dashboard-rate-value {
    color: #17a673;
}

.dashboard-stat-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2db7a7;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(45, 183, 167, .24);
}

.dashboard-stat-icon svg {
    display: block;
    width: 23px;
    height: 23px;
}

.dashboard-stat-icon--text {
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
}

.dashboard-chart-card {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-radius: 14px;
}

.dashboard-chart-head {
    padding: 18px 22px 0;
}

.dashboard-chart-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
}

.dashboard-chart-keys {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 9px 24px;
    width: 100%;
    max-width: 100%;
    padding: 16px 22px 4px;
    box-sizing: border-box;
}

.dashboard-chart-key {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: #33425a;
    white-space: nowrap;
}

.dashboard-chart-key i {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: 0 0 14px;
}

.dashboard-chart-key i.is-money { background: #45a86b; }
.dashboard-chart-key i.is-orders { background: #ef8138; }
.dashboard-chart-key i.is-users { background: #3294d6; }
.dashboard-chart-key i.is-rate { background: #7c5ce6; }

.dashboard-chart {
    position: relative;
    padding: 0 18px 10px 10px;
}

.dashboard-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
}

.dashboard-chart-tip {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 150px;
    transform: translateX(-50%);
    padding: 8px 10px;
    border: 1px solid #e4eaf4;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(20, 40, 80, .16);
    opacity: 0;
    transition: opacity .12s ease;
    pointer-events: none;
    z-index: 5;
}

.dashboard-chart-tip-head {
    padding-bottom: 3px;
    margin-bottom: 3px;
}

.dashboard-chart-tip-head b {
    font-size: 13.5px;
    color: var(--ink);
}

.dashboard-chart-tip-head span {
    font-size: 11px;
    color: var(--muted);
}

.dashboard-chart-tip-head .dashboard-chart-tip-today {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: #eaf0ff;
    color: #2b56cc;
    font-size: 11px;
    font-weight: 600;
}

.dashboard-chart-tip-row {
    padding: 2px 0;
    font-size: 12px;
    color: #667085;
    white-space: nowrap;
}

.dashboard-chart-tip-row span {
    display: inline-flex;
    align-items: center;
}

.dashboard-chart-tip-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 2px;
}

.dashboard-chart-tip-dot.is-money { background: #45a86b; }
.dashboard-chart-tip-dot.is-orders { background: #ef8138; }
.dashboard-chart-tip-dot.is-users { background: #3294d6; }
.dashboard-chart-tip-dot.is-rate { background: #7c5ce6; }

.dashboard-chart-tip-row b {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #26364f;
    font-variant-numeric: tabular-nums;
}

.template-rank-card {
    margin-bottom: 18px;
}

.template-rank-table {
    min-width: 760px;
}

.template-rank-table thead th {
    padding: 14px 12px;
}

.template-rank-table tbody td {
    padding: 14px 12px;
}

@media (max-width: 1200px) {
    .dashboard-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .dashboard-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-chart { padding: 0 4px 0 0; }
    .dashboard-chart-tip { width: 150px; }
}

@media (max-width: 560px) {
    .dashboard-chart-keys { gap: 8px 14px; padding: 14px 14px 6px; }
    .dashboard-chart-key { font-size: 13px; gap: 6px; }
    .dashboard-chart-key i { width: 10px; height: 10px; flex-basis: 10px; }
    .dashboard-stat-grid { gap: 8px; }
    .dashboard-stat-grid .stat { padding: 14px 14px 13px; min-height: 112px; }
    .dashboard-stat-grid .stat-label { max-width: calc(100% - 44px); }
    .dashboard-stat-grid .stat-value { max-width: calc(100% - 44px); font-size: 24px; margin-top: 8px; }
    .dashboard-stat-grid .stat-foot { margin-top: 7px; font-size: 10.5px; }
    .dashboard-stat-icon { top: 12px; right: 12px; width: 36px; height: 36px; }
    .dashboard-stat-icon svg { width: 19px; height: 19px; }
    .dashboard-stat-icon--text { font-size: 18px; }
    .dashboard-chart-tip { width: 150px; padding: 8px 10px; }
}
/* ---------------- 管理员排行榜 ---------------- */

.rank-top-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 18px;
    background: rgba(255, 255, 255, .12);
    color: #eaf1ff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: .5px;
}

.rank-top-badge.rank-1 {
    border-color: rgba(255, 214, 102, .55);
    background: linear-gradient(135deg, #c68a1b, #f0bd45);
    color: #fffdf2;
    box-shadow: 0 3px 10px rgba(198, 138, 27, .35);
}

.rank-top-badge.rank-2 {
    border-color: rgba(226, 232, 240, .58);
    background: linear-gradient(135deg, #73849c, #aebccd);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(115, 132, 156, .3);
}

.rank-top-badge.rank-3 {
    border-color: rgba(224, 164, 120, .55);
    background: linear-gradient(135deg, #9b6238, #c98a5b);
    color: #fff8f2;
    box-shadow: 0 3px 10px rgba(155, 98, 56, .3);
}

.rank-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.rank-podium-card {
    padding: 18px;
    border: 1px solid #e3e9f2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(24, 44, 74, .05);
    border-top: 4px solid #cbd5e1;
}

.rank-podium-card.rank-1 { border-top-color: #e2ad33; }
.rank-podium-card.rank-2 { border-top-color: #8b9bb4; }
.rank-podium-card.rank-3 { border-top-color: #b57445; }

.rank-podium-top {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.rank-podium-name {
    font-size: 14px;
    font-weight: 700;
    color: #22324a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-podium-amount {
    margin-top: 12px;
    color: #0f2747;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.rank-podium-meta {
    margin-top: 6px;
    color: #73839a;
    font-size: 12px;
    line-height: 1.7;
}

.rank-podium-meta b { color: #38506e; }

.rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 58px;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #52657f;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.rank-pill.rank-1 { background: #fef3c7; color: #946200; }
.rank-pill.rank-2 { background: #eef2f7; color: #52657f; }
.rank-pill.rank-3 { background: #f6e5d8; color: #95552b; }

.rank-admin {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 150px;
}

.rank-admin .avatar {
    width: 32px;
    height: 32px;
    background: #eaf1fb;
    color: #2b5f9e;
    font-weight: 700;
}

.rank-admin-name {
    color: #22324a;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.rank-table td { vertical-align: middle; }
.rank-table th, .rank-table td { white-space: nowrap; }

@media (max-width: 900px) {
    .rank-podium { grid-template-columns: 1fr; }
}
/* 前三名皇冠图标 */
.rank-crown {
    width: 15px;
    height: 15px;
    display: inline-block;
    flex: 0 0 auto;
    fill: currentColor;
    color: #c68a1b;
}
.rank-crown.crown-2 { color: #7c8ca5; }
.rank-crown.crown-3 { color: #a7653c; }
.rank-top-badge .rank-crown { width: 14px; height: 14px; }
.rank-top-badge .rank-crown.crown-1 { color: #fff5cf; }
.rank-top-badge .rank-crown.crown-2 { color: #ffffff; }
.rank-top-badge .rank-crown.crown-3 { color: #fff1e6; }
/* ---------------- 域名新增弹窗 ---------------- */

.cname-note {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #f5d7a6;
    border-radius: 8px;
    background: #fff9ed;
    color: #8a5a12;
    font-size: 13px;
    line-height: 1.75;
}

.cname-note code {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #f0d49a;
    color: #7a4a00;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
}