/*
 * 隐邮 · 匿名邮件系统
 * 作者：灵雲  QQ：2667698574  交流群：1107546875
 * 版权所有 © 2026 灵雲。保留所有权利。
 */
/* ==========================================================================
   隐邮 · 匿名邮件系统  —— 蓝白官网风格样式
   原生 CSS，无框架。主色 #165DFF
   ========================================================================== */

:root {
    --primary: #165DFF;
    --primary-600: #0E42D2;
    --primary-400: #4080FF;
    --primary-50: #E8F3FF;
    --primary-100: #D6E8FF;

    --text: #1D2129;
    --text-2: #4E5969;
    --muted: #86909C;
    --border: #E5E6EB;
    --border-2: #F2F3F5;
    --bg: #F7F8FA;
    --white: #FFFFFF;

    --success: #00B42A;
    --success-bg: #E8FFEA;
    --success-bd: #AFF0B5;
    --danger: #F53F3F;
    --danger-bg: #FFECE8;
    --danger-bd: #FFCDC5;
    --warning: #FF7D00;
    --warning-bg: #FFF7E8;
    --warning-bd: #FFD08A;

    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(29, 33, 41, .06);
    --shadow: 0 4px 16px rgba(29, 33, 41, .06);
    --shadow-lg: 0 12px 40px rgba(22, 93, 255, .10);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: .15s; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.35; font-weight: 600; }
p { margin: 0 0 12px; }
ul { margin: 0; padding-left: 20px; }
code { background: var(--border-2); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.icon { width: 18px; height: 18px; vertical-align: -3px; flex: none; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
    font-size: 14px; font-family: inherit; font-weight: 500; cursor: pointer;
    transition: .16s; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-600); color: #fff; box-shadow: 0 4px 12px rgba(22, 93, 255, .28); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text-2); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--border-2); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #D93026; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------------- 顶栏 ---------------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--text); min-width: 0; }
.brand:hover { color: var(--primary); }
/* 防御：站点名在任何宽度下都不允许被竖排压扁成"每字一行" */
.brand-text { white-space: nowrap; flex: none; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #5B8DEF 100%); color: #fff;
    box-shadow: 0 4px 12px rgba(22, 93, 255, .28); overflow: hidden; flex: none;
}
.brand-mark .icon { width: 20px; height: 20px; }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 8px; color: var(--text-2); font-size: 14px;
}
.topnav-link:hover { background: var(--border-2); color: var(--primary); }
.topnav-link.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.quota-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 20px;
    background: var(--primary-50); color: var(--primary); font-size: 13px; font-weight: 600;
}
.quota-chip:hover { background: var(--primary-100); }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text-2); border-radius: 2px; }

/* 站点 Logo（后台与前台共用） */
/* 防御：logo 万一脱离 .brand-mark 包裹，也绝不允许按原始尺寸撑破布局 */
img.brand-img { max-width: 100%; height: auto; display: block; }
.brand-mark .brand-img {
    width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
}
.admin-brand .brand-mark { flex: none; }

.site-main { min-height: calc(100vh - 62px - 260px); padding: 28px 0 56px; }

/* ---------------- 卡片 ---------------- */
.card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); padding: 22px 24px; margin-bottom: 20px;
}
.card-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin-bottom: 16px; flex-wrap: wrap; }
.card-title > .icon, .card-title > svg { flex: none; }
.card-title .icon { color: var(--primary); }
.card-title .extra { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--muted); display: inline-flex; gap: 4px; flex-wrap: wrap; }
.card-plain { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-dash { grid-template-columns: 320px 1fr; align-items: start; }

/* ---------------- 首页 Hero ---------------- */
.hero {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #F0F6FF 0%, #FFFFFF 55%, #F5F9FF 100%);
    border: 1px solid var(--border); border-radius: 20px; padding: 56px 48px; margin-bottom: 28px;
}
.hero::after {
    content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(22, 93, 255, .10) 0%, rgba(22, 93, 255, 0) 70%);
}
.hero h1 { font-size: 38px; letter-spacing: -.5px; margin-bottom: 14px; }
.hero .accent { color: var(--primary); }
.hero p.lead { font-size: 16px; color: var(--text-2); max-width: 620px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-tags { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero-tags span {
    font-size: 12px; color: var(--text-2); background: rgba(255, 255, 255, .8);
    border: 1px solid var(--border); padding: 5px 12px; border-radius: 20px;
}

.section-title { text-align: center; margin: 40px 0 22px; }
.section-title h2 { font-size: 26px; margin-bottom: 6px; }
.section-title p { color: var(--muted); margin: 0; }

.feature-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 24px; transition: .2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-100); }
.feature-icon {
    width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary);
    display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.feature-icon .icon { width: 22px; height: 22px; }
.feature-card h3 { font-size: 16px; margin-bottom: 6px; }
.feature-card p { color: var(--muted); font-size: 13px; margin: 0; }

