/* ===================================
   游戏运营管理后台 - 企业级设计系统
   Game Operations Enterprise Admin Design System
   =================================== */

/* ---------- CSS 变量 ---------- */
:root {
    --color-primary: #4F46E5;
    --color-primary-hover: #4338CA;
    --color-primary-bg: rgba(79,70,229,0.06);
    --color-primary-border: rgba(79,70,229,0.2);

    --color-success: #059669;
    --color-success-bg: rgba(5,150,105,0.08);
    --color-warning: #D97706;
    --color-warning-bg: rgba(217,119,6,0.08);
    --color-danger: #DC2626;
    --color-danger-bg: rgba(220,38,38,0.06);
    --color-info: #2563EB;
    --color-info-bg: rgba(37,99,235,0.08);

    --color-bg: #F1F5F9;
    --color-surface: #FFFFFF;
    --color-border: #E2E8F0;
    --color-border-light: #F1F5F9;

    --color-text: #0F172A;
    --color-text-secondary: #475569;
    --color-text-muted: #94A3B8;

    --sidebar-width: 190px;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);

    --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px; line-height: 1.5; color: var(--color-text);
    background: var(--color-bg); min-height: 100vh;
}

ol, ul { list-style: none; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
table { border-collapse: collapse; border-spacing: 0; }

/* ---------- 布局 ---------- */
.layout-body { display: flex; }

.main-wrap {
    margin-left: var(--sidebar-width);
    flex: 1; min-width: 0;
}

.page-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 20px 32px;
    display: flex; align-items: center; justify-content: space-between;
}

.page-title {
    font-size: 18px; font-weight: 700; color: var(--color-text);
    letter-spacing: -0.3px;
}

.page-content { padding: 15px 15px; }

.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-h);
}

/* ===================================
   顶栏 Topbar
   =================================== */
.topbar {
    position: fixed; top: 0; left: var(--sidebar-width); right: 0;
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    z-index: 90;
    transition: left 0.2s;
}
.sidebar.collapsed ~ .topbar { left: var(--sidebar-collapsed); }

.topbar-search {
    display: flex; align-items: center; gap: 8px;
    background: var(--color-bg); border-radius: var(--radius-sm);
    padding: 0 12px; max-width: 260px; flex: 1;
}
.topbar-search svg { width: 16px; height: 16px; color: var(--color-text-muted); flex-shrink: 0; }
.topbar-search input {
    flex: 1; border: none; background: transparent;
    padding: 8px 0; font-size: 13px; color: var(--color-text);
    outline: none; min-width: 0;
}
.topbar-search input::placeholder { color: var(--color-text-muted); }

.topbar-actions {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}

.topbar-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    color: var(--color-text-muted); cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative;
}
.topbar-btn:hover { background: var(--color-bg); color: var(--color-text); }
.topbar-btn svg { width: 18px; height: 18px; }

/* ===================================
   侧边栏
   =================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex; flex-direction: column; flex-shrink: 0;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 16px;
    border-bottom: 1px solid var(--color-border);
}
.sidebar-brand svg { width: 22px; height: 22px; color: var(--color-primary); flex-shrink: 0; }
.sidebar-brand span { font-size: 15px; font-weight: 600; color: var(--color-text); }

.sidebar-toggle {
    display: flex; align-items: center; justify-content: center;
    padding: 12px; border-top: 1px solid var(--color-border);
    cursor: pointer; color: var(--color-text-muted); transition: color .15s;
}
.sidebar-toggle:hover { color: var(--color-primary); }
.sidebar-toggle svg { width: 18px; height: 18px; }

.sidebar-header {
    padding: 20px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; gap: 10px;
}

.sidebar-logo {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--color-primary), #6366F1);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: #fff; font-size: 14px; font-weight: 700;
}

.sidebar-title {
    font-size: 15px; font-weight: 600; color: var(--color-text);
}

.sidebar-nav {
    flex: 1; padding: 12px 12px; overflow-y: auto;
}

.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--color-text-secondary); font-size: 13.5px;
    cursor: pointer; transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--color-bg); color: var(--color-text);
}

.nav-item.active {
    background: var(--color-primary-bg); color: var(--color-primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; background: var(--color-primary);
    border-radius: 0 3px 3px 0;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.nav-icon {
    flex-shrink: 0; width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    color: inherit;
}

.nav-icon svg { width: 100%; height: 100%; display: block; }

.nav-group { margin-bottom: 2px; }

.nav-group-title {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--color-text-secondary); font-size: 13.5px;
    cursor: pointer; transition: all var(--transition);
    user-select: none;
}

.nav-group-title:hover { background: var(--color-bg); color: var(--color-text); }

.nav-arrow {
    margin-left: auto; display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s ease; color: inherit;
}

.nav-arrow svg { width: 14px; height: 14px; display: block; }
.nav-group.open .nav-arrow { transform: rotate(180deg); }

.nav-group-sub {
    overflow: hidden; max-height: 0;
    transition: max-height 0.25s ease;
}

.nav-group.open .nav-group-sub { max-height: 300px; }

.nav-sub-item {
    display: flex; align-items: center;
    padding: 7px 12px 7px 48px;
    font-size: 13px; color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer; transition: all var(--transition);
}

.nav-sub-item:hover { background: var(--color-bg); color: var(--color-text); }

.nav-sub-item.active {
    background: var(--color-primary-bg); color: var(--color-primary);
    font-weight: 500;
}

/* ---------- 头部用户区 ---------- */
.header-left {
    display: flex; align-items: center; gap: 10px;
}

.hamburger-btn { display: none; }  /* 桌面隐藏，手机端 @media 开启 */
.mobile-filter-bar,
.mobile-filter-expand { display: none; }  /* 桌面隐藏，手机端 @media 开启 */

.header-dept-sel {
    height: 32px; font-size: 13px;
    border: 1px solid var(--color-border);
    border-radius: 6px; padding: 0 8px;
    background: var(--color-bg); color: var(--color-text);
    cursor: pointer; min-width: 140px;
}

.header-user {
    display: flex; align-items: center; gap: 10px;
    position: relative;
}

/* ---------- 消息铃铛 ---------- */
.header-search {
    display: flex; align-items: center; gap: 0;
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: var(--radius); overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
    max-width: 280px; width: 234px;
}

.header-search:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.header-search-input {
    flex: 1; height: 32px; padding: 0 12px;
    font-size: 13px; font-family: inherit;
    border: none; outline: none; background: transparent;
    color: var(--color-text); min-width: 0;
}

.header-search-input::placeholder {
    color: var(--color-text-muted); opacity: 1;
}

.header-search-btn {
    width: 36px; height: 32px; border: none; outline: none;
    background: var(--color-primary); color: #fff;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: background var(--transition);
}

.header-search-btn:hover { background: var(--color-primary-hover); }

.header-search-btn svg { width: 16px; height: 16px; }

.header-bell {
    position: relative; width: 32px; height: 32px; border-radius: 50%;
    background: var(--color-bg); display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--color-text-secondary); transition: all var(--transition);
}

.header-bell:hover { background: #E2E8F0; color: var(--color-text); }

.bell-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; border-radius: 9px;
    background: var(--color-danger); color: #fff;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1; border: 2px solid var(--color-surface);
}

/* ---------- 侧边栏通知徽章 ---------- */
.nav-badge {
    min-width: 18px; height: 18px; border-radius: 9px;
    background: var(--color-danger); color: #fff;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1; border: 2px solid var(--color-surface);
    margin-left: 6px; flex-shrink: 0;
}

