* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* 侧边栏 */
    --sidebar-bg: #20222a;
    --sidebar-bg-hover: #2a2c37;
    --sidebar-bg-active: #3b82f6;
    --sidebar-text: #c9c9d1;
    --sidebar-text-active: #ffffff;
    --sidebar-border: #2d303a;
    --sidebar-width: 220px;

    /* 顶部栏 */
    --header-bg: #ffffff;
    --header-border: #e8e8e8;
    --header-height: 50px;

    /* 内容区 */
    --content-bg: #f2f2f2;
    --card-bg: #ffffff;
    --card-border: #e6e6e6;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --text-muted: #cccccc;

    /* 主色调 */
    --primary: #1e9fff;
    --primary-hover: #1890e8;
    --primary-light: #e6f7ff;
    --success: #5fb878;
    --success-light: #e8f7ed;
    --warning: #ffb800;
    --warning-light: #fff7e6;
    --danger: #ff5722;
    --danger-light: #fff1ee;
    --purple: #8b5cf6;
    --purple-light: #f3efff;

    --radius-sm: 2px;
    --radius: 4px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    background: var(--content-bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
}

/* ===== 整体布局 ===== */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #3a3d48; border-radius: 3px; }

.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-bottom: 1px solid var(--sidebar-border);
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: #1a1c23;
}
.sidebar-logo-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

.sidebar-user {
    padding: 16px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-balance {
    font-size: 12px;
    color: var(--warning);
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    border-left: 3px solid transparent;
    user-select: none;
}
.menu-item:hover {
    background: var(--sidebar-bg-hover);
    color: white;
}
.menu-item.active {
    background: var(--sidebar-bg-active);
    color: var(--sidebar-text-active);
    border-left-color: var(--primary);
}
.menu-item-icon {
    font-size: 16px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.menu-item-text { flex: 1; }

.menu-group-title {
    padding: 12px 20px 6px;
    font-size: 12px;
    color: #888;
    font-weight: 500;
    letter-spacing: 0.5px;
}

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

/* ===== 顶部栏 ===== */
.header {
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.breadcrumb {
    font-size: 13px;
    color: var(--text-secondary);
}
.breadcrumb span { color: var(--text-tertiary); }
.breadcrumb strong { color: var(--text-primary); font-weight: 500; }

.header-right { display: flex; align-items: center; gap: 16px; }
.header-link {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s;
}
.header-link:hover { color: var(--primary); }

/* ===== 内容区 ===== */
.content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 4px; }

/* ===== 卡片 ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}
.card-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-body { padding: 16px; }

/* ===== 统计卡片组 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: white;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-info { flex: 1; min-width: 0; }
.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ===== 表单 ===== */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}
.form-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-item.block {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
}
.form-label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 70px;
    text-align: right;
}
.form-item.block .form-label {
    text-align: left;
    min-width: auto;
    font-weight: 500;
    color: var(--text-primary);
}
.form-input, .form-select, .form-textarea {
    padding: 6px 10px;
    border: 1px solid #d2d2d2;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: white;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}
.form-input, .form-select { min-width: 180px; }
.form-textarea { width: 100%; min-height: 80px; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input[readonly] { background: #f5f5f5; cursor: default; }

.input-group {
    display: flex;
    gap: 6px;
}
.input-group .form-input { flex: 1; }

.form-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

/* ===== 按钮 ===== */
.btn {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    border: 1px solid #d2d2d2;
    background: white;
    color: var(--text-primary);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}
.btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
}
.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}
.btn-danger:hover {
    background: #e64d1e;
    border-color: #e64d1e;
    color: white;
}
.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-success:hover {
    background: #4ea868;
    border-color: #4ea868;
    color: white;
}
.btn-warm {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}
.btn-warm:hover {
    background: #e6a600;
    border-color: #e6a600;
    color: white;
}
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 8px 24px; font-size: 14px; }
.btn-block { width: 100%; }

