﻿/* v202606041804 - cache bust */
/* ============================================================
   style.css — 数据上报管理系统 统一样式表
   新架构：所有CSS集中管理，无行内样式，无重复定义
   ============================================================ */

/* ===== 主题色变量 ===== */
:root {
    --theme-primary: #7a89ff;
    --theme-primary-dark: #6c5ce7;
    --theme-primary-deeper: #5a4bd1;
    --theme-primary-light: #eeefff;
    --theme-primary-bg: #f9f9ff;
    --theme-primary-rgb: 108, 92, 231;
}

/* ===== 重置 & 基础 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html { overflow-y: scroll; }
body {
    background: #f7f8fa;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}
a { text-decoration: none; }

/* ===== 布局 ===== */
.layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ===== 左侧边栏 ===== */
.sidebar {
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
    color: #fff;
    padding: 20px 0 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}
.sidebar-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,.2);
}
.sidebar-header h1 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 600;
}
.sidebar-header p {
    font-size: 13px;
    opacity: .7;
}
.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, .15);
    margin-top: auto;
}
.sidebar-footer .user-info {
    display: block;
    text-align: center;
    font-size: 12px;
    opacity: .6;
    margin-bottom: 8px;
}
.sidebar-footer .btn-logout {
    display: block;
    text-align: center;
    padding: 10px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, .12);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    transition: .2s;
}
.sidebar-footer .btn-logout:hover {
    background: rgba(255, 255, 255, .28);
}

/* 主题选择器 — 下拉 */
.theme-selector {
    position: relative;
    margin: 0 auto 10px;
    max-width: 200px;
}
.theme-selector-label {
    font-size: 12px;
    opacity: .65;
    margin-bottom: 6px;
    padding: 0 2px;
}
.theme-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255,255,255,.12);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    border: none;
    width: 100%;
    transition: background .15s;
}
.theme-current:hover {
    background: rgba(255,255,255,.22);
}
.theme-current .theme-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.3);
    flex-shrink: 0;
}
.theme-arrow {
    margin-left: auto;
    font-size: 10px;
    opacity: .65;
}
/* 下拉面板 */
.theme-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 4px;
    box-shadow: 0 -4px 16px rgba(0,0,0,.25);
    display: none;
    z-index: 100;
    overflow: hidden;
}
.theme-dropdown.show {
    display: block;
}
.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background .12s;
    text-align: left;
}
.theme-option:hover {
    background: #f0f0f5;
}
.theme-option.active {
    background: var(--theme-primary-light);
    color: var(--theme-primary-dark);
    font-weight: 600;
}
.theme-option .theme-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,.15);
    flex-shrink: 0;
}
.theme-option.active .theme-dot {
    border-color: var(--theme-primary-dark);
}

/* ===== 菜单 ===== */
.menu-list {
    list-style: none;
    padding: 0 15px;
    flex: 1;
}
.menu-item {
    margin-bottom: 6px;
}
.menu-btn {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    background: rgba(255, 255, 255, .12);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: .2s;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    border: none;
    width: 100%;
    text-align: left;
}
.menu-btn:hover,
.menu-btn.active {
    background: rgba(255, 255, 255, .28);
}
.menu-btn span {
    margin-right: 8px;
}

/* 子菜单 */
.submenu {
    margin-top: 4px;
    margin-left: 28px;
    display: none;
}
.submenu.show {
    display: block;
}
.submenu a {
    display: block;
    padding: 5px 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, .75);
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.submenu a:hover,
.submenu a.active {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}
/* 菜单箭头样式 - 右侧显示 */
.menu-toggle {
    justify-content: space-between;
}
.menu-toggle span:first-child {
    margin-right: 8px;
}
.toggle-arrow {
    margin-left: auto;
    font-size: 11px;
    transition: transform 0.25s ease;
    transform: rotate(0deg);
}
.menu-toggle.open .toggle-arrow {
    transform: rotate(90deg);
}

