/* ============================================================
 * 后台管理系统（纯 PHP 版）样式表
 * 视觉风格对齐原 Vue + Element Plus（浅色主题）
 * 侧边栏主色 #304156，主色 #409eff
 * ============================================================ */

/* ---------- 基础变量 ---------- */
:root {
    --c-primary: #409eff;
    --c-primary-dark: #337ecc;
    --c-success: #67c23a;
    --c-warning: #e6a23c;
    --c-danger: #f56c6c;
    --c-info: #909399;
    --c-text: #303133;
    --c-text-2: #606266;
    --c-text-3: #909399;
    --c-border: #dcdfe6;
    --c-border-light: #ebeef5;
    --c-bg: #f5f7fa;
    --c-white: #ffffff;
    --sidebar-bg: #304156;
    --sidebar-active: #263445;
    --radius: 6px;
    --shadow-card: 0 1px 4px rgba(0, 0, 0, .08);
    --shadow-pop: 0 2px 12px rgba(0, 0, 0, .15);
}

/* ---------- 暗色主题 ---------- */
[data-theme="dark"] {
    --c-text: #e6e8eb;
    --c-text-2: #b9bec7;
    --c-text-3: #828a96;
    --c-border: #3a404d;
    --c-border-light: #2b313c;
    --c-bg: #15181e;
    --c-white: #21252e;
    --sidebar-bg: #181b22;
    --sidebar-active: #262b36;
    --shadow-card: 0 1px 4px rgba(0, 0, 0, .45);
    --shadow-pop: 0 2px 12px rgba(0, 0, 0, .55);
}
[data-theme="dark"] .data-table thead th,
[data-theme="dark"] .data-table thead .col-fixed { background: #20242d; }
[data-theme="dark"] .data-table tbody tr:hover { background: #262b36; }
[data-theme="dark"] .date-selector { background: #2b313c; }
[data-theme="dark"] .dropdown-menu a:hover { background: #262b36; }
[data-theme="dark"] .flash-success { background: #1c2a17; color: #95d475; border-color: #2f4a23; }
[data-theme="dark"] .flash-error   { background: #2a1c1c; color: #f29a9a; border-color: #4a2a2a; }
[data-theme="dark"] .flash-warning { background: #2a2417; color: #e8c07a; border-color: #4a3f23; }
[data-theme="dark"] .flash-info    { background: #172033; color: #8fc0f0; border-color: #233a5a; }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    color: var(--c-text);
    background: var(--c-bg);
}

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

/* ---------- 整体布局 ---------- */
.app-container { display: flex; min-height: 100vh; }

/* 侧边栏（sticky 吸顶：内容区滚动时菜单固定不动） */
.sidebar {
    width: 220px;
    flex: 0 0 220px;
    background: var(--sidebar-bg);
    color: #cdd4de;
    display: flex;
    flex-direction: column;
    transition: width .2s;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 30;
    scrollbar-width: thin;
}
/* 桌面端：折叠为 64px 图标态，hover 展开 */
.sidebar.collapsed { width: 64px; flex-basis: 64px; overflow: visible; }
.sidebar.collapsed .logo { justify-content: center; padding: 0; }
.sidebar.collapsed .logo-full { display: none; }
.sidebar.collapsed .logo-mini { display: block; }
.sidebar.collapsed .menu-text { display: none; }
.sidebar.collapsed .menu { padding: 10px; }
.sidebar.collapsed .menu-item { justify-content: center; padding: 0; margin: 6px 10px; }
.sidebar.collapsed .menu-text { display: none; }
.sidebar.collapsed:hover {
    width: 220px; flex-basis: 220px;
    box-shadow: var(--shadow-pop); z-index: 80;
}
.sidebar.collapsed:hover .logo { justify-content: flex-start; padding: 0 20px; }
.sidebar.collapsed:hover .logo-full { display: block; }
.sidebar.collapsed:hover .logo-mini { display: none; }
.sidebar.collapsed:hover .menu-text { display: inline; }
.sidebar.collapsed:hover .menu-item { justify-content: flex-start; padding: 0 14px; margin: 6px 0; }

.logo {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .5px;
    background: var(--sidebar-active);
}
.logo-mini { display: none; }

.menu { padding: 10px; }
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 46px;
    padding: 0 14px;
    margin: 6px 0;
    border-radius: 10px;
    color: #cdd4de;
    font-size: 14px;
    transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}
.menu-item:hover {
    background: var(--sidebar-active);
    color: #fff;
    transform: translateX(2px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.menu-item.active {
    background: linear-gradient(135deg, #409eff, #337ecc);
    color: #fff;
    box-shadow: 0 4px 14px rgba(64, 158, 255, .28);
}
.menu-icon-wrap {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .08);
    flex: 0 0 32px;
    transition: background .2s;
}
.menu-icon { font-size: 16px; line-height: 1; }
.menu-item.active .menu-icon-wrap { background: rgba(255, 255, 255, .18); }
.menu-item:hover .menu-icon-wrap { background: rgba(255, 255, 255, .12); }

/* 主区域 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: 56px;
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 0;
    z-index: 45;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.toggle-btn {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: var(--c-text-2);
}
.page-title { font-size: 16px; font-weight: 600; color: var(--c-text); }

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

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

/* ---------- 顶栏图标按钮（主题切换等） ---------- */
.icon-btn {
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: transparent;
    color: var(--c-text-3); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s, background .15s, transform .15s;
}
.icon-btn:hover { color: var(--c-primary); background: var(--c-bg); transform: scale(1.05); }
.icon-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-btn { color: var(--c-text-2); }
[data-theme="dark"] .icon-btn:hover { background: #262b36; color: var(--c-primary); }

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

/* ---------- Flash 消息 ---------- */
.flash-wrap { margin-bottom: 16px; }
.flash {
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 13px;
    border: 1px solid transparent;
}
.flash-success { background: #f0f9eb; color: #529b2e; border-color: #e1f3d8; }
.flash-error   { background: #fef0f0; color: #cf4444; border-color: #fde2e2; }
.flash-warning { background: #fdf6ec; color: #b88230; border-color: #faecd8; }
.flash-info    { background: #edf5ff; color: #337ecc; border-color: #d9ecff; }

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


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

.input {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-white);
    color: var(--c-text);
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
.input:focus { border-color: var(--c-primary); }
textarea.input { height: auto; padding: 8px 12px; line-height: 1.5; resize: vertical; }
.input-lg { height: 42px; font-size: 15px; }
.input::placeholder { color: var(--c-text-3); }

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

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

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

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 34px;
    padding: 0 16px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-white);
    color: var(--c-text-2);
    font-size: 14px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.btn:hover { color: var(--c-primary); border-color: #c6e2ff; background: #ecf5ff; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #fff; }
.btn-success { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.btn-success:hover { opacity: .9; color: #fff; }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-danger:hover { opacity: .9; color: #fff; }
.btn-warning { background: #e6a23c; border-color: #e6a23c; color: #fff; }
.btn-warning:hover { opacity: .9; color: #fff; }
.form-hint { font-size: 12px; color: var(--c-text-3); line-height: 1.45; }
.form-row-col { align-items: flex-start; }
.form-input-wrap { display: flex; flex-direction: column; gap: 5px; }
.btn-lg { height: 42px; padding: 0 24px; font-size: 15px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.disabled, .btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-link {
    border: none; background: transparent; color: var(--c-primary);
    cursor: pointer; font-size: 13px; padding: 0 4px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link-danger { color: var(--c-danger); }

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

/* ---------- 标签 ---------- */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 18px;
    border: 1px solid transparent;
}
.tag-primary { background: #ecf5ff; color: #337ecc; border-color: #d9ecff; }
.tag-success { background: #f0f9eb; color: #529b2e; border-color: #e1f3d8; }
.tag-warning { background: #fdf6ec; color: #b88230; border-color: #faecd8; }
.tag-danger  { background: #fef0f0; color: #cf4444; border-color: #fde2e2; }
.tag-info    { background: #f4f4f5; color: #909399; border-color: #e9e9eb; }

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

/* 卡片化表格（与首页统计卡片风格一致） */
.table-card {
    background: var(--c-white);
    border-radius: 10px;
    padding: 0;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--c-border-light);
    overflow: hidden;
}
.data-table-card { background: transparent; }
.data-table-card thead th {
    background: linear-gradient(135deg, #5b8def, #3a6fd8);
    color: #fff;
    border-top: none;
    border-bottom: none;
    padding: 14px 12px;
    font-weight: 600;
}
.data-table-card thead th:first-child { border-top-left-radius: 10px; }
.data-table-card thead th:last-child { border-top-right-radius: 10px; }
.data-table-card tbody td { padding: 13px 12px; border-bottom: 1px solid var(--c-border-light); }
.data-table-card tbody tr:last-child td { border-bottom: none; }
.data-table-card tbody tr:hover { background: #f5f7fa; }
.data-table-card .empty-row { padding: 44px 0 !important; color: var(--c-text-3); }
.data-table-card .tag { font-weight: 500; }
[data-theme="dark"] .table-card { background: var(--c-white); border-color: var(--c-border); }
[data-theme="dark"] .data-table-card thead th { background: linear-gradient(135deg, #2f6fd8, #1e5bbd); }
[data-theme="dark"] .data-table-card tbody tr:hover { background: #262b36; }
[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td { border-color: var(--c-border-light); }

/* ---------- 搜索条 / 工具条 ---------- */
.search-bar, .toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin-bottom: 16px;
}
.search-input { width: 240px; }
.filter-select { width: 160px; }

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

/* ============================================================
 * 首页仪表盘
 * ============================================================ */
.home .section { margin-bottom: 28px; }
.section-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; color: var(--c-text); }

/* 首页快捷操作卡片 —— 与用户统计卡片风格一致 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.quick-action {
    display: flex; align-items: center;
    gap: 14px; padding: 18px 18px; border-radius: 10px;
    background: var(--c-white); box-shadow: var(--shadow-card);
    color: var(--c-text); transition: transform .15s, box-shadow .15s;
    border: 1px solid var(--c-border-light);
}
.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(64, 158, 255, .18);
    border-color: #c6e2ff;
}
.qa-ic-wrap {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 44px; font-size: 22px;
}
.qa-ic-wrap.users  { background: #ecf5ff; }
.qa-ic-wrap.codes  { background: #f0f9eb; }
.qa-ic-wrap.config { background: #fdf6ec; }
.qa-ic-wrap.pwd    { background: #f4f4f5; }
.qa-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qa-text { font-size: 15px; font-weight: 600; color: var(--c-text); }
.qa-desc { font-size: 12px; color: var(--c-text-3); }
[data-theme="dark"] .quick-action { border-color: var(--c-border); }
[data-theme="dark"] .qa-ic-wrap.users  { background: #1b2638; }
[data-theme="dark"] .qa-ic-wrap.codes  { background: #1c2a17; }
[data-theme="dark"] .qa-ic-wrap.config { background: #2a2417; }
[data-theme="dark"] .qa-ic-wrap.pwd    { background: #262b36; }

.stats-header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.date-selector { display: inline-flex; background: #eef0f3; border-radius: 20px; padding: 3px; }
.radio-pill {
    padding: 6px 18px; border-radius: 18px; color: var(--c-text-2);
    font-size: 13px; cursor: pointer; transition: all .15s;
}
.radio-pill.active { background: var(--c-primary); color: #fff; }
.date-picker { display: flex; align-items: center; gap: 8px; }
.date-input { width: 150px; }
.date-separator { color: var(--c-text-3); }

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.stat-card {
    border-radius: 10px;
    padding: 22px 20px;
    color: #fff;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.stat-value { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat-label-wrap { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14px; opacity: .95; }
.stat-ic { font-size: 16px; }
.stat-hint { margin-top: 8px; font-size: 12px; opacity: .85; }

/* 渐变配色（对应 Home.vue） */
.grad-total-users   { background: linear-gradient(135deg, #5b8def, #3a6fd8); }
.grad-normal-users  { background: linear-gradient(135deg, #67c23a, #4e9e2b); }
.grad-permanent-vip { background: linear-gradient(135deg, #f6c343, #e0a82e); }
.grad-normal-vip    { background: linear-gradient(135deg, #9b6bff, #7a4de0); }
.grad-total-parse   { background: linear-gradient(135deg, #36c5d8, #1fa6bb); }
.grad-total-ad      { background: linear-gradient(135deg, #ff7a90, #f0566f); }
.grad-total-invite  { background: linear-gradient(135deg, #4dd0a7, #2bb389); }
.grad-active-users  { background: linear-gradient(135deg, #5b8def, #3a6fd8); }
.grad-new-users     { background: linear-gradient(135deg, #67c23a, #4e9e2b); }
.grad-parse-count   { background: linear-gradient(135deg, #36c5d8, #1fa6bb); }
.grad-ad-view-count { background: linear-gradient(135deg, #ff7a90, #f0566f); }
.grad-invite-count  { background: linear-gradient(135deg, #4dd0a7, #2bb389); }
.grad-parse-rate    { background: linear-gradient(135deg, #67c23a, #4e9e2b); }
.grad-platform      { background: linear-gradient(135deg, #5b8def, #3a6fd8); }

/* 解析成功率卡片 —— 按百分比区间动态变色 */
.grad-rate-excellent { background: linear-gradient(135deg, #67c23a, #4e9e2b); }
.grad-rate-good      { background: linear-gradient(135deg, #5b8def, #3a6fd8); }
.grad-rate-warning   { background: linear-gradient(135deg, #f6c343, #e0a82e); }
.grad-rate-danger    { background: linear-gradient(135deg, #ff7a90, #f0566f); }
.grad-rate-empty     { background: linear-gradient(135deg, #a0a6b1, #7a8190); }

/* 解析运营概览 —— 平台分布迷你条形 */
.rate-sub {
    display: flex; align-items: center; gap: 14px;
    margin-top: 12px; font-size: 12px; opacity: .92;
}
.rate-sub span {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; background: rgba(255,255,255,.18); border-radius: 20px;
}
.platform-empty { padding: 24px 0; text-align: center; font-size: 13px; opacity: .85; }
.platform-row {
    display: grid; grid-template-columns: 80px 1fr 40px; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.15);
}
.platform-row:last-child { border-bottom: none; }
.platform-name { font-size: 13px; opacity: .95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-count { font-size: 14px; font-weight: 700; text-align: right; }
.mini-bar-track { height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; }
.mini-bar-fill { height: 100%; background: rgba(255,255,255,.9); border-radius: 4px; transition: width .4s ease; }
[data-theme="dark"] .mini-bar-fill { background: rgba(255,255,255,.95); }

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

/* ============================================================
 * 小程序配置 —— 图片上传 / 推荐小程序
 * ============================================================ */
.settings-container { max-width: 1800px; margin: 0 auto; }
.image-uploader { display: flex; align-items: flex-start; gap: 16px; }
.image-preview-wrapper {
    width: 160px; height: 130px; border: 1px dashed var(--c-border);
    border-radius: var(--radius); overflow: hidden; background: var(--c-bg);
    display: flex; align-items: center; justify-content: center;
}
.image-preview { max-width: 100%; max-height: 100%; }
.uploader-btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* 个人资料 —— 头像上传 */
.avatar-uploader { display: flex; align-items: flex-start; gap: 16px; }
.profile-page .avatar-preview-wrapper,
.avatar-preview-wrapper {
    width: 96px; height: 96px; max-width: 96px; max-height: 96px;
    border: 1px dashed var(--c-border);
    border-radius: 50%; overflow: hidden; background: var(--c-bg);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.profile-page .avatar-preview-img,
.avatar-preview-img {
    width: 100%; height: 100%; max-width: 100%; max-height: 100%;
    object-fit: cover; display: block;
}

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

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

/* ---------- 积分记录片段 ---------- */
.points-log-table-container { max-height: 360px; overflow-y: auto; }

/* ============================================================
 * 登录页
 * ============================================================ */
.login-container {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
    width: 380px;
    background: var(--c-white);
    border-radius: 12px;
    padding: 36px 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
}
.login-header { text-align: center; margin-bottom: 26px; }
.login-header h2 { margin: 0 0 8px; font-size: 22px; color: var(--c-text); }
.login-header p { margin: 0; color: var(--c-text-3); font-size: 13px; }
.login-form .form-item { margin-bottom: 16px; }
.login-button { width: 100%; margin-top: 6px; }
.login-extra { text-align: right; margin-top: 10px; }
.login-link { color: var(--c-primary); font-size: 13px; text-decoration: none; }
.login-link:hover { text-decoration: underline; }
/* 登录页底部版权（品牌设置可配置） */
.login-footer {
    position: absolute;
    left: 0; right: 0; bottom: 18px;
    text-align: center;
    color: rgba(255, 255, 255, .82);
    font-size: 12px;
    letter-spacing: .3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    pointer-events: none;
}
[data-theme="dark"] .login-footer { color: rgba(255, 255, 255, .7); }

/* ============================================================
 * 看板图表（纯 SVG，适配暗色）
 * ============================================================ */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.chart-card {
    background: var(--c-white);
    border-radius: 10px;
    padding: 22px 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--c-border-light);
}
.chart-title { font-size: 15px; font-weight: 600; margin: 0 0 18px; color: var(--c-text); }
.chart-body { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-wrap { width: 140px; height: 140px; flex: 0 0 140px; }
.donut-arc-success { stroke: var(--c-success); }
.donut-arc-fail { stroke: var(--c-danger); }
.donut-rate { fill: var(--c-text); font-size: 22px; font-weight: 700; }
.donut-sub { fill: var(--c-text-3); font-size: 12px; }
[data-theme="dark"] .chart-card { background: var(--c-white); border-color: var(--c-border); }
.chart-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--c-text-2); }
.lg-item { display: flex; align-items: center; gap: 8px; }
.lg-item b { color: var(--c-text); }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.lg-success { background: var(--c-success); }
.lg-fail { background: var(--c-danger); }
.lg-total { background: var(--c-info); }

.bars-wrap { width: 100%; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 48px; align-items: center; gap: 10px; }
.bar-label {
    font-size: 13px; color: var(--c-text-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar-track { background: var(--c-border-light); border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill {
    height: 100%; border-radius: 6px;
    background: linear-gradient(90deg, #5b8def, #409eff);
    transition: width .4s ease;
}
[data-theme="dark"] .bar-fill { background: linear-gradient(90deg, #2f6fd8, #409eff); }
.bar-val { font-size: 13px; font-weight: 600; color: var(--c-text); text-align: right; }

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

/* ---------- 移动端侧边栏遮罩 ---------- */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 55; opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.sidebar-backdrop.show { opacity: 1; visibility: visible; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed; top: 0; left: 0; z-index: 60; height: 100%;
        width: 220px; flex-basis: 220px;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .sidebar.collapsed,
    .sidebar.collapsed:hover { width: 220px; flex-basis: 220px; overflow: visible; box-shadow: none; }
    .sidebar.mobile-open { transform: translateX(0); }
    .form-label { width: 90px; flex-basis: 90px; }
    .stat-value { font-size: 24px; }
}

/* ---------- P0：改密页 - 当前会话卡片 ---------- */
.session-card {
    background: var(--c-bg);
    border: 1px solid var(--c-border-light);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
}
.session-title { font-size: 13px; font-weight: 600; color: var(--c-text-2); margin-bottom: 10px; }
.session-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 5px 0; }
.session-row > span { color: var(--c-text-3); }
.session-row > b { color: var(--c-text); font-weight: 600; max-width: 62%; text-align: right; word-break: break-all; }
[data-theme="dark"] .session-card { background: #1b1f27; }

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

/* ---------- P2-10：改密页 - 密码显示/隐藏 ---------- */
.pwd-field { position: relative; display: flex; align-items: center; }
.pwd-field .input { flex: 1; padding-right: 38px; }
.pwd-toggle {
    position: absolute;
    right: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 4px 6px;
    color: var(--c-text-3);
    border-radius: 4px;
}
.pwd-toggle:hover { background: var(--c-bg); color: var(--c-text); }

/* ============================================================
 * 2026-10-23 视觉升级：线性图标 + 互联网科技风
 * ============================================================ */

/* 线性图标统一尺寸：跟随容器 font-size，stroke 取当前文字色（轻量、清晰、可随主题变色） */
.menu-icon svg, .qa-ic svg, .stat-ic svg, .perm-icon svg,
.user-avatar-default svg, .logo-mark svg, .toggle-btn svg {
    width: 1em; height: 1em; display: block;
    fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.toggle-btn svg { stroke-width: 2; }

.menu-icon { font-size: 20px; line-height: 1; }
.qa-ic { font-size: 22px; line-height: 1; display: inline-flex; }
.perm-icon { font-size: 44px; line-height: 1; }
.user-avatar-default { font-size: 22px; line-height: 1; display: inline-flex; }

/* 品牌标识：渐变方块 + 水印水滴标记 */
.logo-mark {
    width: 30px; height: 30px; margin-right: 10px; flex: 0 0 30px;
    border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #409eff, #2f6fd8);
    color: #fff; box-shadow: 0 4px 10px rgba(64, 158, 255, .45);
}
.logo-mini { display: none; }

/* 侧边栏：深蓝渐变 + 精致质感 */
.sidebar {
    background: linear-gradient(180deg, #16223f 0%, #0e1730 100%);
    box-shadow: 2px 0 16px rgba(0, 0, 0, .18);
}
.sidebar.collapsed { box-shadow: 2px 0 16px rgba(0, 0, 0, .18); }
.logo {
    background: rgba(255, 255, 255, .04);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.menu-item { position: relative; font-weight: 500; }
.menu-icon-wrap {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .06);
}
.menu-item.active {
    background: linear-gradient(135deg, #409eff, #2f6fd8);
    box-shadow: 0 6px 16px rgba(64, 158, 255, .38);
}
.menu-item.active::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 4px; height: 22px; background: #fff; border-radius: 0 4px 4px 0;
}

/* 顶栏底部细高光，增强层次 */
.topbar {
    border-bottom: 1px solid var(--c-border-light);
    box-shadow: 0 1px 0 rgba(64, 158, 255, .06), var(--shadow-card);
}

/* 内容区：极淡的科技蓝高光，不喧宾夺主 */
.content {
    background: radial-gradient(1200px 600px at 82% -12%, rgba(64, 158, 255, .05), transparent 60%);
}

/* 卡片 / 按钮：更大圆角、更柔和阴影，统一精致感 */
.card { border-radius: 14px; border: 1px solid var(--c-border-light); }
.stat-card { border-radius: 14px; }
.btn { border-radius: 8px; }
.btn-primary { box-shadow: 0 4px 12px rgba(64, 158, 255, .28); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(64, 158, 255, .38); }

/* 区块标题：左侧渐变短竖条，强化科技编辑感 */
.section-title { display: flex; align-items: center; gap: 8px; }
.section-title::before {
    content: ""; width: 4px; height: 15px; border-radius: 2px;
    background: linear-gradient(180deg, #409eff, #2f6fd8);
}

/* 登录页：紫色渐变改为科技蓝渐变 */
.login-container {
    background: linear-gradient(135deg, #1f2a4d 0%, #3a6fd8 60%, #409eff 100%);
}

/* 暗色主题微调，让升级在两种主题下都协调 */
[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #141a26 0%, #0b0f18 100%); }
[data-theme="dark"] .logo { background: rgba(255, 255, 255, .03); }
[data-theme="dark"] .card, [data-theme="dark"] .chart-card { border-color: var(--c-border); }

/* ============================================================
 * 2026-10-23 控件精修：聚焦环 + 按钮质感 + 表格卡片化 + 缺失组件
 * 目标：让每个按钮 / 输入框 / 表格都达到专业 SaaS 质感
 * ============================================================ */

/* ---------- 输入框聚焦环（专业感核心） ---------- */
.input, textarea.input, select.input { transition: border-color .15s, box-shadow .15s; }
.input:hover, textarea.input:hover, select.input:hover { border-color: #c0c4cc; }
.input:focus, textarea.input:focus, select.input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(64, 158, 255, .15);
    outline: none;
}
/* 暗色主题下聚焦环更亮 */
[data-theme="dark"] .input:focus,
[data-theme="dark"] textarea.input:focus,
[data-theme="dark"] select.input:focus { box-shadow: 0 0 0 3px rgba(64, 158, 255, .28); }

/* ---------- 按钮悬浮质感 + 聚焦环 ---------- */
.btn:not(.btn-loading):hover { transform: translateY(-1px); }
.btn-primary:hover, .btn-success:hover, .btn-danger:hover, .btn-warning:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(64, 158, 255, .32); }
.btn-primary:focus-visible { box-shadow: 0 0 0 3px rgba(64, 158, 255, .42); }
/* 小按钮在表格操作中更紧凑精致 */
.btn-sm { font-weight: 500; }
/* 关闭/取消等次级按钮在弹窗底部更克制（排除渐变赠礼按钮，防止覆盖成浅底白字） */
.modal-footer .btn:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-warning):not(.btn-gift):not(.btn-crown) {
    background: var(--c-bg);
}

/* ---------- 表格卡片化（每个列表更立体） ---------- */
.table-container {
    border: 1px solid var(--c-border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    background: var(--c-white);
}
/* 避免带渐变表头的表格出现双重边框 */
.data-table-card { border: none; }

/* ---------- 数据表头与行悬浮精修 ---------- */
.data-table thead th {
    border-bottom: 1px solid var(--c-border);
    background: #fafbfc;
}
.data-table tbody tr:hover { background: #f0f6ff; }
.data-table tbody td { border-bottom: 1px solid var(--c-border-light); }
[data-theme="dark"] .data-table tbody tr:hover { background: #262b36; }

/* 基础 .table（更新页环境自检 / 更新历史，原未定义样式） */
.table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    font-size: 13px; color: var(--c-text); background: var(--c-white);
    border: 1px solid var(--c-border-light); border-radius: 12px; overflow: hidden;
}
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--c-border-light); text-align: left; white-space: nowrap; }
.table thead th { background: #fafbfc; color: var(--c-text-2); font-weight: 600; border-bottom: 1px solid var(--c-border); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f5f7fa; }
.table code { font-family: Consolas, Menlo, monospace; font-size: 12px; color: var(--c-text-2); }
[data-theme="dark"] .table { background: var(--c-white); border-color: var(--c-border); }
[data-theme="dark"] .table thead th { background: #20242d; }
[data-theme="dark"] .table tbody tr:hover { background: #262b36; }

/* ---------- Flash 消息：左侧强调条 ---------- */
.flash { border-left-width: 3px; }
.flash-success { border-left-color: var(--c-success); }
.flash-error   { border-left-color: var(--c-danger); }
.flash-warning { border-left-color: var(--c-warning); }
.flash-info    { border-left-color: var(--c-primary); }

/* ---------- 弹窗精修 ---------- */
.modal { background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); }
.modal-box { border-radius: 14px; border: 1px solid rgba(255, 255, 255, .06); }
.modal-header { gap: 10px; }
.modal-close { border-radius: 6px; padding: 2px 7px; transition: background .15s, color .15s; }
.modal-close:hover { background: var(--c-bg); color: var(--c-text); }
.modal-footer { background: #fafbfc; border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; }
[data-theme="dark"] .modal-footer { background: #181b22; }

/* ---------- 缺失组件补齐 ---------- */
/* 表单操作区：保存/测试等按钮统一成带分隔线的操作条 */
.form-actions {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--c-border-light);
}
/* 分段标题分隔线（邮箱配置等） */
.section-divider {
    display: flex; align-items: center; gap: 12px; margin: 26px 0 16px;
    color: var(--c-text-3); font-size: 13px; font-weight: 600;
}
.section-divider::before, .section-divider::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--c-border-light), transparent);
}
.section-divider span { white-space: nowrap; }
/* 极验配置页：使用说明列表 */
.geetest-tips {
    margin: 0; padding-left: 20px; color: var(--c-text-2); font-size: 13px; line-height: 1.9;
}
.geetest-tips li { margin: 2px 0; }
.geetest-tips b { color: var(--c-text-1); font-weight: 600; }
/* 极验验证容器（登录页） */
.geetest-wrap #captcha-box { min-height: 44px; display: flex; align-items: center; }
@media (prefers-color-scheme: dark) {
    .email-tpl { background: #1c1f24; border-color: #2a2f37; }
}
/* 邮件模板预览框（替换内联样式） */
.email-tpl {
    background: #f7f8fa; border: 1px solid #ebedf0; border-radius: 10px;
    padding: 14px 16px; color: #555; font-size: 13px; line-height: 1.8;
}
/* 结果 chips（接口自检等，替换内联 style） */
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
    background: #eef2f7; color: #5b6470; border: 1px solid #e2e8f0; line-height: 1.5;
}
.chip-primary { background: #ecf5ff; color: #337ecc; border-color: #d9ecff; }
.chip-success { background: #f0f9eb; color: #529b2e; border-color: #e1f3d8; }
.chip-warning { background: #fdf6ec; color: #b88230; border-color: #faecd8; }
.chip-danger  { background: #fef0f0; color: #cf4444; border-color: #fde2e2; }
/* 状态药丸（更新页环境/历史，替换内联 style） */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.pill-ok  { background: #f0f9eb; color: #529b2e; border: 1px solid #e1f3d8; }
.pill-bad { background: #fef0f0; color: #cf4444; border: 1px solid #fde2e2; }
/* 代码块（接口自检 / 更新说明，替换硬编码深色 pre） */
.code-block {
    background: #0f172a; color: #cbd5e1; padding: 16px; border-radius: 12px;
    overflow: auto; max-height: 420px; font-size: 12px; line-height: 1.7;
    white-space: pre-wrap; word-break: break-all; border: 1px solid #1e293b;
    font-family: Consolas, Menlo, monospace;
}
/* 在线状态圆点（替换用户列表 🟢 emoji） */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c0c4cc; vertical-align: middle; }
.dot-online { background: #67c23a; box-shadow: 0 0 0 3px rgba(103, 194, 58, .18); }
/* 审计页自定义分页 / 筛选条 / 空状态（原内联样式） */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pager { margin-top: 14px; color: var(--c-text-3); font-size: 13px; }
.empty { text-align: center; color: var(--c-text-3); padding: 30px 0; }

/* ---------- 通用宽度工具类（替代散落的 inline width） ---------- */
.w-xs { width: 80px !important; } .w-sm { width: 160px !important; } .w-md { width: 240px !important; }
.w-lg { width: 360px !important; } .w-xl { width: 480px !important; } .w-2xl { width: 560px !important; }
.w-full { width: 100% !important; }

/* ---------- 登录 / 找回密码：品牌标识 ---------- */
.login-brand {
    width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #409eff, #2f6fd8);
    box-shadow: 0 8px 22px rgba(64, 158, 255, .42); color: #fff;
}
.login-brand svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 暗色主题：新增组件微调 ---------- */
[data-theme="dark"] .email-tpl { background: #1b1f27; border-color: #2b313c; color: #b9bec7; }
[data-theme="dark"] .chip { background: #262b36; color: #b9bec7; border-color: #2b313c; }
[data-theme="dark"] .chip-primary { background: #172033; color: #8fc0f0; border-color: #233a5a; }
[data-theme="dark"] .chip-success { background: #1c2a17; color: #95d475; border-color: #2f4a23; }
[data-theme="dark"] .chip-warning { background: #2a2417; color: #e8c07a; border-color: #4a3f23; }
[data-theme="dark"] .chip-danger  { background: #2a1c1c; color: #f29a9a; border-color: #4a2a2a; }
[data-theme="dark"] .code-block { background: #0b1220; border-color: #162033; }
[data-theme="dark"] .table-container { background: var(--c-white); border-color: var(--c-border); }

/* ---------- 列表单元格：昵称 / 长链接（原无样式，长 URL 会撑破表格） ---------- */
.user-cell {
    display: inline-block; max-width: 150px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.url-cell {
    display: inline-block; max-width: 300px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
    color: var(--c-primary); text-decoration: none;
}
.url-cell:hover { color: #2f6fd8; text-decoration: underline; }

/* ============================================================
 * 2026-10-23 表单控件精修（细化到每个按钮 / 输入框 / 选择框）
 * 目标：消除浏览器原生控件的廉价感，统一为 Element Plus 级观感
 * ============================================================ */

/* ---------- 复选框：自定义外观，替换原生方框 ---------- */
input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    width: 16px; height: 16px; flex: 0 0 16px;
    margin: 0; padding: 0; cursor: pointer; vertical-align: -3px;
    border: 1px solid var(--c-border); border-radius: 3px;
    background: var(--c-white);
    background-position: center; background-repeat: no-repeat; background-size: 11px 11px;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
input[type="checkbox"]:hover { border-color: var(--c-primary); }
input[type="checkbox"]:checked {
    background-color: var(--c-primary); border-color: var(--c-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.2 8.4l3.1 3.1 6.5-6.9'/%3E%3C/svg%3E");
}
input[type="checkbox"]:indeterminate {
    background-color: var(--c-primary); border-color: var(--c-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 8h8'/%3E%3C/svg%3E");
}
input[type="checkbox"]:focus-visible {
    outline: none; border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(64, 158, 255, .25);
}
input[type="checkbox"][disabled] {
    background-color: #f2f3f5; border-color: #e4e7ed; cursor: not-allowed; opacity: .7;
}
input[type="checkbox"][disabled]:checked { background-color: #c8d3e0; border-color: #c8d3e0; }

/* ---------- 单选框：自定义圆环 ---------- */
input[type="radio"] {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    width: 16px; height: 16px; flex: 0 0 16px;
    margin: 0; padding: 0; cursor: pointer; vertical-align: -3px;
    border: 1px solid var(--c-border); border-radius: 50%;
    background: var(--c-white);
    transition: border-color .15s, box-shadow .15s;
}
input[type="radio"]:hover { border-color: var(--c-primary); }
input[type="radio"]:checked {
    border-color: var(--c-primary); border-width: 5px;
}
input[type="radio"]:focus-visible {
    outline: none; box-shadow: 0 0 0 3px rgba(64, 158, 255, .25);
}
input[type="radio"][disabled] { background: #f2f3f5; border-color: #e4e7ed; cursor: not-allowed; }

/* 含控件的 label：垂直居中、可点击 */
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
}
label:has(> input[type="checkbox"]:disabled),
label:has(> input[type="radio"]:disabled) { cursor: not-allowed; opacity: .6; }

/* ---------- 下拉框：自定义箭头，替换原生三角 ---------- */
select.input {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    padding-right: 32px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a8abb2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 14px 14px;
}
select.input:hover { border-color: #c0c4cc; }
select.input:focus {
    border-color: var(--c-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23409eff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
}
select.input option { padding: 6px 8px; }

/* ---------- 文件选择框：按钮化外壳 ---------- */
input[type="file"].input {
    padding: 6px 10px; cursor: pointer; font-size: 13px; color: var(--c-text-2);
    background: var(--c-white);
}
input[type="file"].input::file-selector-button {
    margin-right: 10px; padding: 5px 14px;
    font-size: 13px; color: var(--c-primary);
    background: #ecf5ff; border: 1px solid #b3d8ff; border-radius: 4px;
    cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
input[type="file"].input::file-selector-button:hover {
    background: var(--c-primary); border-color: var(--c-primary); color: #fff;
}

/* ---------- 输入框内前后缀（按钮 / 单位）贴合 ---------- */
.input-group { display: inline-flex; align-items: stretch; width: 100%; }
.input-group .input { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .input + .btn { border-radius: 0 var(--radius) var(--radius) 0; margin-left: -1px; }

/* ---------- 按钮：按压反馈与禁用态 ---------- */
.btn:not([disabled]):active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .6; cursor: not-allowed; }
.btn + .btn { margin-left: 8px; }

/* ---------- 设置类卡片：统一内边距与分组间距 ---------- */
.settings-card { padding: 22px 24px; }
.settings-card + .settings-card { margin-top: 16px; }
.settings-card .form-row + .form-row { margin-top: 16px; }

/* ---------- 统计卡标签 ---------- */
.stat-label { font-weight: 500; }

/* ---------- 登录页：记住我 ---------- */
.login-remember { margin: 2px 0 14px; }
.remember-me {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; color: var(--c-text-2); cursor: pointer; user-select: none;
}
.remember-me:hover { color: var(--c-primary); }

/* ---------- 表格行：推荐/记录行高亮 ---------- */
.rec-row { background: rgba(64, 158, 255, .04); }
.rec-row:hover { background: rgba(64, 158, 255, .09) !important; }

/* ---------- 状态标签：管理员状态 / 锁定 ---------- */
.tag.t-ok { background: #f0f9eb; color: #67c23a; border-color: #e1f3d8; }
.tag.t-no { background: #f4f4f5; color: #909399; border-color: #e9e9eb; }
.tag.t-lock { background: #fef0f0; color: #f56c6c; border-color: #fde2e2; }

/* ---------- 多选列表：卡片化的可勾选项 ---------- */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item {
    display: flex !important; align-items: flex-start; gap: 10px;
    padding: 10px 14px; font-size: 14px; color: var(--c-text);
    background: var(--c-bg); border: 1px solid var(--c-border-light); border-radius: var(--radius);
    cursor: pointer; transition: border-color .15s, background .15s;
}
.check-item:hover { border-color: #b3d8ff; background: #f5f9ff; }
.check-item input[type="checkbox"] { margin-top: 2px; }
.check-item > span { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.check-item em { font-style: normal; font-size: 12px; color: var(--c-text-3); }
.check-item:has(input:checked) { border-color: var(--c-primary); background: #ecf5ff; }

/* ---------- 开关：更精致的滑块与过渡 ---------- */
.switch { flex: 0 0 40px; vertical-align: middle; }
.switch-slider { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); }
.switch-slider::after { box-shadow: 0 1px 3px rgba(0, 0, 0, .28); }
.switch:hover .switch-slider { background: #b6bac1; }
.switch input:checked + .switch-slider { background: var(--c-primary); }

/* ============================================================
 * 2026-10-23 顶栏身份标识（Identity Badge）
 * 头像 + 在线点 + 用户名 + 角色徽章；下拉含身份头部与登录信息
 * ============================================================ */
.user-dropdown { padding: 0; }
.identity {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 10px 5px 6px; border-radius: 999px;
    border: 1px solid transparent; cursor: pointer; outline: none;
    transition: background .18s, border-color .18s, box-shadow .18s;
}
.user-dropdown:hover .identity,
.identity:focus-visible {
    background: var(--c-white); border-color: #d7e6fb;
    box-shadow: 0 2px 10px rgba(64, 158, 255, .16);
}

/* 头像：按角色渐变，右下角在线点 */
.id-avatar, .dm-avatar {
    position: relative; border-radius: 50%; color: #fff;
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.id-avatar { width: 34px; height: 34px; flex-basis: 34px; }
.dm-avatar { width: 40px; height: 40px; flex-basis: 40px; }
.id-avatar-super { background: linear-gradient(135deg, #f7b955, #ef7a2e); box-shadow: 0 2px 8px rgba(239, 122, 46, .38); }
.id-avatar-admin { background: linear-gradient(135deg, #5aa9ff, #2f6fd8); box-shadow: 0 2px 8px rgba(47, 111, 216, .34); }
.id-avatar-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dm-avatar .id-avatar-icon svg { width: 20px; height: 20px; }
.id-avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.id-status {
    position: absolute; right: -1px; bottom: -1px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #67c23a; border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(103, 194, 58, .18);
}

/* 名称与角色徽章 */
.id-meta { display: flex; flex-direction: column; gap: 3px; line-height: 1.15; }
.id-name {
    font-size: 13px; font-weight: 600; color: var(--c-text);
    max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.id-role {
    display: inline-flex; align-items: center; gap: 3px; align-self: flex-start;
    padding: 1px 7px 1px 5px; border-radius: 999px;
    font-size: 10.5px; font-weight: 600; letter-spacing: .2px; white-space: nowrap;
}
.id-role svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.id-role-super { background: linear-gradient(135deg, #fff2dc, #ffe3c2); color: #c9700d; border: 1px solid #f7d9a8; }
.id-role-admin { background: #ecf5ff; color: #2f6fd8; border: 1px solid #b3d8ff; }

/* 展开箭头：hover 翻转 */
.id-caret { display: inline-flex; color: var(--c-text-3); transition: transform .18s, color .18s; }
.id-caret svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.user-dropdown:hover .id-caret { transform: rotate(180deg); color: var(--c-primary); }

/* 下拉菜单：身份头部 */
.id-menu { min-width: 268px; padding: 0; overflow: hidden; }
.dm-head {
    display: flex; align-items: center; gap: 11px; padding: 14px 16px;
    background: linear-gradient(135deg, #f6f9ff, #eef4ff);
    border-bottom: 1px solid var(--c-border-light);
}
.dm-head-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.dm-name { font-size: 14px; font-weight: 600; color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-sub { font-size: 11.5px; color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 下拉菜单：登录信息 */
.dm-info { padding: 11px 16px; display: flex; flex-direction: column; gap: 8px; }
.dm-info-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-text-3); }
.dm-ic { display: inline-flex; color: var(--c-primary); opacity: .85; }
.dm-ic svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dm-ic-label { flex: 0 0 auto; }
.dm-ic-val { margin-left: auto; color: var(--c-text-2); font-weight: 600; font-size: 12px; }
.dm-sep { height: 1px; background: var(--c-border-light); }

/* 下拉菜单：操作项（图标化） */
.dropdown-menu a.dm-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px; font-size: 13px; color: var(--c-text-2);
}
.dm-item-ic { display: inline-flex; color: var(--c-text-3); transition: color .15s; }
.dm-item-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dropdown-menu a.dm-item:hover .dm-item-ic { color: var(--c-primary); }
.dropdown-menu a.dm-item-danger {
    color: var(--c-danger); border-top: 1px solid var(--c-border-light);
}
.dropdown-menu a.dm-item-danger .dm-item-ic { color: var(--c-danger); }
.dropdown-menu a.dm-item-danger:hover {
    background: #fef0f0 !important; color: var(--c-danger) !important;
}
.dropdown-menu a.dm-item-danger:hover .dm-item-ic { color: var(--c-danger) !important; }

/* ---------- 暗色主题：控件适配 ---------- */
[data-theme="dark"] .user-dropdown:hover .identity,
[data-theme="dark"] .identity:focus-visible {
    background: #262b36; border-color: #3a404d; box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
[data-theme="dark"] .id-status { border-color: #21252e; }
[data-theme="dark"] .id-role-admin { background: #172033; color: #8fc0f0; border-color: #233a5a; }
[data-theme="dark"] .id-role-super { background: #2a2016; color: #f0b358; border-color: #4a3a23; }
[data-theme="dark"] .dm-head { background: linear-gradient(135deg, #1b2230, #172033); border-bottom-color: #2b313c; }
[data-theme="dark"] .dropdown-menu a.dm-item-danger:hover { background: #2a1c1c !important; }
[data-theme="dark"] .check-item { background: #1b1f27; border-color: #2b313c; }
[data-theme="dark"] .check-item:hover { background: #172033; border-color: #233a5a; }
[data-theme="dark"] .check-item:has(input:checked) { background: #172033; border-color: var(--c-primary); }
[data-theme="dark"] .check-item em { color: #828a96; }
[data-theme="dark"] input[type="checkbox"] { background: #2b313c; border-color: #4a505c; }
[data-theme="dark"] input[type="checkbox"]:checked,
[data-theme="dark"] input[type="checkbox"]:indeterminate { background-color: var(--c-primary); border-color: var(--c-primary); }
[data-theme="dark"] input[type="checkbox"][disabled] { background: #262b36; border-color: #3a404d; }
[data-theme="dark"] input[type="radio"] { background: #2b313c; border-color: #4a505c; }
[data-theme="dark"] input[type="file"].input::file-selector-button {
    background: #172033; border-color: #233a5a; color: #8fc0f0;
}
[data-theme="dark"] input[type="file"].input::file-selector-button:hover {
    background: var(--c-primary); border-color: var(--c-primary); color: #fff;
}
[data-theme="dark"] .rec-row { background: rgba(64, 158, 255, .07); }
[data-theme="dark"] .tag.t-ok { background: #1c2a17; color: #95d475; border-color: #2f4a23; }
[data-theme="dark"] .tag.t-no { background: #262b36; color: #909399; border-color: #3a404d; }
[data-theme="dark"] .tag.t-lock { background: #2a1c1c; color: #f29a9a; border-color: #4a2a2a; }

/* ============================================================
 * 全员福利发放条（用户管理页）2026-10-23.3
 * ============================================================ */
.welfare-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 14px;
    padding: 12px 16px;
    border: 1px solid #ffe0b8;
    border-radius: 10px;
    background: linear-gradient(120deg, #fff8ef 0%, #ffffff 55%, #f6fbff 100%);
    box-shadow: var(--shadow-card);
}
.wb-ic {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #f7b955 0%, #ef7a2e 100%);
    box-shadow: 0 3px 8px rgba(239, 122, 46, .28);
}
.wb-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wb-text b { font-size: 13.5px; color: var(--c-text); font-weight: 600; }
.wb-text span { font-size: 12px; color: var(--c-text-3); line-height: 1.5; }
.wb-right { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.wb-ic svg { width: 20px; height: 20px; }

/* 赠礼渐变按钮：所有状态显式重申渐变与白字，
   防止被全局 .btn:hover（浅蓝底浅字）覆盖导致悬停"隐形" */
.btn-gift, .btn-crown {
    color: #fff;
    border-color: transparent;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .14);
    transition: filter .16s ease, box-shadow .16s ease, transform .16s ease;
}
.btn-gift {
    background: linear-gradient(135deg, #f7a94f 0%, #ef7a2e 100%);
    box-shadow: 0 2px 6px rgba(239, 122, 46, .3), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-gift:hover, .btn-gift:focus-visible, .btn-gift:active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #fbb960 0%, #f2863c 100%);
}
.btn-gift:hover { filter: brightness(1.04); box-shadow: 0 5px 14px rgba(239, 122, 46, .4), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-gift:active { filter: brightness(.95); box-shadow: 0 2px 5px rgba(239, 122, 46, .3), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-crown {
    background: linear-gradient(135deg, #9d6bfa 0%, #6d28d9 100%);
    box-shadow: 0 2px 6px rgba(109, 40, 217, .3), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-crown:hover, .btn-crown:focus-visible, .btn-crown:active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #a97dfb 0%, #7a35e6 100%);
}
.btn-crown:hover { filter: brightness(1.04); box-shadow: 0 5px 14px rgba(109, 40, 217, .4), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn-crown:active { filter: brightness(.95); box-shadow: 0 2px 5px rgba(109, 40, 217, .3), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-gift:disabled, .btn-crown:disabled { opacity: .55; filter: saturate(.6); cursor: not-allowed; }
.btn-gift svg, .btn-crown svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }

.mh-ic { display: inline-flex; vertical-align: -3px; margin-right: 6px; }
.mh-ic svg { width: 16px; height: 16px; }

.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-pick {
    padding: 3px 11px;
    font-size: 12px;
    color: var(--c-text-2);
    background: var(--c-bg);
    border: 1px solid var(--c-border-light);
    border-radius: 20px;
    cursor: pointer;
    transition: all .16s ease;
}
.chip-pick:hover {
    color: #fff;
    background: var(--c-primary);
    border-color: var(--c-primary);
}

.gift-note {
    margin-top: 4px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: #92610d;
    background: #fff7e8;
    border: 1px solid #ffe2b8;
    border-radius: 6px;
    line-height: 1.6;
}

[data-theme="dark"] .welfare-bar {
    border-color: #4a3a22;
    background: linear-gradient(120deg, #2a2318 0%, #21252e 55%, #1d2434 100%);
}
[data-theme="dark"] .chip-pick { background: #2b313c; border-color: #3a404d; color: var(--c-text-2); }
[data-theme="dark"] .chip-pick:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
[data-theme="dark"] .gift-note { background: #2a2318; border-color: #4a3a22; color: #e0b968; }
/* 回收按钮（描边样式，区别于赠送的渐变按钮） */
.btn-recycle {
    background: var(--c-white);
    border-color: var(--c-border);
    color: var(--c-text-2);
}
.btn-recycle:hover, .btn-recycle:focus-visible, .btn-recycle:active {
    background: var(--c-bg);
    border-color: var(--c-border);
    color: var(--c-text-1);
    filter: none;
    box-shadow: none;
}
[data-theme="dark"] .btn-recycle { background: var(--c-bg); border-color: var(--c-border); color: var(--c-text-2); }
[data-theme="dark"] .btn-recycle:hover { background: #1e222b; }
/* 回收会员强提醒 */
.gift-note-warn { background: #fff4f4; border-color: #f3c2c2; color: #c0392b; }
[data-theme="dark"] .gift-note-warn { background: #3a2326; border-color: #7a3a3a; color: #f0a9a0; }

/* 会员弹窗：当前有效期提示行 */
.vip-current {
    margin: 0 0 12px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--c-text-2);
    background: var(--c-bg);
    border: 1px solid var(--c-border-light);
    border-radius: var(--radius);
    line-height: 1.6;
}
[data-theme="dark"] .vip-current { background: #262b36; border-color: #3a404d; }

/* ---------- 赠礼弹窗精修 ---------- */
/* 弹窗标题图标彩色圆底（送积分=橙 / 送会员=紫），并弱化默认"×" */
#giftPointsModal .modal-header, #giftVipModal .modal-header { display: flex; align-items: center; }
#giftPointsModal .mh-ic, #giftVipModal .mh-ic {
    width: 28px;
    height: 28px;
    margin-right: 9px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    color: #fff;
}
#giftPointsModal .mh-ic { background: linear-gradient(135deg, #f7a94f 0%, #ef7a2e 100%); box-shadow: 0 2px 6px rgba(239, 122, 46, .3); }
#giftVipModal .mh-ic { background: linear-gradient(135deg, #9d6bfa 0%, #6d28d9 100%); box-shadow: 0 2px 6px rgba(109, 40, 217, .3); }
#giftPointsModal .mh-ic svg, #giftVipModal .mh-ic svg { width: 16px; height: 16px; margin: 0; vertical-align: 0; }
#giftPointsModal .modal-close, #giftVipModal .modal-close { margin-left: auto; }

/* 确认赠送按钮定宽，与取消按钮宽度更均衡 */
#giftPointsModal .btn-gift, #giftVipModal .btn-crown { min-width: 108px; }
#giftPointsModal .modal-footer .btn, #giftVipModal .modal-footer .btn { min-width: 88px; }

/* 快捷档选中态：积分弹窗=橙 / 会员弹窗=紫 */
.chip-pick.on {
    color: #fff;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .14);
}
#giftPointsModal .chip-pick.on { background: linear-gradient(135deg, #f7a94f 0%, #ef7a2e 100%); }
#giftVipModal .chip-pick.on { background: linear-gradient(135deg, #9d6bfa 0%, #6d28d9 100%); }
.chip-pick:active { transform: translateY(1px); }


/* ============================================================
 * 2026-10-23 晚间补充：上传区组件 / 配置页分组栅格 / 侧栏精修
 * ============================================================ */

/* ---------- 1) 更新页：拖拽式上传区 ---------- */
.upload-zone {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border: 1.5px dashed var(--c-border);
    border-radius: 12px;
    background: var(--c-bg);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--c-primary);
    background: #f3f9ff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, .12);
}
.upload-zone input[type="file"] { display: none; }
.uz-icon {
    flex: 0 0 44px; width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px; color: var(--c-primary);
    background: rgba(64, 158, 255, .1);
    transition: transform .18s ease;
}
.uz-icon svg { width: 24px; height: 24px; }
.upload-zone:hover .uz-icon, .upload-zone.dragover .uz-icon { transform: translateY(-2px); }
.uz-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.uz-title { font-size: 13.5px; font-weight: 600; color: var(--c-text); }
.uz-sub { font-size: 12px; color: var(--c-text-3); }
.uz-pick {
    flex: 0 0 auto;
    padding: 7px 16px;
    font-size: 13px; font-weight: 500;
    color: var(--c-primary);
    background: #fff;
    border: 1px solid #c6e2ff;
    border-radius: 8px;
    transition: all .16s ease;
}
.upload-zone:hover .uz-pick, .upload-zone.dragover .uz-pick {
    color: #fff; background: var(--c-primary); border-color: var(--c-primary);
    box-shadow: 0 3px 8px rgba(64, 158, 255, .3);
}
.uz-file {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px; padding: 8px 12px;
    font-size: 13px; color: var(--c-text);
    background: #f0f9eb; border: 1px solid #c2e7b0; border-radius: 8px;
}
.uz-file svg { width: 15px; height: 15px; color: var(--c-success); flex: 0 0 auto; }
.uz-file span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uz-clear {
    flex: 0 0 auto; width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 50%;
    background: transparent; color: var(--c-text-3);
    font-size: 14px; line-height: 1; cursor: pointer;
    transition: all .14s ease;
}
.uz-clear:hover { background: var(--c-danger); color: #fff; }

/* ---------- 2) 小程序配置页：分组双栏栅格 ---------- */
.cfg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}
.cfg-card { padding: 18px 20px 20px; margin: 0; display: flex; flex-direction: column; }
.cfg-span-2 { grid-column: span 2; }
.cfg-span-all { grid-column: 1 / -1; }
.cfg-card-title {
    display: flex; align-items: center; gap: 8px;
    margin: -4px 0 16px;
    font-size: 14px; font-weight: 600; color: var(--c-text);
}
.cfg-card-title::before {
    content: ""; width: 4px; height: 15px; border-radius: 2px;
    background: linear-gradient(180deg, #409eff, #2f6fd8);
}
.cfg-row { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.cfg-row:last-child { margin-bottom: 0; }
.cfg-label { font-size: 12.5px; font-weight: 500; color: var(--c-text-2); }
.cfg-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cfg-num { width: 110px !important; flex: 0 0 auto; }
.cfg-row .input { width: 100%; }
.cfg-row .input[type="number"].cfg-num { width: 110px; }
.cfg-fields-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px 20px;
}
.cfg-fields-2col .cfg-row { margin: 0; }
.cfg-fields-2col .cfg-span-2,
.cfg-fields-2col .cfg-span-all { grid-column: 1 / -1; }
.cfg-actions {
    display: flex; align-items: center; gap: 14px;
    margin-top: 16px; padding: 12px 20px;
    background: var(--c-white);
    border: 1px solid var(--c-border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
}
.cfg-actions .confirm-btn { min-width: 120px; margin-left: auto; }
@media (max-width: 1500px) {
    .cfg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .cfg-grid, .cfg-fields-2col { grid-template-columns: 1fr; }
    .cfg-span-2, .cfg-span-all, .cfg-fields-2col .cfg-span-all { grid-column: auto; }
}

/* ---------- 3) 侧栏精修：胶囊菜单项 + 层次感 ---------- */
.menu { padding: 12px 10px 16px; }
.menu-item { margin: 3px 0; }
.menu-item:not(.active):hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
    transform: translateX(2px);
}
.menu-icon-wrap {
    border-radius: 8px;
    transition: background .18s ease, border-color .18s ease;
}
.menu-item:hover .menu-icon-wrap { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .1); }
.menu-item.active .menu-icon-wrap { background: rgba(255, 255, 255, .18); border-color: transparent; }
.menu-item.active { box-shadow: 0 4px 14px rgba(64, 158, 255, .35); }
/* 侧栏菜单滚动条 */
.menu::-webkit-scrollbar { width: 5px; }
.menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 3px; }
.menu::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .24); }

/* 侧栏深色主题下的补充适配 */
[data-theme="dark"] .upload-zone, [data-theme="dark"] .upload-zone.dragover { background: #1b2029; }
[data-theme="dark"] .upload-zone.dragover { box-shadow: 0 0 0 3px rgba(64, 158, 255, .18); }
[data-theme="dark"] .uz-pick { background: #2b313c; border-color: #3a404d; }
[data-theme="dark"] .upload-zone:hover .uz-pick, [data-theme="dark"] .upload-zone.dragover .uz-pick { color: #fff; background: var(--c-primary); border-color: var(--c-primary); }
[data-theme="dark"] .uz-file { background: #1d2a1d; border-color: #2f4a2f; }
[data-theme="dark"] .cfg-actions { background: var(--c-white); }

/* ---------- 4) 演示模式（只读预览账号） ---------- */
.demo-banner {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; margin-bottom: 16px;
    border-radius: 12px; border: 1px solid rgba(64, 158, 255, .26);
    background: linear-gradient(135deg, rgba(64, 158, 255, .12), rgba(64, 158, 255, .03));
}
.demo-banner .db-icon {
    flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #409eff, #2f6fd8); color: #fff;
    box-shadow: 0 4px 12px rgba(64, 158, 255, .32);
}
.demo-banner .db-icon svg { width: 18px; height: 18px; }
.demo-banner .db-main { flex: 1 1 auto; min-width: 0; }
.demo-banner .db-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; color: var(--c-text); }
.demo-banner .db-desc { margin-top: 3px; font-size: 12px; color: var(--c-text-3); line-height: 1.5; }
.demo-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
    background: rgba(64, 158, 255, .14); color: #2f6fd8;
    border: 1px solid rgba(64, 158, 255, .32);
}
.demo-badge svg { width: 12px; height: 12px; }
[data-theme="dark"] .demo-banner { border-color: rgba(64, 158, 255, .3); background: linear-gradient(135deg, rgba(64, 158, 255, .18), rgba(64, 158, 255, .05)); }
[data-theme="dark"] .demo-badge { color: #7cb8ff; background: rgba(64, 158, 255, .18); }

/* 只读态：写操作按钮统一置灰（服务端另有一道硬拦截） */
body.is-demo .demo-blocked { opacity: .45; pointer-events: none; filter: grayscale(.7); }
body.is-demo input[readonly], body.is-demo textarea[readonly] { background: var(--c-bg); }

/* ---------- 5) 管理员弹窗：演示权限勾选 ---------- */
.demo-switch-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.perm-box {
    margin-top: 4px; padding: 12px 14px;
    border: 1px solid var(--c-border-light); border-radius: 10px;
    background: var(--c-bg);
}
.perm-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.perm-bar .perm-tip { font-size: 12px; color: var(--c-text-3); margin-left: auto; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.perm-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px;
    border: 1px solid var(--c-border-light); background: var(--c-white);
    font-size: 12.5px; color: var(--c-text-2); cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.perm-item:hover { border-color: #b3d8ff; background: #f5f9ff; }
.perm-item:has(input:checked) { border-color: var(--c-primary); background: #ecf5ff; color: var(--c-primary); }
.perm-item input[type="checkbox"] { margin: 0; flex: 0 0 auto; }
.perm-item .perm-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="dark"] .perm-box { background: #1b1f27; border-color: #2b313c; }
[data-theme="dark"] .perm-item { background: #1b1f27; border-color: #2b313c; color: var(--c-text-2); }
[data-theme="dark"] .perm-item:hover { background: #172033; border-color: #233a5a; }
[data-theme="dark"] .perm-item:has(input:checked) { background: #172033; border-color: var(--c-primary); color: #7cb8ff; }

/* 顶栏身份卡内的演示徽标 */
.id-demo-badge { align-self: flex-start; margin-top: 3px; }

/* ---------- 6) 管理员弹窗布局修正（v10.23.7） ---------- */
#adminModal .modal-box { width: 680px; max-height: 88vh; }
#adminModal .modal-body { padding: 22px 24px; }
#adminModal .modal-footer { padding: 14px 24px; }
/* 可查看页面一行：标签置顶、内容通栏，避免窄列挤压 */
#adminModal .form-row.stack { display: block; }
#adminModal .form-row.stack > .form-label { width: auto; flex: none; text-align: left; padding: 0 0 10px; }
#adminModal .form-row.stack > .muted { display: block; margin-top: 8px; }
#adminModal .demo-switch-row { padding-top: 4px; }
#adminModal .perm-box { padding: 14px 16px; border-radius: 12px; }
#adminModal .perm-list {
    grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
    max-height: 236px; overflow-y: auto; padding-right: 2px;
}
#adminModal .perm-item { padding: 9px 12px; font-size: 13px; }
#adminModal .perm-bar { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px dashed var(--c-border-light); }
#adminModal .perm-bar .btn { min-width: 64px; }
[data-theme="dark"] #adminModal .perm-bar { border-bottom-color: #2b313c; }

/* ---------- 7) 弹窗 form 包裹层滚动链修复（v10.23.8） ----------
 * .modal-box 的直接子元素是 <form>（form 再包 header/body/footer），
 * form 无高度约束会把整个弹窗撑爆、被 overflow:hidden 裁掉底部按钮。
 * 让 form 自己成为纵向 flex 容器并受 max-height 约束，body 内部滚动。
 */
.modal-box > form {
    display: flex; flex-direction: column;
    flex: 1 1 auto; min-height: 0; max-height: inherit;
}
.modal-box > form > .modal-header { flex: 0 0 auto; }
.modal-box > form > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal-box > form > .modal-footer { flex: 0 0 auto; }

/* ---------- 8) 登录页极验人机验证提示 ---------- */
.btn-outline {
    background: transparent;
    border-color: var(--c-primary);
    color: var(--c-primary);
}
.btn-outline:hover {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}
.btn-outline:disabled {
    opacity: .6;
    cursor: not-allowed;
    background: transparent;
    border-color: var(--c-border);
    color: var(--c-text-3);
}
.email-login-tip {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--c-text-3);
    line-height: 1.5;
}
[data-theme="dark"] .btn-outline { color: #7cb8ff; border-color: #2f5a8a; }
[data-theme="dark"] .btn-outline:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