/* ===== 号码展示区 ===== */
.phone-display-card {
    text-align: center;
    padding: 24px 20px;
}
.phone-number {
    font-size: 42px;
    font-weight: 700;
    font-family: 'SF Mono', 'Menlo', Consolas, monospace;
    color: var(--primary);
    letter-spacing: 2px;
    margin-bottom: 12px;
}
.phone-number.placeholder {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0;
}
.phone-info-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 16px;
}
.phone-info-item {
    text-align: center;
}
.phone-info-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}
.phone-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.phone-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: #f8f8f8;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
    font-size: 13px;
}
td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
tbody tr:hover { background: #fafafa; }
tbody tr:last-child td { border-bottom: none; }

.table-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafafa;
}
.table-info { font-size: 12px; color: var(--text-tertiary); }
.pagination {
    display: flex;
    gap: 4px;
}
.page-btn {
    min-width: 30px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #d2d2d2;
    background: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 标签 ===== */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 400;
}
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-gray { background: #f0f0f0; color: #666; }
.tag-purple { background: var(--purple-light); color: var(--purple); }

.code-text {
    font-family: 'SF Mono', Consolas, monospace;
    font-weight: 700;
    font-size: 15px;
    color: var(--primary);
    letter-spacing: 2px;
}

.copy-btn {
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
}
.copy-btn:hover { text-decoration: underline; }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-tertiary);
}
.empty-state svg { display: block; margin: 0 auto 12px; opacity: 0.85; }
.empty-icon { font-size: 40px; margin-bottom: 10px; opacity: 0.5; }
.empty-title { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }
.empty-desc { font-size: 12px; color: var(--text-muted); }

/* ===== 表格加载 ===== */
.table-loading-box {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 40px 0; color: var(--text-tertiary); font-size: 13px;
}
.spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #e5e7eb;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 表单校验反馈 ===== */
.field-error { color: var(--danger); font-size: 12px; margin-top: 6px; min-height: 16px; line-height: 1.4; }
.form-input.input-error, .form-control.input-error { border-color: var(--danger) !important; }
.form-input.input-ok, .form-control.input-ok { border-color: var(--success) !important; }

/* ===== 通用确认弹窗（替代原生 confirm，嵌入式浏览器会屏蔽原生弹窗） ===== */
.modal-mask {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-mask.show { display: flex; }
.confirm-modal {
    background: #fff; border-radius: 8px; width: 360px; max-width: calc(100vw - 48px);
    padding: 20px; box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    animation: modalIn 0.15s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
.confirm-modal-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.confirm-modal-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 18px; word-break: break-all; }
.confirm-modal-actions { display: flex; gap: 10px; }
.confirm-modal-actions .btn { flex: 1; }

/* ===== 提示条 ===== */
.notice-bar {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #d48806;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 16px;
}
.notice-bar strong { color: #d48806; }

/* ===== 个人信息 ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 0 16px;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 600;
    flex-shrink: 0;
}
.profile-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}
.profile-info p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}
.profile-balance {
    font-size: 24px;
    font-weight: 700;
    color: var(--success);
}

/* ===== 充值金额选择 ===== */
.amount-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.amount-item {
    border: 2px solid #e6e6e6;
    border-radius: var(--radius);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
}
.amount-item:hover {
    border-color: var(--primary);
}
.amount-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
}
.amount-item-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 4px;
}
.amount-item.active .amount-item-price { color: var(--primary); }
.amount-item-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

.payment-methods {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.payment-method {
    flex: 1;
    border: 2px solid #e6e6e6;
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
}
.payment-method:hover { border-color: var(--primary); }
.payment-method.active { border-color: var(--primary); background: var(--primary-light); }
.payment-method-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}
.payment-method-icon.alipay { background: #1677ff; }
.payment-method-icon.wechat { background: #07c160; }
.payment-method-info { flex: 1; }
.payment-method-name { font-size: 14px; font-weight: 500; }
.payment-method-desc { font-size: 12px; color: var(--text-tertiary); }

.qrcode-box {
    text-align: center;
    padding: 20px;
}
.qrcode {
    width: 180px;
    height: 180px;
    border: 1px solid #e6e6e6;
    border-radius: var(--radius);
    margin: 0 auto 12px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

/* ===== 卡密套餐 ===== */
.card-packages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.package-card {
    border: 2px solid #e6e6e6;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    position: relative;
}
.package-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.package-card.active {
    border-color: var(--primary);
    background: linear-gradient(180deg, var(--primary-light) 0%, white 30%);
}
.package-card.hot::before {
    content: '热销';
    position: absolute;
    top: 10px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 2px;
}
.package-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}
.package-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}
.package-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 4px;
}
.package-price small { font-size: 14px; font-weight: 400; }
.package-original {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-bottom: 16px;
}
.package-features {
    text-align: left;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 2;
}
.package-features li {
    list-style: none;
    padding-left: 18px;
    position: relative;
}
.package-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