/* ===== 主内容区 ===== */
/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    padding: 20px 30px 50px;
    overflow-x: hidden;
    overflow-y: auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
    margin-bottom: 20px;
}
.card.paginated {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.table-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.card.paginated .table-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.pagination-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 0 4px;
    flex-wrap: wrap;
    background: #fff;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a2e;
    border-bottom: 1px solid #f0f0f5;
    padding-bottom: 12px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 16px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border: 1px solid #f0f0f5;
    transition: transform .15s, box-shadow .15s;
    position: relative;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.stat-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-decoration: none;
    color: inherit;
}
.stat-card-link:hover { text-decoration: none; }
.stat-icon {
    font-size: 28px;
    margin-bottom: 6px;
    line-height: 1;
}
.stat-num {
    font-size: 26px;
    font-weight: 700;
    color: var(--theme-primary-dark);
    margin-bottom: 2px;
    line-height: 1.2;
    position: relative;
    z-index: 0;
}
.stat-label {
    font-size: 12px;
    color: #999;
    position: relative;
    z-index: 0;
}
/* 颜色变体 */
.stat-card.blue .stat-num { color: #4a90d9; }
.stat-card.green .stat-num { color: #07c160; }
.stat-card.orange .stat-num { color: #e65100; }
.stat-card.purple .stat-num { color: #7c3aed; }
.stat-card.teal .stat-num { color: #0d9488; }
.stat-card.coral .stat-num { color: #f43f5e; }
.stat-card.gold .stat-num { color: #d97706; }
.stat-card.indigo .stat-num { color: #4f46e5; }
.stat-card.cyan .stat-num { color: #0891b2; }
.stat-card.slate .stat-num { color: #64748b; }

/* ===== 快捷操作 ===== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: #fafbfc;
    border: 1px solid #eee;
    border-radius: 10px;
    text-decoration: none;
    color: #555;
    transition: .2s;
    gap: 4px;
}
.quick-card:hover {
    background: var(--theme-primary-bg, #f0f0ff);
    border-color: var(--theme-primary-light, #c4b5fd);
    transform: translateY(-2px);
    text-decoration: none;
}
.quick-icon { font-size: 32px; line-height: 1; }
.quick-label { font-size: 15px; font-weight: 600; color: #333; }
.quick-desc { font-size: 12px; color: #aaa; }

/* ===== 表格 ===== */
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th {
    text-align: left;
    font-weight: 500;
    color: #666;
    font-size: 13px;
    padding: 10px 12px;
    background: #fafafa;
    border-bottom: 2px solid #eee;
}
td {
    padding: 10px 12px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
tr:hover td {
    background: var(--theme-primary-bg);
}

/* ===== 标签/徽章 ===== */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px;
}
.tag-add { background: #e8f5e9; color: #2e7d32; }
.tag-update { background: #e3f2fd; color: #1565c0; }
.tag-inc { background: #fff3e0; color: #e65100; }
.tag-zhuanqu { background: #fce4ec; color: #c62828; }
.tag-key {
    background: #fff3e0;
    color: #e65100;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}
.tag-key-empty {
    background: #f5f5f5;
    color: #999;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}
.tag-field {
    background: #f0f0f5;
    color: #555;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px;
}

.role-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.role-0 { background: #e8f4fd; color: #1565c0; }
.role-1 { background: #fff3e0; color: #e65100; }
.role-2 { background: #f5f5f5; color: #666; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-blue { background: #e3f2fd; color: #1565c0; }
.badge-orange { background: #fff3e0; color: #e65100; }
.badge-gray { background: #f0f0f5; color: #666; }

.parent-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #fff3e0;
    color: #e65100;
    border-radius: 4px;
    font-size: 12px;
}

/* ===== Token显示 ===== */
.token {
    background: #f0f0f5;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 13px;
    color: var(--theme-primary-dark);
    font-family: Consolas, monospace;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: .2s;
}
.btn-primary {
    background: var(--theme-primary-dark);
    color: #fff;
}
.btn-primary:hover { opacity: .85; }
.btn-danger {
    background: #fa3f3f;
    color: #fff;
}
.btn-danger:hover { opacity: .85; }
.btn-cancel {
    background: #eee;
    color: #666;
    border: none;
}

.btn-sm {
    padding: 6px 14px;
    border: 1px solid #d0d0d8;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    transition: .15s;
}
.btn-sm:hover {
    border-color: var(--theme-primary-dark);
    color: var(--theme-primary-dark);
}
.btn-sm.btn-primary {
    background: var(--theme-primary-dark);
    color: #fff;
    border-color: var(--theme-primary-dark);
}
.btn-sm.btn-success {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
}
.btn-sm.btn-danger {
    background: #fa3f3f;
    color: #fff;
    border-color: #fa3f3f;
}

/* 统一操作按钮 */
.action-btns {
    display: flex;
    gap: 6px;
}
.action-btn {
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid;
    transition: all .2s;
    white-space: nowrap;
    display: inline-block;
    text-decoration: none;
}
.action-code {
    background: var(--theme-primary-light);
    color: var(--theme-primary-dark);
    border-color: rgba(var(--theme-primary-rgb), .2);
}
.action-code:hover {
    background: rgba(var(--theme-primary-rgb), .1);
    border-color: rgba(var(--theme-primary-rgb), .35);
}
.action-edit {
    background: #fff8f0;
    color: #c47a20;
    border-color: #f0ddb5;
}
.action-edit:hover {
    background: #ffedda;
    border-color: #e8c88a;
}
.action-del {
    background: #fff5f5;
    color: #d43f3f;
    border-color: #f0c0c0;
}
.action-del:hover {
    background: #ffe0e0;
    border-color: #e8a0a0;
}
.action-add-main {
    background: linear-gradient(135deg, var(--theme-primary-dark), var(--theme-primary));
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(var(--theme-primary-rgb), .3);
}
.action-add-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(var(--theme-primary-rgb), .4);
}
.action-batch {
    background: #fff5f5;
    color: #d43f3f;
    border: 1px solid #f0c0c0;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 14px;
    transition: all .2s;
}
.action-batch:hover {
    background: #ffe0e0;
    border-color: #e8a0a0;
}

/* 链接按钮 */
a.btn-action {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 12px;
}
a.btn-purple { background: var(--theme-primary-dark); color: #fff; }
a.btn-red { background: #fa3f3f; color: #fff; }
a.btn-action:hover { opacity: .85; }

/* ===== 页脚 ===== */
.page-footer {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    padding: 12px 30px;
    background: #fff;
    border-top: 1px solid #f0f0f5;
    text-align: center;
    z-index: 100;
}
.page-footer span {
    font-size: 12.5px;
    color: #999;
}

/* ===== 表单 ===== */
.fg {
    margin-bottom: 16px;
}
.fg label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}
.fg input,
.fg select,
.fg textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.fg textarea {
    resize: vertical;
    min-height: 80px;
    font-family: Consolas, monospace;
}
.fg input:focus,
.fg select:focus,
.fg textarea:focus {
    outline: none;
    border-color: var(--theme-primary-dark);
}
.fg .hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* 模式选择 */
.mode-group {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}
.mode-item {
    position: relative;
    display: inline-block;
}
.mode-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.mode-item input[type="radio"] + span {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.mode-item input[type="radio"]:checked + span {
    background: var(--theme-primary, #4a6cf7);
    color: #fff;
    border-color: var(--theme-primary, #4a6cf7);
}
.mode-item:hover input[type="radio"] + span {
    border-color: #bbb;
}
.mode-desc {
    background: #f7f7f7;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}

/* ===== 弹窗/模态框 ===== */
#mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 998;
    cursor: pointer;
}
.modal {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    z-index: 999;
    max-height: 88vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px 0;
}
.modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #333;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #ccc;
    line-height: 1;
}
.modal-close:hover { color: #555; }
.modal-body {
    padding: 16px 24px 24px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 20px;
}
.modal-footer button {
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: none;
}
.btn-ok { background: var(--theme-primary-dark); color: #fff; }

/* 添加弹窗（游戏管理） */
.modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 998;
}
.modal-box {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    width: 420px;
    z-index: 999;
}
.modal-box h3 { margin: 0 0 20px; font-size: 17px; }
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.modal-actions button,
.modal-actions .cancel {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}
.modal-actions button[type="submit"] {
    background: var(--theme-primary-dark);
    color: #fff;
}
.modal-actions .cancel {
    background: #eee;
    color: #666;
}

/* 添加表单浮层 */
.add-form-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 100;
    justify-content: center;
    align-items: center;
}
.add-form-overlay.show { display: flex; }
.add-form-box {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}
.add-form-box h3 { margin: 0 0 20px; font-size: 17px; color: #333; }
.form-item { margin-bottom: 18px; }
.form-item label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 500;
}
/* ===== 表单元素 ===== */
.form-item input,
.form-item select,
.form-item textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}
.form-item input:focus,
.form-item select:focus,
.form-item textarea:focus {
    border-color: var(--theme-primary-dark);
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb),.12);
}

/* 全局按钮 */
button,
.btn,
input[type="submit"] {
    padding: 11px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    background: var(--theme-primary-dark);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
button:hover,
.btn:hover,
input[type="submit"]:hover {
    opacity: .85;
    transform: translateY(-1px);
}
button:active,
.btn:active,
input[type="submit"]:active {
    transform: translateY(0);
}

.form-item button {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
}
.form-item input:focus { border-color: var(--theme-primary-dark); }
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}
.form-actions button,
.form-actions .btn-cancel {
    flex: 1;
    padding: 11px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    text-align: center;
    text-decoration: none;
}
.form-actions button[type="submit"] {
    background: var(--theme-primary-dark);
    color: #fff;
}
.form-actions button[type="submit"]:hover { opacity: .85; }
.form-actions .btn-cancel {
    background: #f0f0f5;
    color: #666;
}
.form-actions .btn-cancel:hover { background: #e8e8e8; }

/* 添加用户表单行 */
.add-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}
.add-form input,
.add-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* ===== 字段表 ===== */
.field-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
    table-layout: auto;
}
.field-table th,
.field-table td {
    border: 1px solid #eee;
    padding: 5px 6px;
    text-align: left;
    font-size: 13px;
    vertical-align: middle;
}
.field-table th {
    background: var(--theme-bg-light, #f7f8fa);
    font-weight: 600;
    color: var(--theme-text-secondary, #666);
    white-space: nowrap;
    font-size: 12px;
}
.field-table input[type="text"] {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}
.field-table .sort-cell {
    text-align: center;
}
.field-table .sort-input {
    width: 100%;
    text-align: center;
}
.field-table .stat-col,
.field-table .inc-col {
    text-align: center;
}
.field-table .action-cell {
    text-align: center;
    white-space: nowrap;
}
.field-table .action-cell button {
    padding: 3px 6px;
    font-size: 12px;
}
.field-table input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

/* 字段名输入框 + 预设下拉按钮 */
.preset-input-wrap {
    position: relative;
    display: block;
    width: 100%;
}
.preset-input-wrap input {
    width: 100%;
    padding: 6px 30px 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}
.preset-trigger {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: #999;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.preset-trigger:hover { transform: translateY(-50%); }

/* 预设下拉面板（全局浮动弹窗，追加到 body） */
.preset-dropdown {
    position: fixed;
    z-index: 9999;
    min-width: 140px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.preset-dropdown .preset-group {
    padding: 6px 10px 2px;
    font-size: 11px;
    font-weight: 700;
    color: #999;
}
.preset-dropdown .preset-group:first-child { padding-top: 8px; }
.preset-dropdown .preset-item {
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.preset-dropdown .preset-item:hover {
    background: #f0f0f0;
}
.sort-input {
    width: 60px !important;
    text-align: center;
}
.btn-add-field {
    background: var(--theme-primary-light);
    color: var(--theme-primary-dark);
    border: 1px dashed var(--theme-primary-dark);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    margin-bottom: 8px;
}
.btn-add-row {
    background: #f0fff0;
    color: #27ae60;
    border: 1px solid #27ae60;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    line-height: 1.2;
    vertical-align: middle;
}
.btn-del-row {
    background: #fff3f3;
    color: #fa3f3f;
    border: 1px solid #fa3f3f;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    line-height: 1.2;
    vertical-align: middle;
}

/* 操作列 — 按钮上下居中 */
.field-table td.op-cell { vertical-align: middle; text-align: center; }

/* 排序数字编辑框 + 内置增减按钮 */
.sort-cell { text-align: center; }
.sort-input-wrap {
    position: relative;
    display: inline-block;
}
.sort-input {
    width: 64px !important;
    text-align: center !important;
    padding: 4px 26px 4px 4px !important;
    background: #f9f9f9 !important;
    color: #555 !important;
    border: 1px solid #e0e0e0 !important;
    box-sizing: border-box !important;
}
.sort-spin {
    position: absolute;
    right: 1px;
    top: 1px;
    bottom: 1px;
    display: none;
    flex-direction: column;
}
.sort-input-wrap:hover .sort-spin { display: flex; }
.sort-spin button {
    flex: 1;
    width: 22px;
    padding: 0;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-radius: 0;
    background: #f5f5f5;
    color: #888;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    text-align: center;
}
.sort-spin button:hover { background: var(--theme-primary-dark); color: #fff; }
.sort-spin button:first-child { border-bottom: 1px solid #e0e0e0; }

/* 累加列 — 默认隐藏，仅inc模式显示 */
.inc-col { display: none; text-align: center; }

/* 错误提示 */
.hint-error {
    display: none;
    color: #e74c3c;
    font-size: 12px;
    margin-left: 8px;
}

/* ===== 代码弹窗 ===== */
#codeBox {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    z-index: 999;
    width: 600px;
    padding: 20px;
}
.code-tabs {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}
.code-tabs button {
    padding: 7px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.code-tabs button.active {
    background: var(--theme-primary-dark);
    color: #fff;
    border-color: var(--theme-primary-dark);
}
.code-panel { display: none; }
.code-panel.active { display: block; }
.code-panel pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 14px;
    border-radius: 6px;
    font-size: 13px;
    max-height: 280px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.copy-btn {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.copy-btn:hover {
    border-color: #bbb;
    background: #f9f9f9;
}
.copy-btn.copied {
    border-color: #07c160;
    color: #07c160;
}

/* ===== 提示条 ===== */
.info-bar {
    background: #fff3e0;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}
.msg-ok {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}
.inc-tip {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff3e0;
    border-radius: 6px;
    font-size: 12px;
    color: #e65100;
}

/* ===== 状态文本 ===== */
.s-normal { color: #07c160; }
.s-locked { color: #999; }
.self-tag { color: var(--theme-primary-dark); font-size: 12px; }

/* ===== 导航 ===== */
.breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}
.breadcrumb a {
    color: var(--theme-primary-dark);
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.manage-banner {
    background: var(--theme-primary-light);
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #1a1a2e;
    flex-shrink: 0;
}
.manage-banner strong { color: var(--theme-primary-dark); }

/* ===== 顶部操作栏 ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.top-bar .title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== 操作链接 ===== */
a.action {
    margin-right: 10px;
    text-decoration: none;
    font-size: 13px;
}
a.lock { color: #e65100; }
a.del { color: #fa3f3f; }

/* ===== 帮助页 ===== */
.help-section {
    margin-bottom: 30px;
}
.help-section h3 {
    font-size: 15px;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f5;
}
.help-section p {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.9;
}
.help-section code {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--theme-primary-dark);
}
.help-section pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 14px;
    border-radius: 8px;
    font-size: 13px;
    white-space: pre-wrap;
    line-height: 1.7;
}

/* ===== HTTPS开关 ===== */
.switch-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: .2s;
    user-select: none;
}
.switch-label input { display: none; }
.switch-label.on {
    border-color: var(--theme-primary-dark);
    background: var(--theme-primary-light);
    color: var(--theme-primary-dark);
}
.switch-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ccc;
    transition: .2s;
}
.switch-label.on .switch-dot { background: var(--theme-primary-dark); }

.btn-save {
    background: linear-gradient(135deg, var(--theme-primary-dark), var(--theme-primary));
    color: #fff;
    border: none;
    padding: 11px 30px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}
.btn-save:hover { opacity: .9; }

/* 危险操作区域 */
.init-zone {
    background: #fdf2f2;
    border: 1px solid #fad2d2;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}
.init-zone h4 {
    color: #e74c3c;
    margin-bottom: 10px;
    font-size: 15px;
}
.init-zone p {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 14px;
}
.init-zone ul {
    font-size: 13px;
    color: #666;
    padding-left: 18px;
    line-height: 2;
}

/* ===== 数据查看页 ===== */
.data-wrap {
    display: flex;
    gap: 20px;
    min-height: 700px;
}

/* 左侧树形面板 */
.tree-panel {
    width: 240px;
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    color: #fff;
}
.tree-title {
    padding: 16px 18px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
}
.tree-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.tree-node {
    margin: 2px 8px;
}
.tree-game {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: .15s;
    user-select: none;
    font-size: 14px;
    font-weight: 500;
}
.tree-game:hover {
    background: rgba(255, 255, 255, .12);
}
.tree-game .tg-arrow {
    width: 16px;
    text-align: center;
    margin-right: 4px;
    font-size: 11px;
    transition: transform .2s;
    display: inline-block;
    transform: rotate(-90deg);
}
.tree-game.open .tg-arrow {
    transform: rotate(0deg);
}
.tree-children {
    overflow: hidden;
    transition: .25s;
}
.tree-children.collapsed {
    display: none;
}
.tree-child {
    display: flex;
    align-items: center;
    padding: 8px 12px 8px 36px;
    cursor: pointer;
    border-radius: 6px;
    transition: .15s;
    font-size: 13px;
    margin: 1px 4px;
}
.tree-child:hover {
    background: rgba(255, 255, 255, .1);
}
.tree-child.active {
    background: rgba(255, 255, 255, .22);
    font-weight: 500;
}
.tree-child .tc-icon {
    margin-right: 6px;
    font-size: 13px;
}
.tree-child .tc-mode {
    margin-left: auto;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .15);
}

/* 右侧数据内容 */
.data-content {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
    overflow: auto;
    display: flex;
    flex-direction: column;
}
.dc-head {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f5;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}
.dc-info-bar {
    padding: 10px 20px;
    background: #fafbff;
    border-bottom: 1px solid #f0f0f5;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.dc-toolbar {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f5;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.search-area {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f5;
    background: #fafbff;
}
.sa-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.sa-input {
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: .15s;
}
.sa-select {
    padding: 7px 30px 7px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: #fff;
    cursor: pointer;
    color: #555;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12.5px;
    color: #888;
    font-weight: 600;
    background: #fafafa;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}
.data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f5f5f5;
    color: #333;
    white-space: nowrap;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 0 8px;
}
.page-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    font-size: 12.5px;
    cursor: pointer;
    transition: .15s;
}
.page-btn:hover {
    border-color: var(--theme-primary-dark);
    color: var(--theme-primary-dark);
}
.page-btn.active {
    background: var(--theme-primary-dark);
    color: #fff;
    border-color: var(--theme-primary-dark);
}
.page-btn.disabled {
    opacity: .4;
    cursor: default;
}

/* ===== 筛选标签 ===== */
.filter-tab {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12.5px;
    text-decoration: none;
    transition: .2s;
}

/* ===== 登录页 ===== */
.login-body {
    background: linear-gradient(180deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: "Microsoft YaHei", sans-serif;
}
.login-box {
    width: 380px;
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    z-index: 1;
}
.login-box .title {
    text-align: center;
    font-size: 22px;
    margin-bottom: 30px;
    color: #333;
}
.login-box .item {
    margin-bottom: 20px;
}
.login-box input {
    width: 100%;
    height: 46px;
    padding: 0 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}
.login-box .btn {
    width: 100%;
    height: 46px;
    background: var(--theme-primary-dark);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}
.login-box .err {
    color: red;
    text-align: center;
    margin-bottom: 15px;
}
.login-box .ok {
    color: green;
    text-align: center;
    margin-bottom: 15px;
    font-size: 13px;
}

/* 登录页底部备案 */
.login-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 20px 20px 24px;
    z-index: 1;
}
.login-footer .copyright {
    margin: 0 0 8px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .65);
    letter-spacing: .5px;
}
.login-footer .record-number {
    margin: 0;
    font-size: 12.5px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.login-footer .record-number a {
    color: rgba(255, 255, 255, .55);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: .2s;
}
.login-footer .record-number a:hover {
    color: rgba(255, 255, 255, .85);
}
.record-icon {
    width: 14px;
    height: 14px;
}

/* ===== 图表区域 ===== */
.chart-section {
    border-top: 1px solid #f0f0f5;
}
.chart-header {
    padding: 14px 20px;
    background: #fafbff;
    border-bottom: 1px solid #f0f0f5;
}
.chart-header .chart-toggle {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    padding: 0;
}
.chart-header .chart-toggle:hover { color: var(--theme-primary-dark); }
.chart-body {
    padding: 16px;
}
.chart-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.chart-form select {
    padding: 7px 30px 7px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    outline: none;
    background: #fff;
    cursor: pointer;
}
.chart-canvas-wrap {
    width: 100%;
    height: 340px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.chart-canvas-wrap canvas {
    width: 100%;
    height: 100%;
}
.chart-empty {
    text-align: center;
    padding: 60px;
    color: #ccc;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 50px;
    color: #aaa;
}
.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ===== 通用 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #888; }
.text-primary { color: var(--theme-primary-dark); }
.text-danger { color: #fa3f3f; }
.text-success { color: #07c160; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code { font-family: Consolas, "Courier New", monospace; }

/* ===== 登录页 ===== */
.login-bg {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-deeper) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrapper {
    width: 420px;
    max-width: 95%;
}
.login-logo {
    text-align: center;
    margin-bottom: 24px;
    color: #fff;
}
.login-logo h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.login-logo p { font-size: 14px; opacity: 0.8; }
.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
    margin-bottom: 16px;
}
.login-card h2 { font-size: 18px; color: #333; margin-bottom: 20px; text-align: center; }
.login-error {
    background: #fff0f0;
    color: #e74c3c;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    text-align: center;
}
.login-ok {
    background: #e8f5e9;
    color: #07c160;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    text-align: center;
}
.icp-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
}
.icp-footer a {
    color: rgba(255,255,255,.6);
    margin: 0 8px;
}
.icp-footer img.record-icon { width: 14px; height: 14px; vertical-align: middle; margin-right: 4px; }
.record-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; }

/* ===== 帮助页代码块 ===== */
.help-code {
    background: #2d2d2d;
    color: #e6db74;
    padding: 12px 16px;
    border-radius: 6px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    margin: 8px 0 12px;
    white-space: pre;
}

/* ===== 筛选行 ===== */
.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

/* ===== 代码标签 ===== */
.code-tab {
    padding: 6px 14px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    color: #666;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 12px;
    margin-right: 2px;
}
.code-tab.active {
    background: #fff;
    color: var(--theme-primary-dark);
    border-bottom-color: #fff;
    font-weight: 600;
}
.code-tab:hover { color: var(--theme-primary-dark); }

/* ===== 按钮体系 ===== */
.btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 18px; border: none; border-radius: 6px;
    font-size: 13px; cursor: pointer; transition: .15s;
    white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: 5px 14px; font-size: 12.5px; border-radius: 5px; }
.btn-primary { background: var(--theme-primary-dark); color: #fff; }
.btn-primary:hover { background: var(--theme-primary-deeper); }
.btn-outline { background: #fff; color: #555; border: 1px solid #ddd; }
.btn-outline:hover { border-color: var(--theme-primary-dark); color: var(--theme-primary-dark); }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }

/* ===== 消息条 ===== */
.msg { padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.msg-ok { background: #e8f5e9; color: #27ae60; }
.msg-err { background: #fff0f0; color: #e74c3c; }

/* ===== 邀请码管理页 ===== */
.invite-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 16px; border-bottom: 1px solid #f0f0f5; margin-bottom: 16px;
    flex-wrap: wrap; gap: 12px;
}
.invite-title-group { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.invite-stats { display: flex; gap: 6px; }
.invite-stat {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 12px; border-radius: 14px; font-size: 12.5px;
    background: #f0f0f5; color: #666;
}
.invite-stat b { color: #333; }
.invite-stat-green { background: #e8f5e9; color: #2e7d32; }
.invite-stat-green b { color: #1b5e20; }
.invite-stat-orange { background: #fff3e0; color: #e65100; }
.invite-stat-orange b { color: #bf360c; }

.invite-gen {
    display: flex; align-items: center; gap: 6px;
}
.gen-input {
    width: 52px; padding: 5px 4px; border: 1px solid #ddd; border-radius: 5px;
    font-size: 14px; text-align: center; outline: none;
}
.gen-input:focus { border-color: var(--theme-primary-dark); }

.invite-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.invite-tab {
    padding: 6px 16px; border-radius: 18px; font-size: 12.5px;
    text-decoration: none; background: #f0f0f5; color: #666; transition: .15s;
}
.invite-tab:hover { background: #e0e0ea; }
.invite-tab.active { background: var(--theme-primary-dark); color: #fff; }

.batch-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: var(--theme-primary-bg); border-radius: 8px; margin-bottom: 12px;
    border: 1px solid rgba(var(--theme-primary-rgb), .12);
}
.batch-count { font-size: 13px; color: #666; margin-right: 8px; }
.batch-count b { color: var(--theme-primary-dark); }

.invite-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.invite-table th {
    text-align: left; padding: 10px 12px; font-size: 12px; color: #888;
    font-weight: 600; background: #fafafa; border-bottom: 2px solid #eee;
    white-space: nowrap;
}
.invite-table td {
    padding: 10px 12px; border-bottom: 1px solid #f5f5f5; color: #333;
}
.th-check, .td-check { width: 36px; text-align: center; }
.td-id { color: #999; font-size: 12px; width: 50px; }
.td-code { font-family: Consolas, monospace; font-size: 13.5px; color: #4a90d9; font-weight: 600; }
.td-time { color: #999; font-size: 12px; white-space: nowrap; }
.td-actions { white-space: nowrap; }

.status-badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px;
}
.status-ok { background: #e8f5e9; color: #2e7d32; }
.status-used { background: #fce4ec; color: #c62828; }
.status-disabled { background: #f0f0f5; color: #999; }

.act-link { font-size: 12px; text-decoration: none; margin-right: 10px; }
.act-link:hover { text-decoration: underline; }
.act-warn { color: #e67e22; }
.act-ok { color: #27ae60; }
.act-danger { color: #e74c3c; }

/* 开/关切换按钮 */
.toggle-btns { display: flex; align-items: center; }
.tg-btn { display: inline-block; padding: 5px 16px; font-size: 13px; border: 1px solid #d0d0d0; cursor: pointer; user-select: none; background: #f5f5f5; color: #666; transition: .2s; }
.tg-btn:first-of-type { border-radius: 5px 0 0 5px; }
.tg-btn:last-of-type { border-radius: 0 5px 5px 0; }
.tg-btn.tg-active { background: var(--theme-primary-dark); color: #fff; border-color: var(--theme-primary-dark); }

/* 注册页购买按钮 */
.btn-buy-invite { display: inline-flex; align-items: center; padding: 0 16px; font-size: 13px; font-weight: 500; background: #ff6b35; color: #fff; border-radius: 6px; text-decoration: none; white-space: nowrap; transition: .2s; }
.btn-buy-invite:hover { background: #e85d2c; color: #fff; }

/* 居中弹窗提示 */
.toast-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 9999; animation: toastFadeIn .2s ease; }
.toast-box { background: #fff; border-radius: 8px; padding: 14px 32px; color: #333; font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.15); }
@keyframes toastFadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 仪表盘 v2 ===== */
/* 弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dash-modal {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    min-width: 400px;
    max-width: 560px;
    width: 90vw;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
}
.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
}
.modal-btns {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.btn-cancel {
    padding: 8px 20px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}
.btn-cancel:hover { background: #f5f5f5; }
/* 统计卡片 */
.dash-stat-card { position: relative; }
.stat-sub {
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.card-remove-btn {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
    background: none;
    border: none;
    font-size: 18px;
    color: #ccc;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color .15s;
}
.card-remove-btn:hover { color: #e74c3c; }
.card-compare {
    margin-top: 8px;
    font-size: 12px;
    color: #aaa;
}
.change-up { color: #e74c3c; font-weight: 600; }
.change-down { color: #07c160; font-weight: 600; }

/* 趋势标签 */
.trend-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.trend-tab {
    padding: 5px 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: .15s;
}
.trend-tab:hover { border-color: var(--theme-primary-light); color: var(--theme-primary); }
.trend-tab.active {
    background: var(--theme-primary);
    color: #fff;
    border-color: var(--theme-primary);
}

/* 自定义日期行 */
.custom-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #f8f9fb;
    border-radius: 8px;
}
.date-inp {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

/* 趋势汇总 */
.trend-summary {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
    color: #888;
}
.trend-summary b { color: var(--theme-primary-dark); font-size: 16px; }

/* 字段选择弹窗 */
.card-field-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
}
.card-field-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    transition: background .1s;
}
.card-field-item:hover { background: #f5f5ff; }
.card-field-item.added { opacity: .5; cursor: default; background: #fafafa; }
.card-field-item.added:hover { background: #fafafa; }
.card-field-item input[type="checkbox"] {
    accent-color: var(--theme-primary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.already-badge {
    font-size: 11px;
    color: #999;
    background: #f0f0f5;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

/* ===== 仪表盘自定义面板 ===== */
.custom-panel {
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.custom-panel-hd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
.custom-panel-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
}
.custom-panel-body {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.custom-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    user-select: none;
}
.custom-check input[type="checkbox"] {
    accent-color: var(--theme-primary);
    width: 16px;
    height: 16px;
}
.custom-panel-ft {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

/* ===== 趋势图 ===== */
.trend-section {
    padding-top: 20px;
    border-top: 1px solid #f0f0f5;
}
.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.trend-title { font-size: 14px; font-weight: 600; color: #444; }
.trend-total { font-size: 12px; color: #aaa; }
.trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 140px;
    padding: 0 4px;
}
.trend-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    gap: 4px;
}
.trend-bar-val {
    font-size: 11px;
    color: #999;
    font-weight: 600;
}
.trend-bar {
    width: 100%;
    max-width: 40px;
    background: var(--theme-primary);
    border-radius: 4px 4px 0 0;
    transition: height .3s;
    min-height: 2px;
}
.trend-bar-label {
    font-size: 10px;
    color: #bbb;
    margin-top: 2px;
}

/* ===== 统计字段标签 ===== */
.tag-stat {
    display: inline-block;
    padding: 2px 8px;
    margin: 1px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* ===== 上报列表卡片式行 ===== */
.report-table td {
    vertical-align: middle;
    padding: 8px 10px;
}
.report-table tbody tr {
    transition: background .15s;
}
.report-table tbody tr:hover {
    background: var(--theme-primary-bg);
}

/* 字段计数按钮 + 统计徽章 */
.field-count-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.field-count-btn:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary-dark);
    background: #fff;
}
.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    background: var(--theme-primary-light);
    color: var(--theme-primary-dark);
    padding: 0px 5px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
}

/* 行操作按钮组 */
.row-actions {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}
.row-act-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1.4;
}
.row-act-btn:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary-dark);
    background: #fff;
}
.row-act-del:hover {
    border-color: #d43f3f;
    color: #d43f3f;
    background: #fff5f5;
}
.row-act-more {
    color: #888;
}

/* 行操作下拉 */
.row-menu-wrap {
    position: relative;
    display: inline-block;
}
.row-menu-btn {
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    line-height: 1;
}
.row-menu-btn:hover,
.row-menu-btn.active {
    background: #f0f0f5;
    color: #555;
    border-color: #e0e0e0;
}
.row-menu-drop {
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    min-width: 150px;
    z-index: 60;
    display: none;
    padding: 4px 0;
    margin-top: 2px;
}
.row-menu-drop.show {
    display: block;
}
.row-menu-drop button,
.row-menu-drop a {
    display: block;
    width: 100%;
    padding: 8px 16px;
    text-align: left;
    border: none;
    background: none;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background .1s;
}
.row-menu-drop button:hover,
.row-menu-drop a:hover {
    background: #f5f5f8;
}