.steps-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step-item { position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.step-num {
    width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; margin-bottom: 10px;
}
.step-item h4 { margin: 0 0 4px; font-size: 15px; }
.step-item p { margin: 0; font-size: 13px; color: var(--muted); }

.notice-bar {
    display: flex; gap: 10px; align-items: flex-start;
    background: var(--warning-bg); border: 1px solid var(--warning-bd); color: #8A4E00;
    padding: 14px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 20px;
}
.notice-bar .icon { color: var(--warning); }

/* ---------------- 表单 ---------------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.form-control {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit; background: #fff; transition: .15s; color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 93, 255, .12); }
textarea.form-control { min-height: 160px; resize: vertical; line-height: 1.7; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); font-weight: 400; cursor: pointer; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--primary); }
.input-group { display: flex; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group-addon {
    display: flex; align-items: center; padding: 0 12px; background: var(--border-2);
    border: 1px solid var(--border); border-left: 0; border-radius: 0 8px 8px 0; color: var(--muted); font-size: 13px; white-space: nowrap;
}

/* ---------------- 登录 / 注册 ---------------- */
.auth-wrap { display: flex; justify-content: center; padding: 30px 0 60px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 34px 32px; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head .brand-mark { width: 46px; height: 46px; border-radius: 12px; margin: 0 auto 12px; }
.auth-head h2 { font-size: 21px; margin: 0 0 4px; }
.auth-head p { color: var(--muted); font-size: 13px; margin: 0; }
.auth-links { display: flex; justify-content: space-between; font-size: 13px; margin-top: 16px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }

/* 记录页：移动端（≤768px）改为卡片式堆叠，避免横向滚动与拖动 */
@media (max-width: 768px) {
    .record-table thead { display: none; }
    .record-table, .record-table tbody, .record-table tr, .record-table td { display: block; width: 100%; }
    .record-table tr {
        background: #fff; border: 1px solid var(--border); border-radius: 12px;
        margin-bottom: 12px; padding: 2px 14px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    }
    .record-table td {
        display: flex; align-items: center; justify-content: space-between; gap: 14px;
        padding: 10px 0; border-bottom: 1px solid var(--border-2); text-align: right;
    }
    .record-table td:last-child { border-bottom: 0; }
    .record-table td::before {
        content: attr(data-label); flex: none; text-align: left; margin-right: auto;
        color: var(--muted); font-size: 13px; font-weight: 600;
    }
    .record-table td.break-all { word-break: break-all; }
    .record-table td.break-all::before { align-self: flex-start; }
    .record-table td.empty-td { justify-content: center; }
    .record-table td.empty-td::before { display: none; }
    .record-table td.empty-td .table-empty { padding: 30px 0; }
}

/* ≤768px：后台筛选条 / 通用表格响应式
   目标：手机端筛选条不再拥挤一行；后台表格（带 .responsive）转堆叠卡片，一眼看清每条记录 */
@media (max-width: 768px) {
    /* 卡片标题：右侧 extra 在窄屏下换行到下一行，按钮均匀分布 */
    .card-title { gap: 10px; }
    .card-title .extra { width: 100%; margin-left: 0; justify-content: flex-start; gap: 8px; }
    .card-title .extra a {
        flex: 1; justify-content: center; padding: 7px 10px; font-size: 12.5px;
        border: 1px solid var(--border); border-radius: 8px; background: #fff;
        color: var(--text-2); font-weight: 500;
    }
    .card-title .extra a + a { border-color: var(--primary-50); background: var(--primary-50); color: var(--primary); }
    .card-title .extra a:hover { border-color: var(--primary); color: var(--primary); }
    /* 后台卡片容器：内边距收一收，留更多空间给内容 */
    .admin-content .card, .card { padding: 18px 16px; }
    .admin-content .card-plain { padding: 0; }

    /* 筛选条：垂直堆叠，每项占满整行，按钮也占满 */
    .filter-bar { flex-direction: column; align-items: stretch; gap: 12px; }
    .filter-bar > .form-group { width: 100%; flex: 0 0 100%; }
    .filter-bar > .btn,
    .filter-bar > a { width: 100%; flex: 0 0 100%; justify-content: center; }

    /* 通用表格卡片化（卡密列表等）：表头隐藏，行变独立卡片，td 用 ::before 显示 data-label */
    .table.responsive thead { display: none; }
    .table.responsive,
    .table.responsive tbody,
    .table.responsive tr,
    .table.responsive td { display: block; width: 100%; box-sizing: border-box; }
    .table.responsive tr {
        background: #fff; border: 1px solid var(--border);
        border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
        box-shadow: 0 2px 6px rgba(15, 23, 42, .04);
    }
    .table.responsive td {
        padding: 6px 0; border: 0; display: flex; align-items: center; gap: 12px;
        font-size: 14px; min-height: 26px;
    }
    .table.responsive td::before {
        content: attr(data-label); flex: none; width: 78px;
        text-align: left; color: var(--muted); font-size: 12px;
    }
    .table.responsive td.code-cell { font-family: 'Courier New', monospace; word-break: break-all; }
    .table.responsive td.code-cell::before { align-self: flex-start; padding-top: 2px; }
    .table.responsive td[data-label="选择"] {
        padding: 0 0 6px; justify-content: flex-end;
        border-bottom: 1px dashed var(--border-2); margin-bottom: 6px;
    }
    .table.responsive td[data-label="选择"]::before { display: none; }
    .table.responsive td[data-label="状态"] .badge { margin-left: auto; }
    .table.responsive td.nowrap { white-space: normal; }
    /* 表格行内操作按钮：移动端占满一行、垂直堆叠，更易点 */
    .table.responsive .row-actions {
        flex-direction: column; align-items: stretch; width: 100%;
        margin-top: 4px;
    }
    .table.responsive .row-actions .btn { width: 100%; justify-content: center; }
    .table.responsive td[data-label="操作"] { flex-wrap: wrap; }
    .table.responsive td[data-label="操作"]::before { padding-top: 6px; }
    /* 批量操作按钮组：移动端每个按钮占一行 */
    .bulk-actions { flex-direction: column; align-items: stretch; }
    .bulk-actions .btn { width: 100%; justify-content: center; }

    /* 生成结果区域：标题行垂直堆叠，避免长文本溢出 */
    .gen-result__head { flex-direction: column; align-items: stretch; }
    .gen-result__head .btn { width: 100%; justify-content: center; }

    /* 卡密页双列（生成 + 列表）改为单列堆叠 */
    .grid.grid-2 { grid-template-columns: 1fr; }
}

table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
    text-align: left; padding: 12px 14px; background: #FAFBFC; color: var(--muted);
    font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.table td { padding: 12px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
table.table tbody tr:hover { background: #FAFBFC; }
table.table tbody tr:last-child td { border-bottom: 0; }
.table-empty { padding: 48px 0; text-align: center; color: var(--muted); }
.table-empty .icon { width: 34px; height: 34px; color: var(--border); display: block; margin: 0 auto 8px; }

/* ---------------- 徽章 / 提示 ---------------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px;
    font-size: 12px; font-weight: 500; line-height: 1.7;
}
.badge-success { background: var(--success-bg); color: #18702A; border: 1px solid var(--success-bd); }
.badge-danger { background: var(--danger-bg); color: #AD3527; border: 1px solid var(--danger-bd); }
.badge-warning { background: var(--warning-bg); color: #8A4E00; border: 1px solid var(--warning-bd); }
.badge-primary { background: var(--primary-50); color: var(--primary); border: 1px solid var(--primary-100); }
.badge-default { background: var(--border-2); color: var(--text-2); border: 1px solid var(--border); }

.alert {
    position: relative; display: flex; align-items: flex-start; gap: 11px;
    padding: 12px 14px 12px 18px; border-radius: 14px; font-size: 13px;
    margin-bottom: 16px; background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 6px 22px rgba(29, 33, 41, .07);
    overflow: hidden;
    animation: yxAlertIn .36s cubic-bezier(.16, 1.02, .3, 1);
}
.alert::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--alert-accent, var(--primary));
}
.alert .icon { margin-top: 2px; }
.alert-success { --alert-accent: var(--success); border-color: #D8EFDF; }
.alert-danger  { --alert-accent: var(--danger);  border-color: #FBD5D1; }
.alert-warning { --alert-accent: var(--warning); border-color: #FCE3B5; }
.alert-info    { --alert-accent: var(--primary); border-color: #C6D9FF; }
@keyframes yxAlertIn {
    0% { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: none; }
}
.alert-out { opacity: 0; transform: translateY(-6px); transition: .32s ease; }
.alert-ico {
    flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--alert-bg, var(--border-2)); margin-top: 1px;
}
.alert-ico .icon { width: 15px; height: 15px; margin: 0; }
.alert-success .alert-ico { background: var(--success-bg); color: var(--success); }
.alert-danger  .alert-ico { background: var(--danger-bg);  color: var(--danger); }
.alert-warning .alert-ico { background: var(--warning-bg); color: #B26000; }
.alert-info    .alert-ico { background: var(--primary-50); color: var(--primary); }
.alert-body { flex: 1; min-width: 0; padding-top: 1px; }
.alert-body b { display: block; font-weight: 600; font-size: 14px; line-height: 1.5; color: var(--text); }
.alert-body span { display: block; font-size: 12.5px; line-height: 1.6; color: var(--text-2); margin-top: 1px; }
.alert-close {
    flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
    color: var(--muted); opacity: .45; padding: 4px; margin: -4px -4px 0 2px;
    display: inline-flex; transition: .15s; border-radius: 6px;
}
.alert-close:hover { opacity: .9; background: var(--border-2); }
.alert-close .icon { width: 13px; height: 13px; margin: 0; }

/* ---------------- 全站公告 ---------------- */
.announce {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 13px 16px; border-radius: var(--radius); font-size: 13.5px;
    margin-bottom: 18px; border: 1px solid; line-height: 1.7;
}
.announce .icon { margin-top: 3px; flex: none; }
.announce-body { flex: 1; min-width: 0; }
.announce-title { display: block; margin-bottom: 2px; font-size: 13px; font-weight: 700; }
.announce-text { opacity: .92; word-break: break-word; }
.announce-info { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-100); }
.announce-success { background: var(--success-bg); color: #18702A; border-color: var(--success-bd); }
.announce-warning { background: var(--warning-bg); color: #8A4E00; border-color: var(--warning-bd); }
.announce-danger { background: var(--danger-bg); color: #AD3527; border-color: var(--danger-bd); }

/* ---------------- 弹窗公告 ---------------- */
.modal-mask {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(15, 23, 42, .5);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    animation: fadeIn .18s ease;
}
.modal-box {
    background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25); overflow: hidden;
    animation: modalIn .22s cubic-bezier(.2, .8, .3, 1);
}
.modal-head {
    display: flex; align-items: center; gap: 9px;
    padding: 15px 18px; border-bottom: 1px solid var(--border-2); font-size: 15px;
}
.modal-head b { flex: 1; }
.modal-head .icon { color: currentColor; }
.modal-close {
    border: 0; background: transparent; cursor: pointer; color: inherit;
    padding: 4px; border-radius: 6px; display: flex; align-items: center; opacity: .7;
}
.modal-close:hover { background: rgba(0, 0, 0, .06); opacity: 1; }
.modal-body {
    padding: 16px 18px; font-size: 13.5px; line-height: 1.8;
    color: var(--text-2); max-height: 48vh; overflow: auto; word-break: break-word;
}
.modal-foot { padding: 12px 18px 16px; display: flex; justify-content: flex-end; }
.notice-modal-icon { display: flex; }
.notice-modal.announce-info .modal-head { background: var(--primary-50); color: var(--primary-600); }
.notice-modal.announce-success .modal-head { background: var(--success-bg); color: #18702A; }
.notice-modal.announce-warning .modal-head { background: var(--warning-bg); color: #8A4E00; }
.notice-modal.announce-danger .modal-head { background: var(--danger-bg); color: #AD3527; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* 后台预览模式：静态卡片，不遮挡页面 */
.modal-preview {
    position: relative; inset: auto; background: transparent;
    padding: 0; margin: 0; z-index: auto; animation: none;
}
.modal-preview .modal-box {
    box-shadow: var(--shadow); margin: 0; animation: none; max-width: 520px;
}
/* 正式弹窗：遮罩空白处可点击关闭，光标提示可点击；弹窗内容保持默认光标 */
.modal-mask:not(.modal-preview) { cursor: pointer; }
.modal-mask:not(.modal-preview) .modal-box { cursor: default; }

/* ---------------- 个人中心 ---------------- */
.profile-card { text-align: center; padding: 28px 22px; }
.avatar {
    width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary) 0%, #6AA1FF 100%); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600;
}
.profile-name { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.profile-mail { font-size: 12px; color: var(--muted); margin-bottom: 16px; word-break: break-all; }
.quota-big {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, #5B8DEF 100%); color: #fff;
    border-radius: var(--radius); padding: 18px 18px 16px; margin-bottom: 16px;
    box-shadow: 0 10px 22px rgba(22, 93, 255, .18);
}
.quota-big .qb-icon { position: absolute; right: 12px; top: 12px; opacity: .22; }
.quota-big .qb-icon .icon { width: 36px; height: 36px; }
.quota-big .qb-label { font-size: 12px; opacity: .92; }
.quota-big .qb-num { font-size: 40px; font-weight: 800; line-height: 1.1; margin: 4px 0 2px; display: flex; align-items: baseline; gap: 5px; }
.quota-big .qb-num .qb-unit { font-size: 14px; font-weight: 600; opacity: .85; }
.quota-big .qb-cap { font-size: 12px; opacity: .82; }

/* 首页 hero 顶部站名标识 */
.hero-brand { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.hero-brand .brand-mark { width: 40px; height: 40px; border-radius: 11px; }
.hero-brand-name { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: .5px; }
@media (max-width: 640px) { .hero-brand { margin-bottom: 14px; } .hero-brand-name { font-size: 16px; } }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.stat-mini { background: var(--border-2); border-radius: 10px; padding: 10px 6px; text-align: center; }
.stat-mini b { display: block; font-size: 16px; }
.stat-mini span { font-size: 11px; color: var(--muted); }

.sign-box { text-align: center; }
.sign-btn {
    width: 100%; padding: 14px; border-radius: var(--radius); border: 0; cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, #4E86FF 100%); color: #fff;
    font-size: 15px; font-weight: 600; font-family: inherit; display: flex; align-items: center;
    justify-content: center; gap: 8px; transition: .2s;
}
.sign-btn:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(22, 93, 255, .3); transform: translateY(-1px); }
.sign-btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }
.sign-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 12px; }
.streak-dots { display: flex; gap: 5px; justify-content: center; margin: 14px 0 4px; flex-wrap: wrap; }
.streak-dot {
    width: 26px; height: 26px; border-radius: 8px; background: var(--border-2); color: var(--muted);
    display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600;
}
.streak-dot.on { background: var(--primary-50); color: var(--primary); border: 1px solid var(--primary-100); }

/* 抽奖 */
.lottery-panel { text-align: center; }
.lottery-wheel {
    width: 160px; height: 160px; margin: 8px auto 16px; border-radius: 50%;
    background: conic-gradient(var(--primary) 0deg 60deg, #60A5FA 60deg 120deg, var(--primary-400) 120deg 180deg,
                #93C5FD 180deg 240deg, var(--primary) 240deg 300deg, #60A5FA 300deg 360deg);
    display: flex; align-items: center; justify-content: center; position: relative;
    box-shadow: 0 10px 30px rgba(22, 93, 255, .25);
}
.lottery-wheel::before {
    content: ''; position: absolute; inset: 12px; border-radius: 50%; background: #fff;
}
.lottery-inner {
    position: relative; width: 96px; height: 96px; border-radius: 50%; background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--primary); font-weight: 700; font-size: 13px; gap: 2px; z-index: 1;
}
.lottery-inner .icon { width: 26px; height: 26px; }
.spin { animation: spin .9s cubic-bezier(.25, .1, .25, 1); }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(1080deg); } }
.prize-result {
    margin-top: 14px; padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 600;
    background: var(--primary-50); color: var(--primary); border: 1px solid var(--primary-100); display: none;
}
.prize-result.lose { background: var(--border-2); color: var(--text-2); border-color: var(--border); }
.prize-result.show { display: block; animation: pop .3s ease; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.prize-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.prize-item {
    border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; background: #fff;
}
.prize-item b { display: block; color: var(--primary); font-size: 15px; }
.prize-item span { font-size: 11px; color: var(--muted); }

/* ---------------- 通用：表单底部按钮区 ---------------- */
.card-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap;
    padding-top: 14px; margin-top: 10px; border-top: 1px dashed var(--border-2); }
.card-foot .btn { min-width: 120px; }

/* ---------------- 用户仪表盘 ---------------- */
.welcome-bar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(135deg, #165DFF 0%, #4080FF 60%, #6AA1FF 100%);
    color: #fff; border-radius: var(--radius-lg); padding: 22px 26px; margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(22, 93, 255, .18);
}
.welcome-avatar {
    width: 56px; height: 56px; border-radius: 50%; flex: none;
    background: rgba(255, 255, 255, .22); border: 2px solid rgba(255, 255, 255, .45);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700;
}
.welcome-info { flex: 1; min-width: 200px; }
.welcome-info h2 { margin: 0 0 4px; font-size: 19px; }
.welcome-info p { margin: 0; font-size: 13px; opacity: .92; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.welcome-info .badge { background: rgba(255, 255, 255, .2); color: #fff; border-color: rgba(255, 255, 255, .35); }
.welcome-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.welcome-actions .btn-primary { background: #fff; color: var(--primary); }
.welcome-actions .btn-primary:hover { background: #F2F6FF; color: var(--primary-600); }
.welcome-actions .btn-outline { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4); color: #fff; }
.welcome-actions .btn-outline:hover { background: rgba(255, 255, 255, .28); color: #fff; }

/* 统计卡 */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.dash-stat {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 18px; display: flex; flex-direction: column; gap: 12px; position: relative;
    transition: .2s;
}
.dash-stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.ds-icon {
    width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
}
.ds-icon .icon { width: 21px; height: 21px; }
.ds-blue { background: var(--primary-50); color: var(--primary); }
.ds-green { background: var(--success-bg); color: var(--success); }
.ds-orange { background: var(--warning-bg); color: var(--warning); }
.ds-purple { background: #F3E8FF; color: #7C3AED; }
.ds-num { font-size: 27px; font-weight: 700; line-height: 1.15; }
.ds-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ds-foot { font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 9px; }
.ds-foot a { color: var(--primary); }

/* 签到档位 */
.tier-list { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.tier-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 9px;
    background: var(--border-2); font-size: 13px; color: var(--text-2);
}
.tier-item .icon { width: 16px; height: 16px; color: var(--muted); }
.tier-item span { flex: 1; }
.tier-item b { color: var(--text-2); }
.tier-item.reached { background: var(--primary-50); color: var(--primary); }
.tier-item.reached .icon { color: var(--primary); }
.tier-item.reached b { color: var(--primary); }

/* 流水小图标 */
.q-icon {
    width: 30px; height: 30px; border-radius: 9px; display: inline-flex;
    align-items: center; justify-content: center;
}
.q-icon .icon { width: 16px; height: 16px; }
.q-icon.plus { background: var(--success-bg); color: var(--success); }
.q-icon.minus { background: var(--danger-bg); color: var(--danger); }

/* 快捷操作 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.quick-card {
    display: flex; align-items: center; gap: 12px; padding: 16px;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    color: var(--text); transition: .2s;
}
.quick-card:hover { border-color: var(--primary-100); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.quick-card > div:first-child { flex: none; }
.quick-card b { display: block; font-size: 14px; }
.quick-card span { font-size: 12px; color: var(--muted); }
.quick-card > .icon:last-child { margin-left: auto; color: var(--muted); flex: none; }
.qc-icon {
    width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
}
.qc-icon .icon { width: 20px; height: 20px; }

/* 抽奖页 */
.lottery-card { text-align: center; }
.lottery-balance { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
.lottery-balance b { font-size: 18px; color: var(--primary); }
.lottery-meta {
    display: flex; flex-direction: column; gap: 4px; margin-top: 14px;
    font-size: 12px; color: var(--muted);
}
.lottery-meta span { display: inline-flex; align-items: center; gap: 5px; justify-content: center; }
.lottery-meta .icon { width: 14px; height: 14px; }

/* 奖池紧凑预览（不显示概率，交互优先） */
.prize-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.prize-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
    border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 12px;
}
.prize-chip b { font-size: 14px; color: var(--primary); font-weight: 700; }
.prize-chip > span { color: var(--text-2); }
.prize-chip.big { border-color: var(--warning-bd); background: #FFFDF7; }
.prize-chip.big b { color: var(--warning); }
.prize-chip.off { opacity: .45; }

/* 账号设置 */
.profile-head {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.profile-avatar-lg {
    width: 66px; height: 66px; border-radius: 50%; flex: none; overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, #6AA1FF 100%); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 27px; font-weight: 700;
    box-shadow: 0 6px 18px rgba(22, 93, 255, .25);
}
/* 头像 / Logo 图片填充 */
.profile-avatar-lg.has-img { background: #fff; }
.profile-avatar-lg.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.welcome-avatar { overflow: hidden; }
.welcome-avatar.has-img { background: rgba(255, 255, 255, .28); }
.welcome-avatar.has-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* 头像上传 */
.avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-form { display: flex; }
.avatar-form input[type="file"] {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.avatar-form label { margin: 0; cursor: pointer; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.info-item {
    background: var(--border-2); border-radius: var(--radius); padding: 12px 14px;
}
.ii-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.ii-label .icon { width: 14px; height: 14px; }
.info-item b { font-size: 13.5px; word-break: break-all; }

/* 标签计数 */
.tab-count {
    display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 10px;
    background: var(--border-2); color: var(--muted); font-size: 11px;
}
.tab-item.active .tab-count { background: var(--primary-100); color: var(--primary); }

/* ---------------- 后台 ---------------- */
.admin-body { background: var(--bg); }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-side {
    width: 226px; flex: none; background: #fff; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border-2); }
.admin-brand .brand-mark { width: 34px; height: 34px; }
.admin-brand strong { display: block; font-size: 14px; }
.admin-brand small { color: var(--muted); font-size: 11px; }
.admin-nav { padding: 12px 10px; flex: 1; overflow: auto; }
.admin-nav-item {
    display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px;
    color: var(--text-2); font-size: 14px; margin-bottom: 2px;
}
.admin-nav-item:hover { background: var(--border-2); color: var(--primary); }
.admin-nav-item.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.admin-side-foot { padding: 12px 10px; border-top: 1px solid var(--border-2); }
.admin-side-foot a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--muted); font-size: 13px; border-radius: 8px; }
.admin-side-foot a:hover { background: var(--border-2); color: var(--primary); }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    height: 60px; background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.admin-title { font-size: 17px; margin: 0; flex: 1; }
.admin-user { margin-left: auto; }
.admin-content { padding: 22px 24px 40px; flex: 1; }

/* 后台移动端汉堡菜单按钮 */
.admin-menu {
    display: none; width: 38px; height: 38px; border-radius: 8px; border: 0; cursor: pointer;
    background: transparent; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px;
    margin-right: 12px; flex: none;
}
.admin-menu span { display: block; width: 18px; height: 2px; background: var(--text-2); border-radius: 2px; transition: .2s; }
.admin-menu:hover { background: var(--border-2); }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px;
    display: flex; align-items: center; gap: 14px; transition: .2s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card .sc-icon {
    width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none;
}
.stat-card .sc-icon .icon { width: 22px; height: 22px; }
.sc-blue { background: var(--primary-50); color: var(--primary); }
.sc-green { background: var(--success-bg); color: var(--success); }
.sc-orange { background: var(--warning-bg); color: var(--warning); }
.sc-red { background: var(--danger-bg); color: var(--danger); }
.stat-card .sc-num { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-card .sc-label { font-size: 12px; color: var(--muted); }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-control { min-width: 150px; }

.tabs {
    display: flex; gap: 2px; border-bottom: 1px solid var(--border);
    margin: 0 -20px 18px; padding: 0 20px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; position: relative;
}
.tabs::-webkit-scrollbar { display: none; }
/* 移动端窄屏时两端淡出，暗示可滑动 */
.tabs::before, .tabs::after {
    content: ''; position: sticky; top: 0; width: 16px; height: 100%;
    pointer-events: none; flex: none;
}
.tab-item {
    padding: 10px 14px; font-size: 14px; color: var(--text-2);
    border-bottom: 2px solid transparent; white-space: nowrap;
    flex: none; transition: color .15s;
}
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

@media (max-width: 768px) {
    .tabs { margin: 0 -16px 16px; padding: 0 16px; }
    .tab-item { padding: 8px 11px; font-size: 13.5px; }
    .tab-count { padding: 0 5px; font-size: 10.5px; }
}

/* ---------------- 分页 ---------------- */
.pager { display: flex; gap: 6px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.pager-item {
    min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border);
    display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--text-2); font-size: 13px;
}
.pager-item:hover { border-color: var(--primary); color: var(--primary); }
.pager-item.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-item.disabled { opacity: .5; cursor: not-allowed; }
.pager-info { font-size: 12px; color: var(--muted); margin-left: 6px; }

/* ---------------- 页脚 ---------------- */
.site-footer { background: #fff; border-top: 1px solid var(--border); padding: 40px 0 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 30px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.footer-brand .icon { color: var(--primary); }
.footer-desc { color: var(--muted); font-size: 13px; margin: 0; }
.footer-col h4 { font-size: 14px; margin-bottom: 12px; }
.footer-col a { display: block; color: var(--muted); font-size: 13px; padding: 4px 0; }
.footer-col a:hover { color: var(--primary); }
.footer-tip { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.7; }
.footer-bottom {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border-2);
    color: var(--muted); font-size: 12px;
}

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-lg); border-radius: 10px; padding: 12px 18px; font-size: 14px;
    display: flex; align-items: center; gap: 8px; animation: toastIn .25s ease; min-width: 220px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }
@keyframes toastIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------------- 文本 ---------------- */
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .steps-list { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .grid-dash { grid-template-columns: 1fr; }
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .admin-side { position: fixed; left: -240px; z-index: 100; transition: .25s; box-shadow: var(--shadow-lg); visibility: hidden; pointer-events: none; }
    .admin-side.show { left: 0; visibility: visible; pointer-events: auto; }
    .admin-content { padding: 16px; }
    .admin-topbar { padding: 0 14px; z-index: 105; }
    .admin-menu { display: inline-flex; }
    .admin-title { font-size: 15px; }
    .admin-user .badge { padding: 2px 8px; }
    /* 点亮遮罩，半透明黑 */
    body.admin-shade::after {
        content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 90;
    }
}
@media (max-width: 640px) {
    .hero { padding: 36px 22px; }
    .hero h1 { font-size: 27px; }
    .dash-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .dash-stat { padding: 14px; }
    .ds-num { font-size: 22px; }
    .quick-grid { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: 1fr; }
    .welcome-bar { padding: 18px; gap: 12px; }
    .welcome-actions { width: 100%; }
    .welcome-actions .btn { flex: 1; justify-content: center; }
    .topnav {
        display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column;
        background: #fff; border-bottom: 1px solid var(--border); padding: 8px 16px 14px; box-shadow: var(--shadow);
    }
    .topnav.show { display: flex; }
    .nav-toggle { display: flex; }
    .grid-2, .grid-3, .grid-4, .form-row, .stat-row { grid-template-columns: 1fr; }
    .steps-list { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: 1fr; }
    .brand-text { display: inline; }
    .topbar-right .btn { padding: 6px 10px; }
    .topbar-right .btn-sm { font-size: 13px; }
}

/* 极窄屏（≤ 480px，如 iPhone SE / 320-375px 安卓机）：
   隐藏昵称按钮，让顶栏只剩 Logo+站名+额度 chip+退出+汉堡，避免被挤压换行 */
@media (max-width: 480px) {
    .topbar-inner { gap: 10px; height: 58px; padding: 0 12px; }
    .brand-text { font-size: 15px; }
    .quota-chip { padding: 4px 9px; font-size: 12px; }
    .quota-chip .icon { width: 14px; height: 14px; }
    .topbar-right > a.btn-ghost { display: none; }
    .topbar-right .btn-outline { padding: 5px 9px; font-size: 12px; }
}

/* ==========================================================================
   提示系统 v2：Toast 轻提示 / 成功庆祝弹窗 / 页面内 Alert
   风格：柔和圆角、克制配色、无机械感文案容器
   ========================================================================== */

/* ---------------- 页面内 Alert（服务端 flash 渲染） ---------------- */
.alert {
    position: relative; overflow: hidden;
    animation: alertIn .34s cubic-bezier(.2, .8, .25, 1);
    border-radius: 14px; padding: 13px 16px;
    box-shadow: 0 2px 10px rgba(29, 33, 41, .04);
}
@keyframes alertIn {
    from { opacity: 0; transform: translateY(-8px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
.alert.out { opacity: 0; transform: translateY(-6px) scale(.99); transition: .32s ease; }

/* ---------------- Toast 轻提示 ---------------- */
.yx-toast-wrap {
    position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
    z-index: 900; display: flex; flex-direction: column; gap: 10px;
    align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.yx-toast {
    position: relative; overflow: hidden; pointer-events: auto;
    display: flex; align-items: flex-start; gap: 12px;
    min-width: 260px; max-width: 400px; padding: 13px 16px;
    background: #fff; border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(29, 33, 41, .14), 0 2px 8px rgba(29, 33, 41, .06);
    animation: yxToastIn .42s cubic-bezier(.16, 1.02, .3, 1);
}
.yx-toast::before {
    content: ''; position: absolute; left: 0; top: 14px; bottom: 14px;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--toast-accent, var(--primary));
}
.yx-toast.out { animation: yxToastOut .28s ease forwards; }
@keyframes yxToastIn {
    0%   { opacity: 0; transform: translateY(-20px) scale(.92); }
    60%  { opacity: 1; transform: translateY(3px) scale(1.015); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes yxToastOut {
    to { opacity: 0; transform: translateY(-12px) scale(.96); }
}
.yx-toast__ico {
    flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55);
}
.yx-toast__ico .icon { width: 19px; height: 19px; margin: 0; }
.yx-toast__body { flex: 1; min-width: 0; padding-top: 1px; }
.yx-toast__title { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); line-height: 1.45; letter-spacing: .1px; }
.yx-toast__desc {
    display: block; font-size: 12.5px; color: var(--text-2); line-height: 1.65; margin-top: 2px;
    word-break: break-word;
}
.yx-toast__desc:empty { display: none; }
.yx-toast__close {
    flex: 0 0 auto; border: 0; background: transparent; cursor: pointer;
    color: var(--muted); padding: 2px; margin: -2px -4px 0 2px; border-radius: 6px;
    display: inline-flex; opacity: .45; transition: .15s;
}
.yx-toast__close:hover { opacity: 1; background: var(--border-2); }
.yx-toast__close .icon { width: 13px; height: 13px; margin: 0; }
.yx-toast__bar {
    position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
    transform-origin: left center; opacity: .9;
    animation: yxToastBar linear forwards;
}
@keyframes yxToastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Toast 色调（左侧条 + 图标底色 + 进度条） */
.yx-toast--success { --toast-accent: var(--success); }
.yx-toast--success .yx-toast__ico { background: linear-gradient(135deg, #E8F8EE 0%, #C9F0D7 100%); color: #0E9B28; }
.yx-toast--success .yx-toast__bar { background: linear-gradient(90deg, #00B42A, #38D26C); }
.yx-toast--error   { --toast-accent: var(--danger); }
.yx-toast--error   .yx-toast__ico { background: linear-gradient(135deg, #FEEEEB 0%, #FBD5D1 100%); color: var(--danger); }
.yx-toast--error   .yx-toast__bar { background: linear-gradient(90deg, #F53F3F, #FF7773); }
.yx-toast--warn    { --toast-accent: var(--warning); }
.yx-toast--warn    .yx-toast__ico { background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B0 100%); color: #D9730D; }
.yx-toast--warn    .yx-toast__bar { background: linear-gradient(90deg, #FF7D00, #FFB748); }
.yx-toast--info    { --toast-accent: var(--primary); }
.yx-toast--info    .yx-toast__ico { background: linear-gradient(135deg, #E8F0FF 0%, #C6D9FF 100%); color: var(--primary); }
.yx-toast--info    .yx-toast__bar { background: linear-gradient(90deg, #165DFF, #5B8DEF); }
.yx-toast--gold    { --toast-accent: #F5A623; }
.yx-toast--gold    .yx-toast__ico { background: linear-gradient(135deg, #FFF6D6 0%, #FFE49A 100%); color: #C98A00; }
.yx-toast--gold    .yx-toast__bar { background: linear-gradient(90deg, #F5A623, #FFD666); }

/* ---------------- 成功庆祝弹窗 ---------------- */
.yx-pop {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(24, 28, 34, .42);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    animation: yxFade .26s ease;
}
.yx-pop.out { animation: yxFadeOut .22s ease forwards; }
@keyframes yxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes yxFadeOut { to { opacity: 0; } }

.yx-pop__card {
    position: relative; width: 100%; max-width: 348px; text-align: center;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFC 100%);
    border-radius: 24px; padding: 38px 28px 26px;
    box-shadow: 0 26px 80px rgba(29, 33, 41, .28), 0 6px 18px rgba(29, 33, 41, .08);
    animation: yxPopIn .5s cubic-bezier(.18, 1.05, .3, 1);
    overflow: hidden;
}
.yx-pop__card::before {
    /* 顶部光晕 */
    content: ''; position: absolute; left: 50%; top: -90px; width: 280px; height: 200px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, var(--pop-glow, rgba(22, 93, 255, .15)), transparent 70%);
    pointer-events: none;
}
.yx-pop.out .yx-pop__card { animation: yxPopOut .22s ease forwards; }
@keyframes yxPopIn {
    0%   { opacity: 0; transform: translateY(20px) scale(.86); }
    60%  { opacity: 1; transform: translateY(-4px) scale(1.02); }
    100% { opacity: 1; transform: none; }
}
@keyframes yxPopOut { to { opacity: 0; transform: scale(.94) translateY(8px); } }

/* 色调变量（JS 会按 tone 写入） */
.yx-pop__card { --pop-glow: rgba(0, 180, 42, .18); --pop-accent: #00B42A; --pop-accent-soft: rgba(0, 180, 42, .12); }
.yx-pop__card[data-tone="success"] { --pop-glow: rgba(0, 180, 42, .20); --pop-accent: #00B42A; --pop-accent-soft: rgba(0, 180, 42, .14); }
.yx-pop__card[data-tone="gold"]    { --pop-glow: rgba(245, 166, 35, .28); --pop-accent: #F5A623; --pop-accent-soft: rgba(245, 166, 35, .18); }
.yx-pop__card[data-tone="primary"] { --pop-glow: rgba(22, 93, 255, .20); --pop-accent: #165DFF; --pop-accent-soft: rgba(22, 93, 255, .14); }
.yx-pop__card[data-tone="warn"]    { --pop-glow: rgba(255, 125, 0, .22);  --pop-accent: #FF7D00; --pop-accent-soft: rgba(255, 125, 0, .16); }
.yx-pop__card[data-tone="danger"]  { --pop-glow: rgba(245, 63, 63, .20);  --pop-accent: #F53F3F; --pop-accent-soft: rgba(245, 63, 63, .16); }

/* 图标 + 光环 */
.yx-pop__icon {
    position: relative; width: 88px; height: 88px; margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: center;
}
.yx-pop__ring {
    position: absolute; inset: 0; border-radius: 50%; background: var(--pop-accent);
    opacity: 0; animation: yxRing 2.6s cubic-bezier(.2, .6, .3, 1) infinite;
}
.yx-pop__ring:nth-child(2) { animation-delay: .85s; }
.yx-pop__ring:nth-child(3) { animation-delay: 1.7s; }
@keyframes yxRing {
    0%   { transform: scale(.55); opacity: .35; }
    70%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}
.yx-pop__badge {
    position: relative; width: 72px; height: 72px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--pop-accent), var(--pop-accent));
    color: #fff;
    box-shadow: 0 10px 28px var(--pop-accent-soft), inset 0 0 0 4px rgba(255, 255, 255, .25);
    animation: yxBadgeIn .55s .12s cubic-bezier(.2, 1.2, .3, 1) both;
}
.yx-pop__badge .icon { width: 38px; height: 38px; stroke-width: 2.2; }
.yx-pop__badge .icon path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: yxDraw .65s .25s ease forwards; }
@keyframes yxBadgeIn {
    0%   { transform: scale(.5) rotate(-12deg); opacity: 0; }
    100% { transform: scale(1) rotate(0);     opacity: 1; }
}
@keyframes yxDraw { to { stroke-dashoffset: 0; } }

.yx-pop__title {
    font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 6px;
    letter-spacing: .3px;
}
.yx-pop__title::before { content: ''; display: block; width: 28px; height: 3px; border-radius: 2px;
    margin: 0 auto 10px; background: linear-gradient(90deg, var(--pop-accent), var(--pop-accent));
    opacity: .8;
}
.yx-pop__desc { font-size: 13.5px; color: var(--text-2); line-height: 1.75; margin: 0; }
.yx-pop__amount {
    display: inline-flex; align-items: baseline; gap: 4px; margin: 18px 0 6px;
    font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -.5px;
    background: linear-gradient(135deg, var(--pop-accent), var(--pop-accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: yxNum .55s .22s cubic-bezier(.2, 1.2, .3, 1) both;
    filter: drop-shadow(0 4px 12px var(--pop-accent-soft));
}
.yx-pop__amount small {
    font-size: 15px; font-weight: 700;
    -webkit-text-fill-color: var(--pop-accent);
    letter-spacing: .5px;
}
@keyframes yxNum { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }

.yx-pop__foot { margin-top: 26px; display: flex; gap: 10px; }
.yx-pop__foot .btn { flex: 1; justify-content: center; padding: 11px 18px; border-radius: 12px; font-weight: 600; }
.yx-pop__foot .btn-primary {
    background: linear-gradient(135deg, var(--pop-accent), var(--pop-accent));
    border-color: transparent; color: #fff;
    box-shadow: 0 6px 18px var(--pop-accent-soft);
}
.yx-pop__foot .btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.yx-pop__foot .btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.yx-pop__foot .btn-ghost:hover { background: var(--border-2); color: var(--text); }

/* 撒花 */
.yx-confetti { position: absolute; left: 50%; top: 60px; width: 0; height: 0; pointer-events: none; }
.yx-confetti i {
    position: absolute; width: 8px; height: 8px; border-radius: 2px; opacity: 0;
    animation: yxFly 1.1s cubic-bezier(.15, .7, .3, 1) forwards;
}
.yx-confetti i.sq { border-radius: 2px; }
.yx-confetti i.rd { border-radius: 50%; }
.yx-confetti i.rb {
    width: 12px; height: 3px; border-radius: 2px;
    transform-origin: center;
}
@keyframes yxFly {
    0%   { opacity: 1; transform: translate(0, 0) scale(.3) rotate(0); }
    70%  { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1) rotate(var(--rot)); }
}

/* ---------------- 卡密兑换 ---------------- */
.redeem-hero {
    text-align: center; padding: 30px 24px 26px;
    background: linear-gradient(160deg, #F2F7FF 0%, #FFFFFF 60%);
    border: 1px solid var(--primary-100); border-radius: var(--radius-lg);
    margin-bottom: 20px;
}
.redeem-hero .rh-icon {
    width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #5B8DEF 100%);
    color: #fff; box-shadow: 0 8px 22px rgba(22, 93, 255, .26);
}
.redeem-hero .rh-icon .icon { width: 28px; height: 28px; }
.redeem-hero h2 { font-size: 19px; margin-bottom: 6px; }
.redeem-hero p { color: var(--text-2); font-size: 13.5px; margin: 0; }

.code-input {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: 2.5px; text-transform: uppercase; text-align: center;
    font-size: 17px; padding: 13px 14px;
}
.code-input::placeholder { letter-spacing: normal; text-transform: none; font-size: 14px; }

.code-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.code-tip { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); }
.code-tip .icon { width: 16px; height: 16px; color: var(--primary); flex: 0 0 16px; margin-top: 2px; }

/* 后台卡密管理 */
.card-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.cs-box {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px; position: relative; overflow: hidden;
}
.cs-box::after {
    content: ''; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px;
    border-radius: 50%; background: var(--border-2);
}
.cs-box .cs-num { font-size: 24px; font-weight: 700; line-height: 1.2; position: relative; }
.cs-box .cs-label { font-size: 12.5px; color: var(--muted); position: relative; }
.cs-box.is-total .cs-num { color: var(--primary); }
.cs-box.is-used .cs-num { color: var(--success); }
.cs-box.is-left .cs-num { color: #FF7D00; }
.cs-box.is-off .cs-num { color: var(--muted); }

.code-cell {
    font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
    letter-spacing: .6px; word-break: break-all;
}
.batch-pill {
    display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px;
    background: var(--border-2); color: var(--text-2); max-width: 160px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.gen-result {
    background: #FFFDF5; border: 1px solid #FFE7A3; border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 18px;
}
.gen-result__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.gen-result__head b { font-size: 13.5px; }
.code-list {
    max-height: 220px; overflow: auto; background: #fff; border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 12px;
    font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 2;
    word-break: break-all; color: var(--text-2);
}
.code-list span { display: inline-block; margin-right: 14px; white-space: nowrap; }

/* 批次视图：数量小药丸 + 行内操作 + 批次标题 */
.cnt-pill {
    display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; margin: 2px 4px 2px 0;
    background: var(--border-2); color: var(--text-2);
}
.cnt-green  { background: var(--success-bg); color: var(--success); }
.cnt-orange { background: rgba(255,149,0,.12); color: #d98200; }
.cnt-red    { background: var(--danger-bg); color: var(--danger); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.batch-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px 4px; flex-wrap: wrap; }
.batch-head__title { font-size: 13.5px; color: var(--text-2); }
.batch-head__title b { color: var(--text); }

@media (max-width: 860px) {
    .card-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .code-tips { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .yx-toast-wrap { top: 60px; left: 12px; right: 12px; transform: none; max-width: none; align-items: stretch; }
    .yx-toast { max-width: none; min-width: 0; padding: 12px 14px; border-radius: 14px; }
    .yx-toast__ico { flex: 0 0 30px; width: 30px; height: 30px; }
    .yx-toast__ico .icon { width: 17px; height: 17px; }
    .yx-toast__title { font-size: 13.5px; }
    .yx-pop__card { padding: 30px 22px 22px; border-radius: 22px; }
    .yx-pop__icon { width: 76px; height: 76px; margin-bottom: 16px; }
    .yx-pop__badge { width: 62px; height: 62px; }
    .yx-pop__badge .icon { width: 32px; height: 32px; }
    .yx-pop__amount { font-size: 38px; }
    .yx-pop__title { font-size: 18px; }
    .redeem-hero { padding: 24px 16px 20px; }
}