/* ===== 群聊 ===== */
.group-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.group-card {
    text-align: center;
    padding: 30px 20px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: white;
}
.group-qrcode {
    width: 160px;
    height: 160px;
    border: 1px solid #e6e6e6;
    border-radius: var(--radius);
    margin: 0 auto 16px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}
.group-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}
.group-id {
    font-family: monospace;
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 12px;
    background: var(--primary-light);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    display: inline-block;
}
.group-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

/* ===== 文档 ===== */
.doc-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: white;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 12px 0;
    position: sticky;
    top: 0;
}
.doc-menu-item {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.doc-menu-item:hover { background: #f5f5f5; color: var(--text-primary); }
.doc-menu-item.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: var(--primary-light);
    font-weight: 500;
}
.doc-content {
    flex: 1;
    min-width: 0;
    background: white;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
}
.doc-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
}
.doc-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 20px 0 10px;
    color: var(--text-primary);
}
.doc-content p {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.doc-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 2px;
    font-family: Consolas, monospace;
    font-size: 12px;
    color: var(--danger);
}
.doc-content pre {
    background: #2d2d2d;
    color: #ccc;
    padding: 16px;
    border-radius: var(--radius);
    font-family: Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    margin-bottom: 16px;
}
.doc-content table {
    margin-bottom: 16px;
}
.doc-content .doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.doc-content .doc-table th,
.doc-content .doc-table td {
    border: 1px solid var(--card-border, #e5e7eb);
    padding: 8px 12px;
    text-align: left;
}
.doc-content .doc-table th {
    background: #f8f9fa;
    font-weight: 600;
}
.doc-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* ===== Toast ===== */
#toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    border-radius: 4px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
}

/* ===== 页面显示控制 ===== */
.page-content { display: none; }
.page-content.active { display: block; }

/* ===== 移动端侧边栏抽屉 ===== */
.menu-toggle {
    display: none;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: var(--card-bg);
    user-select: none;
    flex-shrink: 0;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
}

/* 响应式 */
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .amount-grid { grid-template-columns: 1fr 1fr 1fr; }
    .card-packages { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .menu-toggle { display: flex; }
    .header-left { gap: 10px; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .amount-grid { grid-template-columns: 1fr 1fr; }
    .card-packages { grid-template-columns: 1fr; }
    .group-cards { grid-template-columns: 1fr; }
    .form-cols { grid-template-columns: 1fr; }
    .phone-info-row { gap: 16px; flex-wrap: wrap; }
    .doc-layout { flex-direction: column; }
    .doc-sidebar { width: 100%; position: static; }
    .header-right .header-link { font-size: 12px; }
    .content { padding: 12px; }
    .card { border-radius: 6px; }
}

/* ===== 工单 ===== */
.menu-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.ticket-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.ticket-tab {
    padding: 6px 14px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.ticket-tab:hover { border-color: var(--primary); color: var(--primary); }
.ticket-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.ticket-tab span { opacity: 0.75; font-size: 12px; }

.chat-msg { display: flex; margin-bottom: 16px; }
.chat-msg.me { justify-content: flex-end; }
.chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-msg.me .chat-bubble {
    background: var(--primary);
    color: white;
    border-top-right-radius: 2px;
}
.chat-msg.other .chat-bubble {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top-left-radius: 2px;
}
.chat-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-align: inherit;
}
.chat-msg.me .chat-meta { text-align: right; }
.chat-first {
    max-width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--primary);
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}