/* ---------- 消息状态标签 ---------- */
.message-status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 100px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}

.message-status-badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}

.message-status-badge.unread {
    background: #FFF7ED; color: #EA580C;
}
.message-status-badge.unread::before {
    background: #EA580C;
}

.message-status-badge.read {
    background: #F1F5F9; color: #94A3B8;
}
.message-status-badge.read::before {
    background: #94A3B8;
}

/* ---------- 消息列表 ---------- */
.message-list-body {
    padding: 0 !important;
}

.message-list-container {
    max-height: 420px; overflow-y: auto;
    padding: 4px 0;
}

.message-empty {
    text-align: center; padding: 48px 20px;
    color: var(--color-text-muted); font-size: 14px;
}

.message-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px; cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s ease;
}

.message-item:last-child { border-bottom: none; }

.message-item:hover { background: #F8FAFC; }

.message-item.unread { background: #F0F4FF; }

.message-item.unread:hover { background: #E6ECFE; }

.message-item-left {
    flex-shrink: 0; width: 36px;
    display: flex; align-items: center; justify-content: center;
}

.message-index {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: #F1F5F9; color: var(--color-text-muted);
    font-size: 12px; font-weight: 700;
}

.message-item.unread .message-index {
    background: var(--color-primary-bg); color: var(--color-primary);
}

.message-item-center {
    flex: 1; min-width: 0;
}

.message-item-title {
    font-size: 14px; font-weight: 600; color: var(--color-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.4;
}

.message-item.unread .message-item-title { font-weight: 700; }

.message-item-preview {
    font-size: 12px; color: var(--color-text-muted);
    margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.message-item-right {
    flex-shrink: 0;
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 6px;
}

.message-item-date {
    font-size: 11px; color: var(--color-text-muted); white-space: nowrap;
}

/* ---------- 消息分页 ---------- */
.message-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
    background: #FAFBFC;
}

.pagination-info {
    font-size: 12px; color: var(--color-text-muted);
}

.pagination-btns {
    display: flex; gap: 6px;
}

/* ---------- 消息详情 ---------- */
.msg-detail-meta {
    display: flex; align-items: center; gap: 10px;
    margin-top: 4px;
}

.msg-detail-date {
    font-size: 12px; color: var(--color-text-muted);
}

.msg-detail-content {
    line-height: 1.8; font-size: 14px; color: var(--color-text);
    white-space: pre-wrap; word-break: break-word;
    padding: 4px 0;
}

/* ---------- 全局搜索 ---------- */
.search-result-body { padding: 0 !important; }

.search-result-container { max-height: 500px; overflow-y: auto; }

.search-group { padding: 0; }

.search-group-title {
    padding: 10px 20px; font-size: 12px; font-weight: 600;
    color: var(--color-text-muted); text-transform: uppercase;
    letter-spacing: 0.5px; background: #FAFBFC;
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: 0; z-index: 1;
}

.search-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s ease;
}

.search-item:last-child { border-bottom: none; }

.search-item:hover { background: #F8FAFC; }

.search-item-icon {
    width: 36px; height: 36px; border-radius: 8px;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #fff;
}

.search-icon-player  { background: #3B82F6; }
.search-icon-role    { background: #10B981; }
.search-icon-game    { background: #F59E0B; }
.search-icon-gift    { background: #EC4899; }
.search-icon-order   { background: #8B5CF6; }
.search-icon-message { background: #6B7280; }

.search-icon-player::before  { content: 'P'; }
.search-icon-role::before    { content: 'R'; }
.search-icon-game::before    { content: 'G'; }
.search-icon-gift::before    { content: 'G'; }
.search-icon-order::before   { content: '¥'; }
.search-icon-message::before { content: 'M'; }

.search-item-center { flex: 1; min-width: 0; }

.search-item-title {
    font-size: 14px; font-weight: 600; color: var(--color-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.4;
}

.search-item-subtitle {
    font-size: 12px; color: var(--color-text-muted);
    margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.search-item-extra, .search-item-extra2 {
    flex-shrink: 0; font-size: 12px; color: var(--color-text-muted);
    white-space: nowrap;
}

.search-highlight {
    background: #FEF08A; color: #854D0E; padding: 1px 3px;
    border-radius: 2px; font-weight: 600;
}

.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #6366F1);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; flex-shrink: 0;
    cursor: pointer; transition: opacity var(--transition);
}

.user-avatar:hover { opacity: 0.85; }

.user-name {
    font-size: 13px; color: var(--color-text); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.btn-logout {
    margin-left: auto; color: var(--color-text-muted);
    cursor: pointer; padding: 5px;
    transition: color var(--transition);
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
}

.btn-logout:hover {
    color: var(--color-danger); background: var(--color-danger-bg);
}

.btn-logout svg { width: 16px; height: 16px; display: block; }

/* ---------- 顶栏按钮与徽标 ---------- */
.user-menu { position: relative; cursor: pointer; }
.badge-dot {
    position: absolute; top: 7px; right: 7px;
    width: 7px; height: 7px; border-radius: 50%;
    background: #EF4444; border: 2px solid var(--color-surface);
}
.theme-icon::before { content: '\263D'; font-size: 18px; line-height: 1; }
[data-theme="dark"] .theme-icon::before { content: '\2600'; font-size: 16px; }

/* ---------- 用户下拉菜单 ---------- */
.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 170px; background: var(--color-surface);
    border: 1px solid var(--color-border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 6px; z-index: 500;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.user-dropdown.show {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.user-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    font-size: 13px; color: var(--color-text); cursor: pointer;
    transition: background var(--transition); white-space: nowrap;
}

.user-dropdown-item:hover { background: var(--color-bg); }

.user-dropdown-item.danger { color: var(--color-danger); }
.user-dropdown-item.danger:hover { background: var(--color-danger-bg); }

.user-dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.user-dropdown-divider {
    height: 1px; background: var(--color-border); margin: 4px 8px;
}

/* dropdown 别名（独立页面常用） */
.dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; font-size: 13px; color: var(--color-text);
    cursor: pointer; border-radius: 6px; transition: background .15s;
    white-space: nowrap; text-decoration: none;
}
.dropdown-item:hover { background: var(--color-bg); }
.dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--color-border); margin: 4px 8px; }

/* ===================================
   统计卡片
   =================================== */
.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 20px;
}

.stat-card {
    display: flex; align-items: center; gap: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: box-shadow var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); }

.stat-icon {
    width: 48px; height: 48px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.stat-card.primary .stat-icon { background: var(--color-primary-bg); color: var(--color-primary); }
.stat-card.info .stat-icon    { background: var(--color-info-bg); color: var(--color-info); }
.stat-card.success .stat-icon { background: var(--color-success-bg); color: var(--color-success); }
.stat-card.warning .stat-icon { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-card.danger .stat-icon  { background: var(--color-danger-bg); color: var(--color-danger); }

.stat-info { min-width: 0; }

.stat-label {
    font-size: 12px; color: var(--color-text-muted);
    margin-bottom: 4px; font-weight: 500; letter-spacing: 0.3px;
}

.stat-value {
    font-size: 24px; font-weight: 700; color: var(--color-text);
    line-height: 1.2;
}

/* ---------- 小统计卡片 ---------- */
.stat-row-4 { margin-bottom: 28px; }

.stat-mini {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px; text-align: center;
    transition: box-shadow var(--transition);
}

.stat-mini:hover { box-shadow: var(--shadow-sm); }

.stat-mini-value {
    font-size: 22px; font-weight: 700; color: var(--color-primary);
    line-height: 1.3;
}

.stat-mini-label {
    font-size: 12px; color: var(--color-text-muted);
    margin-top: 2px; font-weight: 500;
}

/* ---------- 订单统计栏 ---------- */
.order-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 24px;
}

.order-stats-bar .stat-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: box-shadow var(--transition);
}

.order-stats-bar .stat-card:hover { box-shadow: var(--shadow); }

.order-stats-bar .stat-label {
    font-size: 12px; color: var(--color-text-muted);
    margin-bottom: 6px; font-weight: 500; letter-spacing: 0.3px;
}

.order-stats-bar .stat-value {
    font-size: 26px; font-weight: 700; color: var(--color-text);
}

.order-stats-bar .stat-paid .stat-value { color: var(--color-success); }
.order-stats-bar .stat-unpaid .stat-value { color: var(--color-warning); }
.order-stats-bar .stat-amount .stat-value { color: var(--color-primary); }

/* ===================================
   卡片组件
   =================================== */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    margin-bottom: 24px; overflow: hidden;
}

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid var(--color-border);
}

.card-header h3 { font-size: 15px; font-weight: 600; color: var(--color-text); }

.card-body { padding: 15px; }

/* ===================================
   表格
   =================================== */
.table-wrap {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.table-wrap table { width: 100%; table-layout: auto; }

.table-wrap th,
.table-wrap td {
    padding: 10px 14px; text-align: left; font-size: 13px;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

.table-wrap th {
    background: #F8FAFC; color: var(--color-text-secondary);
    font-weight: 600; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.3px;
    white-space: nowrap; border-bottom: 1px solid var(--color-border);
}

.table-wrap td { color: var(--color-text); white-space: nowrap; }

.table-wrap tbody tr { transition: background var(--transition); }

.table-wrap tbody tr:hover { background: #F8FAFC; }
[data-theme="dark"] .table-wrap tbody tr:hover { background: transparent; }

.table-wrap tbody tr:last-child td { border-bottom: none; }

/* ===================================
   按钮
   =================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 8px 16px;
    font-size: 13px; font-weight: 500; font-family: inherit;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition); white-space: nowrap;
    border: 1px solid transparent; line-height: 1.4;
}

.btn:active { transform: scale(0.98); }

/* 主按钮 */
.btn-primary {
    background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }

/* 次要/默认按钮 */
.btn-secondary {
    background: var(--color-surface); color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--color-bg); border-color: #CBD5E1; }

/* 危险按钮 */
.btn-danger {
    background: var(--color-danger); color: #fff; border-color: var(--color-danger);
}
.btn-danger:hover { background: #B91C1C; border-color: #B91C1C; }

/* 成功按钮 */
.btn-success {
    background: var(--color-success); color: #fff; border-color: var(--color-success);
}
.btn-success:hover { background: #047857; border-color: #047857; }

/* 警告按钮 */
.btn-warning {
    background: var(--color-warning); color: #fff; border-color: var(--color-warning);
}
.btn-warning:hover { background: #B45309; border-color: #B45309; }

/* 默认文字按钮（deprecated - use btn-secondary） */
.btn-default {
    background: var(--color-surface); color: var(--color-text);
    border-color: var(--color-border);
}
.btn-default:hover { background: var(--color-bg); border-color: #CBD5E1; }

/* 文字按钮 - 用于表格行内操作 */
.btn-text {
    background: transparent; border-color: transparent;
    color: var(--color-primary); font-size: 12px; padding: 4px 8px;
}
.btn-text:hover { background: var(--color-primary-bg); color: var(--color-primary-hover); }
.btn-text.danger { color: var(--color-danger); }
.btn-text.danger:hover { background: var(--color-danger-bg); color: #B91C1C; }

/* 轮廓按钮 */
.btn-outline {
    background: transparent; color: var(--color-text-secondary);
    border-color: var(--color-border);
}
.btn-outline:hover { background: var(--color-bg); border-color: #CBD5E1; }

/* 按钮尺寸 */
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===================================
   表单控件
   =================================== */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--color-text); margin-bottom: 6px;
}

.form-control {
    width: 100%; height: 40px; padding: 0 12px;
    font-size: 14px; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    outline: none; color: var(--color-text); background: var(--color-bg);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control::placeholder { color: var(--color-text-muted); opacity: 1; }
.form-control:hover { border-color: #CBD5E1; }

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
    background: var(--color-surface);
}
.form-control.error { border-color: var(--color-danger); }

textarea.form-control {
    height: auto; padding: 10px 12px; resize: vertical; min-height: 80px;
}

/* 通用输入框/下拉框 */
.form-input, .form-select {
    height: 36px; padding: 0 12px;
    font-size: 13px; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    outline: none; color: var(--color-text); background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-input:hover, .form-select:hover {
    border-color: #CBD5E1;
}

.form-input::placeholder, .form-select::placeholder {
    color: var(--color-text-muted); opacity: 1;
}

.form-input:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
    background: var(--color-surface);
}

.form-input { max-width: 400px; }
.form-select {
    min-width: 120px; max-width: 200px; cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.form-row {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}

.form-row .form-input { flex: 1; max-width: none; min-width: 0; }

/* ===================================
   筛选栏
   =================================== */
.filter-bar {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 10px; margin-bottom: 20px;
    padding: 14px 16px;
    background: #F8FAFC;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.filter-bar .form-row { width: 100%; }

.filter-bar .form-input,
.filter-bar .form-select { height: 36px; font-size: 13px; }

.filter-item { display: flex; align-items: center; gap: 8px; }

.filter-label {
    font-size: 13px; color: var(--color-text-secondary); white-space: nowrap;
}

/* ===================================
   表单组件
   =================================== */
.form-item { margin-bottom: 18px; }

.form-item label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--color-text); margin-bottom: 8px;
}

.form-item textarea {
    width: 100%; height: auto; padding: 10px 12px;
    font-size: 14px; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    outline: none; color: var(--color-text); background: var(--color-bg);
    transition: all var(--transition); resize: vertical; min-height: 80px;
}

.form-item textarea::placeholder { color: var(--color-text-muted); opacity: 1; }

.form-item textarea:hover { border-color: #CBD5E1; background: var(--color-surface); }

.form-item textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
    background: var(--color-surface);
}

.required { color: var(--color-danger); margin-left: 2px; }

.radio-group { display: flex; gap: 12px; }

.radio {
    position: relative;
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 14px; font-weight: 500;
    color: var(--color-text-secondary);
    padding: 7px 16px 7px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    transition: all 0.2s ease;
    user-select: none;
}

.radio:hover { border-color: #CBD5E1; background: var(--color-surface); }

.radio input {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}

.radio::before {
    content: '';
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid #CBD5E1;
    background: var(--color-surface);
    flex-shrink: 0; transition: all 0.2s ease;
}

.radio:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
    color: var(--color-primary);
}

.radio:has(input:checked)::before {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: inset 0 0 0 3px var(--color-surface);
}

.form-tip {
    font-size: 12px; color: var(--color-text-muted); margin-top: 6px;
}

/* ===================================
   状态标签
   =================================== */
.status-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 500;
}

.status-badge.enabled {
    background: var(--color-success-bg); color: var(--color-success);
}

.status-badge.disabled {
    background: var(--color-danger-bg); color: var(--color-danger);
}

.status-badge.vip {
    background: rgba(217,119,6,0.1); color: #b45309; border: 1px solid rgba(217,119,6,0.25);
}

.status-badge.online {
    background: rgba(5,150,105,0.1); color: var(--color-success); border: 1px solid rgba(5,150,105,0.25);
}

.player-status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 500; white-space: nowrap;
}

.player-status::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}

.status-VIP { background: var(--color-success-bg); color: var(--color-success); }
.status-VIP::before { background: var(--color-success); }

.status-CDK { background: var(--color-info-bg); color: var(--color-info); }
.status-CDK::before { background: var(--color-info); }
.status-流失 { background: var(--color-warning-bg); color: var(--color-warning); }
.status-流失::before { background: var(--color-warning); }

.status-recall, .status-召回 { background: var(--color-info-bg); color: var(--color-info); }
.status-recall::before, .status-召回::before { background: var(--color-info); }

.status-recall_lost { background: var(--color-danger-bg); color: var(--color-danger); }
.status-recall_lost::before { background: var(--color-danger); }

/* ---------- 渠道标签 ---------- */
.perf-channel {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 400; white-space: nowrap;
    background: #FDF2F8; color: #BE185D;
}
.perf-channel::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0; background: #BE185D;
}

.perf-channel-gray { background: #F3F4F6; color: #6B7280; }
.perf-channel-gray::before { background: #9CA3AF; }

/* ---------- 订单状态标签 ---------- */
.order-status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 500;
}

.order-status::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}

.order-paid { background: var(--color-success-bg); color: var(--color-success); }
.order-paid::before { background: var(--color-success); }

.order-unpaid { background: var(--color-warning-bg); color: var(--color-warning); }
.order-unpaid::before { background: var(--color-warning); }

/* ---------- 游戏状态标签 ---------- */
.game-status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 500; white-space: nowrap;
}

.game-status::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}

.game-normal { background: var(--color-success-bg); color: var(--color-success); }
.game-normal::before { background: var(--color-success); }

.game-disabled { background: #F1F5F9; color: var(--color-text-muted); }
.game-disabled::before { background: var(--color-text-muted); }

/* ---------- 审核状态标签 ---------- */
.audit-status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 500; white-space: nowrap;
}

.audit-status::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}

.audit-pending { background: var(--color-warning-bg); color: var(--color-warning); }
.audit-pending::before { background: var(--color-warning); }

.audit-done { background: var(--color-success-bg); color: var(--color-success); }
.audit-done::before { background: var(--color-success); }

.audit-reject { background: var(--color-danger-bg); color: var(--color-danger); }
.audit-reject::before { background: var(--color-danger); }

/* ---------- 通用 tag ---------- */
.tag {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 500;
}

.tag-success { background: var(--color-success-bg); color: var(--color-success); }
.tag-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.tag-danger  { background: var(--color-danger-bg);  color: var(--color-danger); }
.tag-info    { background: var(--color-info-bg);    color: var(--color-info); }
.tag-default { background: var(--color-bg); color: var(--color-text-secondary); }

/* ===================================
   code / 等宽文本
   =================================== */
code {
    font-family: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
    font-size: 11.5px; background: #F1F5F9;
    padding: 2px 6px; border-radius: 4px;
    color: var(--color-text-secondary);
}

/* ===================================
   操作按钮组
   =================================== */
.action-btns { display: flex; gap: 6px; }

/* ===================================
   复选框
   =================================== */
#checkAll, .checkItem {
    width: 16px; height: 16px;
    accent-color: var(--color-primary); cursor: pointer;
}

/* ===================================
   可点击链接文本
   =================================== */
.link-count {
    color: var(--color-primary); cursor: pointer; font-weight: 600;
    transition: color var(--transition);
}
.link-count:hover { color: var(--color-primary-hover); }

/* ---------- 统计数据小标签 ---------- */
.stat-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
    cursor: pointer; transition: all var(--transition);
    text-decoration: none;
}

.stat-badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}

.badge-role { background: var(--color-info-bg); color: var(--color-info); }
.badge-role::before { background: var(--color-info); }
.badge-role:hover { background: #DBEAFE; color: #1D4ED8; }

.badge-recharge { background: #F5F3FF; color: #7C3AED; }
.badge-recharge::before { background: #7C3AED; }
.badge-recharge:hover { background: #EDE9FE; color: #6D28D9; }

.badge-channel { background: #FDF2F8; color: #BE185D; }
.badge-channel::before { background: #BE185D; }
.badge-channel:hover { background: #FCE7F3; color: #9D174D; }

/* ===================================
   空状态
   =================================== */
.empty-state {
    text-align: center; padding: 48px 20px;
    color: var(--color-text-muted); font-size: 14px;
}

/* ===================================
   分页
   =================================== */
.pagination-wrap {
    display: flex; align-items: center; justify-content: flex-end;
    padding: 16px 0 0; gap: 8px;
}

.pagination-wrap span {
    font-size: 13px; color: var(--color-text-muted);
}

.pagination-wrap .form-select {
    height: 32px; min-width: auto; font-size: 13px; padding: 0 8px;
}

.page-btn {
    min-width: 34px; height: 34px; padding: 0 10px;
    font-size: 13px; font-weight: 500;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: var(--color-surface); color: var(--color-text);
    cursor: pointer; font-family: inherit;
    transition: all var(--transition);
    display: inline-flex; align-items: center; justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background: var(--color-primary); color: #fff;
    border-color: var(--color-primary);
}
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ===================================
   通用表格
   =================================== */
.data-table {
    width: 100%;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-collapse: collapse;
}
.data-table thead { background: var(--color-bg); }
.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 13px;
    color: var(--color-text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--color-bg); }
.data-table .empty-row {
    text-align: center; padding: 40px 16px; color: var(--color-text-muted); font-size: 13px;
}

/* ===== 分页器 ===== */
.pager {
    display: flex; align-items: center; gap: 8px;
    margin-top: 16px; font-size: 13px; color: var(--color-text-muted);
}
.pager button {
    padding: 5px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}
.pager button:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 通用 Tab 导航 ===== */
.tab-nav {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
}
.tab-btn {
    padding: 8px 18px; font-size: 13px; cursor: pointer;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted);
    background: none;
    transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===================================
   弹窗组件
   =================================== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 24px;
}

@supports (backdrop-filter: blur(2px)) {
    .modal-overlay { backdrop-filter: blur(4px); }
}

.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 480px;
    max-height: calc(100vh - 48px); overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease;
}

.modal-overlay.show .modal { transform: translateY(0) scale(1); opacity: 1; }

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 16px; font-weight: 700; color: var(--color-text);
    letter-spacing: -0.2px;
}

.modal-close {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-bg); color: var(--color-text-muted);
    border-radius: 50%; cursor: pointer;
    font-size: 18px; transition: all 0.2s ease;
}

.modal-close:hover { background: #FEE2E2; color: var(--color-danger); }

.modal-body {
    padding: 24px; overflow-y: auto; flex: 1;
}

.modal-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 10px; padding: 14px 24px;
    border-top: 1px solid var(--color-border);
    background: #FAFBFC; flex-shrink: 0;
}

.modal-footer .btn { min-width: 80px; }

/* ---------- 弹窗内表单 ---------- */
.modal-body .form-item { margin-bottom: 18px; }
.modal-body .form-item:last-child { margin-bottom: 0; }

.modal-body .form-item label {
    font-size: 13px; font-weight: 600; color: var(--color-text);
    margin-bottom: 6px; display: block;
}

.modal-body .form-input,
.modal-body .form-select {
    height: 40px; padding: 0 14px; font-size: 14px;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    background: var(--color-bg); width: 100%;
}

.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body input[type="email"],
.modal-body input[type="number"],
.modal-body input:not([type]) {
    height: 40px; padding: 0 14px; font-size: 14px; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    outline: none; color: var(--color-text); background: var(--color-bg);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.modal-body input[type="text"]:hover,
.modal-body input[type="password"]:hover,
.modal-body input[type="email"]:hover,
.modal-body input[type="number"]:hover,
.modal-body input:not([type]):hover {
    border-color: #CBD5E1; background: var(--color-surface);
}

.modal-body input[type="text"]:focus,
.modal-body input[type="password"]:focus,
.modal-body input[type="email"]:focus,
.modal-body input[type="number"]:focus,
.modal-body input:not([type]):focus {
    border-color: var(--color-primary); background: var(--color-surface);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
    outline: none;
}

.modal-body input[type="text"]::placeholder,
.modal-body input[type="password"]::placeholder,
.modal-body input[type="email"]::placeholder,
.modal-body input[type="number"]::placeholder,
.modal-body input:not([type])::placeholder {
    color: var(--color-text-muted); opacity: 1;
}

.modal-body .form-input:hover,
.modal-body .form-select:hover { border-color: #CBD5E1; background: var(--color-surface); }

.modal-body .form-input:focus,
.modal-body .form-select:focus {
    border-color: var(--color-primary); background: var(--color-surface);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
    outline: none;
}

.modal-body textarea {
    width: 100%; padding: 10px 14px; font-size: 14px; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    color: var(--color-text); background: var(--color-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical; min-height: 90px; outline: none;
}

.modal-body textarea:hover { border-color: #CBD5E1; background: var(--color-surface); }
.modal-body textarea:focus {
    border-color: var(--color-primary); background: var(--color-surface);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.modal-body .required { color: var(--color-danger); margin-left: 2px; font-weight: 400; }

.modal-body .radio-group { display: flex; gap: 12px; }

.modal-body .radio {
    padding: 6px 14px;
}

.modal-body .radio:hover { border-color: #CBD5E1; background: var(--color-surface); }

.modal-body .radio:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
    color: var(--color-primary);
}

.modal-body .radio input {
    position: relative; opacity: 1; width: 16px; height: 16px;
    accent-color: var(--color-primary); cursor: pointer; pointer-events: auto;
}

.modal-body .radio::before { display: none; }

/* ---------- 弹窗尺寸 ---------- */
.modal-sm { max-width: 440px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 750px; }
.modal-wide { max-width: 805px; }
.modal-game { max-width: 450px; }
.modal-audit { max-width: 520px; }

/* ---------- 发放参考弹窗 ---------- */
.calc-ref-empty {
    text-align: center; padding: 28px 20px; color: var(--color-text-muted);
    font-size: 13px; background: var(--color-bg); border-radius: var(--radius);
}

.calc-ref-error {
    text-align: center; padding: 16px; color: var(--color-danger);
    font-size: 13px; background: var(--color-danger-bg); border-radius: var(--radius-sm);
}

.calc-ref-summary {
    display: flex; gap: 24px; margin-bottom: 16px;
    padding: 14px 18px; background: #F8FAFC;
    border: 1px solid var(--color-border); border-radius: var(--radius);
}

.calc-ref-summary-item {
    display: flex; flex-direction: column; gap: 4px;
}

.calc-ref-label {
    font-size: 11px; font-weight: 500; color: var(--color-text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.calc-ref-value {
    font-size: 14px; font-weight: 600; color: var(--color-text);
}

.calc-ref-highlight {
    color: var(--color-primary); font-size: 16px; font-weight: 700;
}

.calc-ref-zero {
    color: var(--color-danger); font-weight: 600;
}

/* ---------- 通知推送列表 ---------- */
.push-item {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px; cursor: pointer;
    border-bottom: 1px solid var(--color-border-light);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.push-item:last-child { border-bottom: none; }

.push-item:hover {
    background: #F8FAFC;
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.push-item-icon {
    flex-shrink: 0;
    width: 42px; height: 42px; border-radius: var(--radius);
    background: var(--color-primary-bg); color: var(--color-primary);
    display: flex; align-items: center; justify-content: center;
}

.push-item-body { flex: 1; min-width: 0; }

.push-item-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 8px;
}

.push-item-title {
    font-size: 14px; font-weight: 600; color: var(--color-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.3;
}

.push-item-num {
    font-size: 11px; color: var(--color-text-muted);
    font-weight: 500; flex-shrink: 0;
}

.push-item-meta {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}

.push-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 100px;
    font-size: 11px; font-weight: 500; white-space: nowrap;
    line-height: 1;
}

.push-tag-scope {
    background: #EFF6FF; color: #3B82F6;
}

.push-tag-threshold {
    background: #FEF3C7; color: #D97706;
}

.push-tag-muted {
    background: #F1F5F9; color: #94A3B8;
}

.push-tag-manual {
    background: #FEF3C7; color: #D97706;
}

.push-send-header { display: flex; align-items: center; gap: 12px; }
.push-send-icon {
    width: 42px; height: 42px; border-radius: var(--radius);
    background: var(--color-primary-bg); color: var(--color-primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.push-send-desc { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

.push-send-form { padding: 0 6px; }
.push-send-form .form-item { margin-bottom: 16px; }
.push-send-form .form-select { width: 100%; height: 38px; font-size: 14px; background: var(--color-bg); }
.push-send-textarea {
    width: 100%; min-height: 90px; padding: 10px 12px;
    font-size: 14px; font-family: inherit;
    border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    outline: none; color: var(--color-text); background: var(--color-bg);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    resize: vertical;
}
.push-send-textarea::placeholder { color: var(--color-text-muted); opacity: 1; }
.push-send-textarea:hover { border-color: #CBD5E1; background: var(--color-surface); }
.push-send-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
    background: var(--color-surface);
}
.push-send-row { display: flex; gap: 16px; }

.push-send-actions {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 4px;
}
.push-send-hint { font-size: 12px; color: var(--color-text-muted); }
.push-send-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 20px; font-size: 14px; }

.push-item-action { flex-shrink: 0; }

.push-item-unread {
    background: #F0F4FF;
}

.push-item-unread:hover {
    background: #E6ECFE;
    box-shadow: inset 3px 0 0 var(--color-primary);
}

.push-item-preview {
    font-size: 12px; color: var(--color-text-muted);
    margin-bottom: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.push-time {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; color: var(--color-text-muted);
    white-space: nowrap;
}

.push-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: #CBD5E1; flex-shrink: 0;
}

.push-dot-unread {
    background: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.2);
}

.push-empty-state {
    text-align: center; padding: 48px 20px;
    color: var(--color-text-muted); font-size: 14px;
}

.push-empty-state svg {
    margin-bottom: 12px; color: var(--color-text-muted); opacity: 0.4;
}

.push-empty-state p { margin-top: 8px; }

/* ===================================
   消息列表 (todolist) - 紧凑布局
   =================================== */
.msg-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border-light);
    transition: background 0.12s ease;
}

.msg-row:last-child { border-bottom: none; }

.msg-row:hover { background: #F8FAFC; }

.msg-row-unread { background: #F0F4FF; }

.msg-row-unread:hover { background: #E6ECFE; }

.msg-dot {
    flex-shrink: 0;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--color-primary);
    margin-right: 2px;
}

.msg-dot-read { background: transparent; }

.msg-row-body { flex: 1; min-width: 0; }

.msg-row-top {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.msg-row-title {
    font-size: 14px; font-weight: 500; color: var(--color-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.4;
}

.msg-row-title-bold { font-weight: 700; }

.msg-row-preview {
    font-size: 12px; color: var(--color-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.4; padding-left: 17px;
}

.msg-row-right {
    flex-shrink: 0;
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 4px;
}

.msg-row-time {
    font-size: 11px; color: var(--color-text-muted);
    white-space: nowrap;
}

.btn-handle {
    padding: 2px 10px;
    font-size: 12px;
    border-radius: 4px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.6;
}

.btn-handle:hover { background: #4338CA; }

.btn-xs {
    padding: 2px 8px; font-size: 12px; border-radius: 4px;
    border: 1px solid var(--color-border);
    background: #fff; color: var(--color-text);
    cursor: pointer; white-space: nowrap;
}

/* ===================================
   登录页
   =================================== */
.login-body {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #F1F5F9 100%);
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
}

.login-wrapper {
    width: 100%; max-width: 420px; padding: 24px;
}

.login-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 40px 36px 32px;
    box-shadow: var(--shadow-lg);
}

.login-card h2 {
    font-size: 22px; font-weight: 700; color: var(--color-text);
    text-align: center; margin-bottom: 4px;
}

.login-card .subtitle {
    font-size: 14px; color: var(--color-text-muted);
    text-align: center; margin-bottom: 32px;
}

.form-field { margin-bottom: 20px; }

.form-field label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--color-text); margin-bottom: 8px;
}

.form-input-login {
    width: 100%; height: 44px; padding: 0 16px;
    font-size: 14px; font-family: inherit;
    color: var(--color-text); background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input-login::placeholder { color: var(--color-text-muted); opacity: 1; }
.form-input-login:hover { border-color: #CBD5E1; background: var(--color-surface); }
.form-input-login:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-bg);
    background: var(--color-surface);
}

.btn-login {
    width: 100%; height: 48px;
    background: linear-gradient(135deg, var(--color-primary), #6366F1);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 17px; font-weight: 700; font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-login:hover { background: linear-gradient(135deg, var(--color-primary-hover), #4F46E5); box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45); }
.btn-login:active { transform: scale(0.98); }

.field-error {
    font-size: 12px; color: var(--color-danger);
    margin-top: 6px; display: none;
}
.field-error.show { display: block; }

.login-footer {
    text-align: center; margin-top: 24px;
    font-size: 13px; color: var(--color-text-muted);
}

.error-message {
    display: none; padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 13px; margin-bottom: 16px;
    background: var(--color-danger-bg); color: var(--color-danger);
}
.error-message.show { display: flex; align-items: flex-start; gap: 8px; }

/* ===================================
   Toast 通知
   =================================== */
.toast {
    position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
    z-index: 9999; padding: 12px 24px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500;
    animation: toastIn 0.3s ease;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast.success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.toast.error   { background: var(--color-danger-bg); color: #991B1B; border: 1px solid #FECACA; }

/* ===================================
   头像
   =================================== */
.avatar-lg {
    width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; font-weight: 700;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.avatar-primary { background: var(--color-primary); color: #fff; }

/* ---------- 管理账号页 ---------- */
.account-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
    align-items: start;
}

.account-avatar-section {
    position: relative; display: inline-block;
    border-radius: 50%; overflow: hidden;
}

.account-avatar-img {
    width: 120px; height: 120px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--color-bg);
}

.account-avatar-img img { width: 100%; height: 100%; object-fit: cover; }

.account-avatar-text {
    width: 120px; height: 120px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), #6366F1);
    color: #fff; font-size: 42px; font-weight: 700;
}

.account-avatar-mask {
    position: absolute; inset: 0; border-radius: 50%;
    background: rgba(0,0,0,0.45);
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 6px;
    color: #fff; font-size: 12px; font-weight: 500;
    opacity: 0; cursor: pointer;
    transition: opacity 0.2s ease;
}

.account-avatar-section:hover .account-avatar-mask { opacity: 1; }

.account-user-name {
    font-size: 18px; font-weight: 600; color: var(--color-text);
    margin-top: 16px;
}

.account-user-role {
    display: inline-block; margin-top: 6px;
    padding: 3px 12px; border-radius: 100px;
    font-size: 12px; font-weight: 500;
    background: var(--color-primary-bg); color: var(--color-primary);
}

.toast-inline {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
}

.toast-inline.success { background: #DCFCE7; color: #166534; }
.toast-inline.error   { background: var(--color-danger-bg); color: #991B1B; }
.toast-inline.loading { background: var(--color-info-bg); color: var(--color-info); }

/* ===================================
   滚动条
   =================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ===================================
   开关切换
   =================================== */
.switch-wrap { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; vertical-align: middle; }
.switch-input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #CBD5E1; border-radius: 12px; transition: .2s; }
.switch-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch-input:checked + .switch-slider { background: var(--color-primary); }
.switch-input:checked + .switch-slider::before { transform: translateX(20px); }

/* ===================================
   响应式 - 平板 (≤1400px)
   =================================== */
@media (max-width: 1400px) {
    .stat-row, .order-stats-bar { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}

@media (max-width: 1200px) {
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .order-stats-bar { grid-template-columns: repeat(2, 1fr); }
}

/* ===================================
   响应式 - 手机端 (≤768px)
   =================================== */
@media (max-width: 768px) {
    /* ----- 侧边栏汉堡菜单模式 ----- */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
        pointer-events: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.25);
        pointer-events: auto;
    }
    .sidebar-overlay {
        display: none;
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.4); z-index: 99;
    }
    .sidebar-overlay.show { display: block; }
    body.sidebar-open { overflow: hidden; }
    .main-wrap { margin-left: 0; }
    .hamburger-btn {
        display: flex;
        align-items: center; justify-content: center;
        width: 36px; height: 36px; padding: 0;
        background: none; border: none; cursor: pointer;
        color: var(--color-text); border-radius: var(--radius-sm);
        flex-shrink: 0;
    }
    .hamburger-btn:hover { background: var(--color-bg); }

    /* ----- 页头单行紧凑布局 ----- */
    .page-header {
        flex-direction: row; align-items: center;
        gap: 6px; padding: 8px 12px; flex-wrap: nowrap;
    }
    .header-left {
        flex: 1 1 auto; min-width: 0; gap: 6px; flex-wrap: nowrap;
    }
    .header-dept-selector { flex: 0 1 auto; min-width: 0; max-width: 120px; }
    .header-dept-selector select,
    .header-dept-sel {
        max-width: 100%; min-width: 0; width: 100%;
        font-size: 11px; height: 30px; padding: 0 4px;
    }
    .header-search {
        flex: 1 1 0; min-width: 60px; width: auto; max-width: none;
    }
    .header-search-input { font-size: 12px; height: 30px; width: 100%; }
    .header-search-btn { width: 30px; height: 30px; flex-shrink: 0; }
    .header-user {
        flex-shrink: 0; gap: 4px; margin-left: auto;
    }
    .header-bell { padding: 4px; }
    .user-avatar { width: 30px; height: 30px; font-size: 13px; }
    .page-content { padding: 10px 12px 12px; }
    .page-title { font-size: 16px; }

    /* ----- 统计卡片 ----- */
    .stat-row, .order-stats-bar {
        grid-template-columns: repeat(2, 1fr); gap: 10px;
    }
    .dash-card {
        padding: 14px 12px; border-radius: 8px;
    }
    .dash-value { font-size: 22px; }
    .dash-label { font-size: 11px; }

    /* ----- 筛选区域紧凑布局 ----- */
    .dash-filter {
        flex-wrap: wrap; gap: 6px; align-items: center;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        padding: 10px 12px;
        margin-bottom: 16px;
    }
    .dash-filter .filter-divider { display: none; }
    .dash-filter .btn-date {
        padding: 3px 8px; font-size: 11px;
    }
    .dash-filter .date-input {
        width: auto; font-size: 12px; max-width: 110px; min-width: 80px;
    }
    /* 日期标签和按钮超出时水平滚动 */
    .dash-filter .filter-group {
        flex-wrap: nowrap; overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
    }
    .dash-filter .form-select-sm {
        height: 30px; font-size: 11px; min-width: auto; max-width: 110px;
    }
    .dash-filter .btn { height: 30px; font-size: 11px; padding: 0 12px; flex-shrink: 0; }
    .page-filter {
        flex-wrap: wrap; gap: 6px; align-items: center;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        padding: 10px 12px;
        margin-bottom: 14px;
    }
    .page-filter > div:first-child {
        flex-wrap: wrap; gap: 6px; display: flex;
    }
    .page-filter .form-input,
    .page-filter .form-select {
        flex: 0 1 auto; min-width: 0; font-size: 12px; height: 32px;
        max-width: 130px;
    }
    .page-filter .btn { height: 32px; font-size: 12px; padding: 4px 12px; flex-shrink: 0; }
    .perf-filter {
        flex-direction: column; align-items: stretch; gap: 8px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        padding: 10px 12px;
        margin-bottom: 14px;
    }
    .perf-filter .perf-filter-row {
        flex-wrap: wrap; gap: 6px;
    }
    .perf-filter select, .perf-filter input {
        min-width: 0; font-size: 12px; height: 34px;
    }
    .perf-filter .btn { font-size: 12px; padding: 6px 14px; height: 34px; }

    /* ----- 表格 → 移动端卡片列表 ----- */
    .table-wrap {
        border: none; border-radius: 0; overflow: visible;
    }
    .table-wrap table { min-width: 0; display: block; }
    .table-wrap thead { display: none; }
    .table-wrap tbody { display: block; }
    .table-wrap tr {
        display: flex; flex-wrap: wrap; align-items: flex-start;
        padding: 14px 16px; border-bottom: 1px solid var(--color-border-light);
        position: relative; min-height: 52px;
    }
    .table-wrap tr:last-child { border-bottom: none; }
    .table-wrap tr:active { background: var(--color-bg); }
    .table-wrap td {
        display: flex; align-items: flex-start;
        padding: 4px 8px 4px 0; border-bottom: none;
        font-size: 13px; white-space: normal; word-break: break-word;
    }
    /* 主字段（第一列非序号） */
    .table-wrap td:nth-child(2) {
        width: 100%; font-size: 15px; font-weight: 600; color: var(--color-text);
        padding-bottom: 6px; order: -10;
    }
    /* 左区域：带标签的字段 */
    .table-wrap td::before {
        content: attr(data-label);
        font-size: 11px; color: var(--color-text-muted);
        margin-right: 6px; flex-shrink: 0; min-width: 52px;
    }
    /* 主字段不显示标签 */
    .table-wrap td:nth-child(2)::before { content: none; }
    /* 序号列隐藏 */
    .table-wrap td:first-child:not([data-label=""]) { display: none; }
    .table-wrap td[data-label="序号"] { display: none; }
    /* 状态/金额列靠右 */
    .table-wrap td:has(.player-status),
    .table-wrap td:has(.perf-channel) {
        order: 1;
    }
    /* 操作列独立一行 */
    .table-wrap td:has(.action-dropdown-wrapper),
    .table-wrap td:has(.action-toggle) {
        width: 100%; justify-content: flex-end; padding-top: 8px;
        border-top: 1px dashed var(--color-border-light); order: 10;
    }
    .table-wrap td:has(.action-dropdown-wrapper)::before,
    .table-wrap td:has(.action-toggle)::before { content: none; }
    /* 金额右对齐 */
    .table-wrap td[data-label*="充值"] {
        font-weight: 700; color: var(--color-primary);
    }
    /* 空状态居中 */
    .table-wrap .empty-state {
        text-align: center; padding: 32px 0; width: 100%;
    }

    /* ----- 移动端筛选工具栏（header下方） ----- */
    .mobile-filter-bar {
        display: none;
        align-items: center; gap: 8px; padding: 10px 12px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        margin: 10px 8px 10px;
    }
    .mobile-filter-bar.show { display: flex; }
    .mobile-filter-controls {
        flex: 1; display: flex; gap: 6px; min-width: 0;
    }
    .mobile-filter-controls select,
    .mobile-filter-controls input {
        flex: 1; min-width: 0; height: 36px; font-size: 13px;
        padding: 0 8px; border: 1px solid var(--color-border);
        border-radius: 6px; background: var(--color-bg);
        color: var(--color-text);
    }
    .mobile-filter-more {
        height: 36px; padding: 0 10px; font-size: 13px; flex-shrink: 0;
        border: none; border-radius: 6px; cursor: pointer;
        font-weight: 500; white-space: nowrap;
        background: #DC2626; color: #fff;
    }
    .mobile-filter-ok {
        height: 36px; padding: 0 14px; font-size: 13px; flex-shrink: 0;
    }

    /* ----- 内联筛选展开区 ----- */
    .mobile-filter-expand {
        display: none;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        border-top: none;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        padding: 14px 16px;
        margin: -8px 8px 10px;
    }
    .mobile-filter-expand.open { display: block; }
    .mobile-filter-expand-body .form-item { margin-bottom: 14px; }
    .mobile-filter-expand-body .form-item label {
        display: block; font-size: 13px; color: var(--color-text-secondary);
        margin-bottom: 6px; font-weight: 500;
    }
    .mobile-filter-expand-body .form-item select,
    .mobile-filter-expand-body .form-item input {
        width: 100%; height: 42px; font-size: 15px;
        border: 1px solid var(--color-border); border-radius: 8px;
        padding: 0 12px; background: var(--color-bg); box-sizing: border-box;
    }
    .mobile-filter-expand-body .btn-date {
        padding: 6px 12px; margin: 2px 4px 2px 0; font-size: 12px;
        border: 1px solid var(--color-border); border-radius: 6px;
        background: var(--color-bg); color: var(--color-text); cursor: pointer;
    }
    .mobile-filter-expand-body .btn-date.active {
        background: var(--color-primary); color: #fff; border-color: var(--color-primary);
    }
    .mobile-filter-expand-footer {
        display: flex; gap: 10px; margin-top: 12px; padding-top: 12px;
        border-top: 1px solid var(--color-border);
    }
    .mobile-filter-expand-footer .btn { flex: 1; height: 40px; font-size: 14px; font-weight: 600; border-radius: 8px; }

    /* 隐藏所有 PC 筛选栏 */
    .filter-bar { display: none !important; }
    .dash-filter { display: none !important; }
    .perf-date-bar { display: none !important; }
    .perf-filter { display: none !important; }
    .page-filter { display: none !important; }
    .order-date-bar { display: none !important; }

    /* ----- 分页紧凑 ----- */
    .pagination-wrap {
        flex-wrap: wrap; gap: 6px; padding: 10px 0;
        justify-content: center;
    }
    .pagination-wrap .form-select { height: 32px; font-size: 12px; min-width: 80px; }
    .pagination-wrap span { font-size: 12px; }
    .page-btn { padding: 5px 12px; font-size: 12px; height: 32px; }

    /* ----- 弹窗全屏 ----- */
    .modal-overlay { padding: 0; }

/* ----- 权限配置弹窗 ----- */
.perm-hint { font-size: 14px; color: #999; margin: 0 0 16px 0; }

#permMenuList {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 16px;
    row-gap: 12px;
}

.perm-card {
    display: flex; align-items: center; gap: 8px;
    padding: 12px;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    background: #fff;
    cursor: pointer; user-select: none;
    transition: border-color 0.2s, background 0.2s;
}
.perm-card:hover { border-color: #1890FF; }

.perm-card input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: #1890FF;
    flex-shrink: 0; margin: 0; cursor: pointer;
}

.perm-card span {
    font-size: 14px; color: #333;
    line-height: 1.3;
}

.perm-card.checked {
    border-color: #1890FF;
    background: #E6F7FF;
}
.perm-card.checked span { color: #1890FF; }

@media (max-width: 900px) {
    #permMenuList { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    #permMenuList { grid-template-columns: repeat(2, 1fr); }
}
    .modal {
        width: 100%; max-width: 100%;
        height: 100%; max-height: 100%;
        border-radius: 0; margin: 0;
    }
    .modal-header { padding: 14px 16px; }
    .modal-header h3 { font-size: 16px; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .modal-body .form-item label { font-size: 13px; }
    .modal-body .form-input,
    .modal-body .form-select,
    .modal-body input[type="text"],
    .modal-body input[type="password"],
    .modal-body input[type="number"] {
        height: 40px; font-size: 14px;
    }
    .modal-body textarea { font-size: 14px; }
    .modal-body .radio-group { gap: 8px; }

    /* ----- 筛选栏 ----- */
    .filter-bar {
        padding: 10px 12px; gap: 8px;
    }
    .filter-bar .form-input,
    .filter-bar .form-select {
        height: 34px; font-size: 12px; min-width: 0; flex: 1;
    }
    .form-row { gap: 6px; }

    /* ----- 表单 ----- */
    .form-item label { font-size: 13px; }
    .form-input, .form-select { font-size: 14px; height: 40px; max-width: none; }

    /* ----- 卡片 ----- */
    .card-body { padding: 12px; }

    /* ----- 账号/游戏网格 ----- */
    .account-grid { grid-template-columns: 1fr; }
}

/* ===================================
   响应式 - 小屏手机 (≤480px)
   =================================== */
@media (max-width: 480px) {
    .login-wrapper { max-width: 100%; padding: 16px; }
    .login-card { padding: 32px 20px 24px; box-shadow: none; }
    .login-body { background: var(--color-surface); }

    .stat-row, .order-stats-bar { grid-template-columns: 1fr; gap: 8px; }
    .page-header { padding: 10px 12px; }
    .page-content { padding: 10px 8px 8px; }

    .table-wrap tr { padding: 12px 14px; }
    .table-wrap td { font-size: 12px; padding: 3px 6px 3px 0; }

    .modal-header { padding: 10px 12px; }
    .modal-body { padding: 12px; }
    .modal-footer { padding: 10px 12px; }

    .page-btn { padding: 4px 10px; font-size: 11px; }
    .btn-sm { padding: 4px 10px; font-size: 11px; }
    .btn { font-size: 12px; padding: 6px 14px; }
}

/* ===== 通用 Tab 导航样式 ===== */
.ai-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--color-border); margin-bottom: 16px; }
.ai-tab { padding: 8px 18px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--color-text-muted); transition: color 0.15s, border-color 0.15s; }
.ai-tab:hover { color: var(--color-text); }
.ai-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

/* ===== 通用子Tab（附属Tab）样式 ===== */
.cs-subtab { padding: 8px 16px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--color-text-muted); display: inline-block; }
.cs-subtab:hover { color: var(--color-text); }
.cs-subtab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

/* ===================================
   聊天消息监控 - 专属样式
   =================================== */

/* ===== 登录页 ===== */
.login-body { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: var(--color-surface); border-radius: var(--radius-lg); padding: 40px 36px; box-shadow: var(--shadow-lg); text-align: center; }
.login-logo { width: 56px; height: 56px; margin: 0 auto 16px; background: linear-gradient(135deg, #4F46E5, #7C3AED); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; font-weight: 700; }
.login-title { font-size: 20px; font-weight: 700; color: var(--color-text); margin-bottom: 6px; }
.login-subtitle { font-size: 13px; color: var(--color-text-muted); margin-bottom: 28px; }
.login-form { text-align: left; }
.login-form .form-group { margin-bottom: 16px; }
.login-form .form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--color-text-secondary); margin-bottom: 6px; }
.login-form .form-input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 14px; background: var(--color-bg); color: var(--color-text); transition: border-color var(--transition); }
.login-form .form-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-bg); }
.login-btn { width: 100%; height: 44px; background: var(--color-primary); color: #fff; border: none; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; transition: background var(--transition); margin-top: 8px; }
.login-btn:hover { background: var(--color-primary-hover); }
.form-msg { margin-top: 12px; font-size: 13px; text-align: center; min-height: 20px; }
.form-msg.success { color: var(--color-success); }
.form-msg.error { color: var(--color-danger); }

/* ===== 监控页全屏布局 ===== */
.page-monitor .page-header { display: none; }
.page-monitor .main-wrap { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.page-monitor .page-content { flex: 1; padding: 0; overflow: hidden; min-height: 0; }

/* ===== 游戏色标签 ===== */
.tag-sm{display:inline-block;padding:1px 8px;border-radius:3px;font-size:11px;font-weight:500;line-height:20px;letter-spacing:.2px}
.tag-game-wzry{background:rgba(236,72,153,.1);color:#EC4899}
.tag-game-hpjy{background:rgba(16,185,129,.1);color:#10B981}
.tag-game-ys{background:rgba(59,130,246,.1);color:#3B82F6}
.tag-game-other{background:rgba(107,114,128,.1);color:#6B7280}
.tag-ch-world{background:rgba(59,130,246,.08);color:#3B82F6}
.tag-ch-guild{background:rgba(16,185,129,.08);color:#10B981}
.tag-ch-pm{background:rgba(139,92,246,.08);color:#8B5CF6}
.tag-ch-team{background:rgba(245,158,11,.08);color:#D97706}
.tag-ch-other{background:rgba(107,114,128,.08);color:#6B7280}
.tag-risk-h{background:rgba(239,68,68,.1);color:#EF4444;font-weight:600}
.tag-risk-l{background:rgba(245,158,11,.1);color:#D97706}
.tag-risk-n{background:rgba(16,185,129,.1);color:#10B981}

/* ===== Toast ===== */
.toast-container{position:fixed;top:20px;right:20px;z-index:10000;display:flex;flex-direction:column;gap:8px}
.toast{padding:12px 20px;border-radius:var(--radius);color:#fff;font-size:13px;font-weight:500;box-shadow:var(--shadow-lg);animation:toastIn .3s ease;max-width:380px}
.toast-success{background:var(--color-success)}
.toast-error{background:var(--color-danger)}
.toast-info{background:var(--color-info)}
@keyframes toastIn{from{opacity:0;transform:translateX(40px)}to{opacity:1;transform:translateX(0)}}
