/* ===========================================
   上海老板电器全域AI服务中台 - 全局样式
   品牌色：深蓝 #0A1F44 + 金色 #C8A876 + 科技感渐变
   =========================================== */

:root {
    --brand-primary: #2563EB;
    --brand-primary-dark: #1D4ED8;
    --brand-primary-light: #3B82F6;
    --brand-gold: #C8A876;
    --brand-gold-dark: #1D4ED8;
    --brand-accent: #4A90E2;
    --brand-success: #2EC4B6;
    --brand-warning: #FF9F1C;
    --brand-danger: #E71D36;
    --bg-primary: #F5F7FB;
    --bg-card: #FFFFFF;
    --bg-dark: #0A1F44;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --border-color: #E5E7EB;
    --shadow-sm: 0 2px 8px rgba(10, 31, 68, 0.06);
    --shadow-md: 0 8px 24px rgba(10, 31, 68, 0.10);
    --shadow-lg: 0 16px 48px rgba(10, 31, 68, 0.16);
    --shadow-gold: 0 8px 24px rgba(200, 168, 118, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* ==================== v3.0 全局基础规范 ==================== */
/* 全站禁止文字下划线（链接、按钮等一律无下划线） */
a, a:hover, a:visited, a:active, .role-tag, button, .btn, .header-chip,
.menu-item, .course-card, .quick-card, .todo-row, .rel-course, .entry-item {
    text-decoration: none !important;
}

/* V4.0：不再用 body{overflow-x:hidden} 掩盖溢出问题。
   溢出必须在源头修复（见 theme-v4.css 第 02 节），验收脚本会逐页检测元素越界。 */

/* v3.1 手机深度适配：消除双击缩放延迟 / iOS 长按选中
   重要（v3.2 修复）：绝不在 body 上全局禁用 user-select 与限制 touch-action。
   iOS Safari / 微信 X5 内核下，body 上的 -webkit-user-select:none 会阻断
   input/textarea 的聚焦与软键盘唤起（子元素即便声明 user-select:text 也可能失效），
   这正是「AI 无法打字输入」的根因。改为只对装饰性元素单独禁用选中。 */
button, .btn, .menu-item, .role-tag, .ai-fab, .header-chip,
.stat-label, .card-title, .panel-title, .modal-title, .pager-info,
.auth-demo summary, .table-pager button, .icon-btn {
    -webkit-user-select: none; user-select: none;
    touch-action: manipulation;
}
/* 输入类元素：确保 iOS/Android 可聚焦、可长按粘贴、可唤起软键盘 */
input, textarea, select, [contenteditable] {
    -webkit-user-select: text !important; user-select: text !important;
    touch-action: auto !important;
    -webkit-appearance: none; appearance: none;
}

/* v3.2 关键修复：iOS Safari 在输入框字号 <16px 时会自动放大整个页面，
   导致「点输入框→页面炸开→看起来没法输入/很乱」。
   手机端统一提到 16px（iOS 安全阈值），桌面端保持原设计字号 */
@media (max-width: 767px) {
    input, textarea, select,
    .ai-input-wrap input, .ai-input-wrap textarea,
    .ai-input-row input, .ai-assistant-foot input,
    .form-group input, .form-item input, .login-card input,
    .code-row input, .modal-body input, .modal-body textarea {
        font-size: 16px !important;
    }
}

/* v3.1 弹窗 / AI 面板打开时锁定背景滚动（防滚动穿透与底部空白） */
html.modal-lock { overflow: hidden; }
body.sidebar-open { overflow: hidden; }   /* v3.1 抽屉打开时锁定背景 */

/* 图片永不撑破容器 */
img, video, canvas, svg { max-width: 100%; }

/* 长单词/长链接自动换行，不撑破单元格 */
.data-table td, .ai-bubble, .panel-body { word-break: break-word; overflow-wrap: anywhere; }

/* V4.0：表格统一由 .tbl-box / .table-scroll 容器承担横向滚动，
   表格保持原生 table 布局（theme-v4.css 第 06 节）。 */

/* ==================== 登录页 ==================== */
.login-container {
    min-height: 100vh;
    min-height: 100dvh;   /* v3.1 手机地址栏动态视口 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0A1F44 0%, #1A3060 50%, #0A1F44 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(200, 168, 118, 0.15), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(74, 144, 226, 0.15), transparent 50%);
    animation: floatGlow 8s ease-in-out infinite;
}

@keyframes floatGlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 20px) scale(1.1); }
}

.login-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(200, 168, 118, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 168, 118, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 440px;
    box-shadow: var(--shadow-lg);
    animation: cardEnter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo h1 {
    font-size: 28px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: 1px;
}

.login-logo .subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 8px;
    letter-spacing: 2px;
}

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.login-tabs .tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.login-tabs .tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-gold);
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

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

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
    background: #FAFAFA;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: #FFF;
    box-shadow: 0 0 0 4px rgba(10, 31, 68, 0.08);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(200, 168, 118, 0.3), transparent);
    transition: left 0.6s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover::before {
    left: 100%;
}

.login-tips {
    margin-top: 24px;
    padding: 16px;
    background: rgba(10, 31, 68, 0.04);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.login-tips .label {
    color: var(--brand-primary);
    font-weight: 600;
    margin-bottom: 4px;
}

/* ==================== 工作台通用布局 ==================== */
.app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 1fr;
    grid-template-areas:
        "sidebar header"
        "sidebar main";
    min-height: 100vh;
    min-height: 100dvh;   /* v3.1 手机地址栏动态视口 */
}

.app-header {
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    height: 64px;
    background: #fff;
    grid-area: header;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-header .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-gold));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
}

.app-header .logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-primary);
}

.app-header .role-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
}

.role-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.role-tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.role-tag.active {
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
    color: #fff;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.user-avatar:hover {
    background: var(--bg-primary);
}

.user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar .avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
}

.app-sidebar {
    grid-area: sidebar;
    background: linear-gradient(180deg, var(--brand-primary), var(--brand-primary-dark));
    color: #fff;
    padding: 20px 0;
    overflow-y: auto;
}

.app-sidebar .menu {
    list-style: none;
}

.app-sidebar .menu-item {
    padding: 12px 24px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    border-left: 3px solid transparent;
    position: relative;
}

.app-sidebar .menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.app-sidebar .menu-item.active {
    background: rgba(200, 168, 118, 0.1);
    color: var(--brand-gold);
    border-left-color: var(--brand-gold);
}

.app-sidebar .menu-item .icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.app-sidebar .menu-group {
    padding: 12px 24px 8px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 16px;
}

.app-main {
    margin-top: 64px;
    grid-area: main;
    padding: 24px 24px 40px; /* v3.1：收紧底部留白，滚动到底不再出现大片空白 */
    overflow-y: auto;
    overscroll-behavior-y: contain;   /* v3.1：滚动到底不牵动整页 / iOS 橡皮筋 */
    background: var(--bg-primary);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 8px;
}

.page-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
}

/* ==================== 卡片 ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--brand-gold), var(--brand-gold-dark));
    border-radius: 2px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ==================== 统计卡片 ==================== */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--brand-gold), transparent);
    opacity: 0.1;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card .label {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-primary);
    line-height: 1.2;
}

.stat-card .delta {
    font-size: 12px;
    margin-top: 8px;
    color: var(--brand-success);
}

.stat-card .delta.down {
    color: var(--brand-danger);
}

.stat-card .icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

/* ==================== 按钮 ==================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F3F4F6;
    color: var(--text-primary);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-gold {
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
    color: #fff;
}

.btn-primary-solid {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: #fff;
}

.btn-danger {
    background: var(--brand-danger);
    color: #fff;
}

.btn-success {
    background: var(--brand-success);
    color: #fff;
}

/* ==================== AI 输入框 ==================== */
.ai-panel {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    border-radius: var(--radius-lg);
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.ai-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(200, 168, 118, 0.2), transparent 40%);
}

.ai-panel .ai-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.ai-panel .ai-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.ai-panel .ai-title {
    font-size: 16px;
    font-weight: 600;
}

.ai-panel .ai-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.ai-input-wrap {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.ai-input-wrap input, .ai-input-wrap textarea {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 14px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.ai-input-wrap input::placeholder, .ai-input-wrap textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.ai-input-wrap input:focus, .ai-input-wrap textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--brand-gold);
}

.ai-input-wrap button {
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.ai-input-wrap button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-gold);
}

.ai-result {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    min-height: 100px;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.8;
    font-size: 14px;
    max-height: 600px;
    overflow-y: auto;
}

.ai-result:empty::before {
    content: '🤖 AI 思考中...';
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.ai-result table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.ai-result table th, .ai-result table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    text-align: left;
    font-size: 13px;
}

.ai-result table th {
    background: rgba(200, 168, 118, 0.15);
    font-weight: 600;
}

.ai-result strong {
    color: var(--brand-gold);
    font-weight: 700;
}

/* ==================== 标签 ==================== */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.tag-primary { background: rgba(10, 31, 68, 0.1); color: var(--brand-primary); }
.tag-gold { background: rgba(200, 168, 118, 0.15); color: #2563EB; }
.tag-success { background: rgba(46, 196, 182, 0.15); color: var(--brand-success); }
.tag-warning { background: rgba(255, 159, 28, 0.15); color: var(--brand-warning); }
.tag-danger { background: rgba(231, 29, 54, 0.15); color: var(--brand-danger); }

/* ==================== 表格 ==================== */
table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table thead {
    background: var(--bg-primary);
}

table.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

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

table.data-table tbody tr:hover {
    background: var(--bg-primary);
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 14px 24px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

.toast.success { border-left: 4px solid var(--brand-success); }
.toast.error { border-left: 4px solid var(--brand-danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== Modal ==================== */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(10, 31, 68, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    animation: cardEnter 0.4s;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    transition: var(--transition);
}

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

/* ==================== 工作台快捷卡片 ==================== */
.quick-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.quick-card::after {
    content: '→';
    position: absolute;
    right: 20px;
    bottom: 16px;
    font-size: 24px;
    color: var(--brand-gold);
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
}

.quick-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.quick-card:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.quick-card .icon-circle {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.quick-card .title {
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-primary);
    margin-bottom: 6px;
}

.quick-card .desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main";
    }
    .app-sidebar { display: none; }
    .grid-cols-4, .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
    .app-main {
    margin-top: 64px; padding: 16px; }
    .login-card { width: 92%; padding: 32px; }
}

/* ==================== Loading ==================== */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--brand-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dots span {
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dots span:nth-child(1) { animation-delay: -0.32s; }
.dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ==================== 进度条 ==================== */
.progress {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-gold));
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ==================== 步骤条 ==================== */
.steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
}

.step:last-child::after {
    display: none;
}

.step .circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.step.done .circle {
    background: var(--brand-success);
    border-color: var(--brand-success);
    color: #fff;
}

.step.doing .circle {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: #fff;
    animation: pulse 1.5s infinite;
}

.step .label {
    font-size: 12px;
    color: var(--text-secondary);
}

.step.done .label, .step.doing .label {
    color: var(--brand-primary);
    font-weight: 500;
}

/* ==================== 浮动 AI 按钮 ==================== */
.floating-ai {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-gold));
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    z-index: 999;
    transition: var(--transition);
}

.floating-ai:hover {
    transform: scale(1.1) rotate(8deg);
}

.floating-ai::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--brand-gold);
    animation: ripple 1.6s infinite;
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}
/* ==================== 统一布局扩展（base.html）==================== */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
}

.sidebar-logo {
    height: 34px;
    width: auto;
    filter: brightness(1.05);
}

.sidebar-brand-name {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.sidebar-brand-sub {
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
}

.menu-section {
    padding: 14px 24px 4px;
    color: rgba(200, 168, 118, 0.85);
    font-size: 14px;
    letter-spacing: 2px;
}

.header-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}

.header-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.header-chip i {
    color: var(--brand-gold);
}

.header-notice {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
    color: var(--brand-primary);
    font-weight: 600;
}

.sidebar-footer {
    position: absolute;
    bottom: 16px;
    left: 24px;
    right: 24px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    text-align: center;
    line-height: 1.7;
}

/* ==================== 通用内容组件 ==================== */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i { color: var(--brand-gold); }

.page-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
.grid-3-2 { grid-template-columns: 3fr 2fr; }

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
    background: rgba(200, 168, 118, 0.15);
    color: #2563EB;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1.2;
}

.stat-card .stat-value.small { font-size: 18px; }

.stat-card .stat-trend {
    font-size: 12px;
    margin-top: 6px;
    color: var(--text-light);
}

.stat-trend.up { color: var(--brand-success); }
.stat-trend.down { color: var(--brand-danger); }

.panel {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
    overflow: hidden;
}

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

.panel-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i { color: var(--brand-gold); }

.panel-body { padding: 20px; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tbody tr:hover { background: rgba(200, 168, 118, 0.04); }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-success { background: rgba(46, 196, 182, 0.12); color: #1A9E92; }
.badge-warning { background: rgba(255, 159, 28, 0.12); color: #D97E00; }
.badge-danger { background: rgba(231, 29, 54, 0.1); color: var(--brand-danger); }
.badge-info { background: rgba(74, 144, 226, 0.1); color: #2F6FC1; }
.badge-gold { background: rgba(200, 168, 118, 0.15); color: #2563EB; }
.badge-primary { background: rgba(10, 31, 68, 0.1); color: var(--brand-primary); }
.badge-gray { background: rgba(107, 114, 128, 0.1); color: var(--text-secondary); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary { background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light)); color: #fff; }
.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark)); color: #fff; }
.btn-gold:hover { box-shadow: var(--shadow-gold); transform: translateY(-1px); }
.btn-outline { background: #fff; border: 1px solid var(--border-color); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--brand-gold); color: #2563EB; }
.btn-danger { background: rgba(231, 29, 54, 0.08); color: var(--brand-danger); }
.btn-danger:hover { background: var(--brand-danger); color: #fff; }
.btn-success { background: rgba(46, 196, 182, 0.1); color: #1A9E92; }
.btn-success:hover { background: var(--brand-success); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.form-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-item label { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.form-item input, .form-item select, .form-item textarea {
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(200, 168, 118, 0.15);
}

.form-row { display: flex; gap: 14px; }
.form-row .form-item { flex: 1; }

.modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 31, 68, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-mask.show { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    width: min(640px, 92vw);
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title { font-size: 16px; font-weight: 700; color: var(--brand-primary); }

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

.modal-body { padding: 20px 24px; }

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
}

.chart-box { position: relative; width: 100%; }

.timeline { list-style: none; }

.timeline-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}

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

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.timeline-dot.success { background: var(--brand-success); }
.timeline-dot.warning { background: var(--brand-warning); }
.timeline-dot.danger { background: var(--brand-danger); }
.timeline-dot.info { background: var(--brand-accent); }

.rank-1 { color: #D4AF37; font-weight: 800; }
.rank-2 { color: #9CA3AF; font-weight: 700; }
.rank-3 { color: #B87333; font-weight: 700; }

.progress {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-gold), var(--brand-gold-dark));
    border-radius: 999px;
    transition: width 0.6s ease;
}

.empty-tip {
    text-align: center;
    color: var(--text-light);
    padding: 40px 0;
    font-size: 13px;
}

.empty-tip i { font-size: 32px; color: var(--border-color); margin-bottom: 10px; display: block; }

@media (max-width: 1200px) {
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-2-1, .grid-1-2, .grid-3-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .header-center { display: none; }
}

/* ==================== 登录页改版（账号展示 + 忘记密码）==================== */
.login-wrap {
    display: flex;
    gap: 0;
    width: min(1060px, 94vw);
    min-height: 640px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 2;
}

.login-showcase {
    flex: 1.15;
    background: linear-gradient(160deg, rgba(10, 31, 68, 0.96), rgba(26, 48, 96, 0.92));
    padding: 44px 40px;
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.showcase-logo {
    height: 44px;
    width: auto;
    margin-bottom: 18px;
    align-self: flex-start;
}

.login-showcase h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 2px;
}

.login-showcase h2 {
    font-size: 15px;
    font-weight: 500;
    color: var(--brand-gold);
    letter-spacing: 6px;
    margin: 6px 0 14px;
}

.showcase-desc {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    line-height: 1.9;
    margin-bottom: 22px;
}

.showcase-accounts {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px 18px;
}

.showcase-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-gold);
    margin-bottom: 12px;
}

.acct-item {
    display: grid;
    grid-template-columns: 96px 1fr 64px;
    gap: 8px;
    align-items: center;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 0.2s;
}

.acct-item:hover {
    background: rgba(200, 168, 118, 0.18);
}

.acct-role { color: rgba(255, 255, 255, 0.9); }
.acct-user { color: var(--brand-gold); font-weight: 700; font-family: Consolas, monospace; }
.acct-pwd { color: rgba(255, 255, 255, 0.45); text-align: right; }

.login-card {
    flex: 1;
    background: #fff;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-card .login-logo {
    text-align: left;
    margin-bottom: 26px;
}

.login-card .login-logo h1 {
    font-size: 22px;
    color: var(--brand-primary);
}

.login-card .subtitle {
    color: var(--text-secondary);
    font-size: 13px;
}

.login-card .form-group { margin-bottom: 18px; }

.login-card .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-card .form-group label i { color: var(--brand-gold); margin-right: 4px; }

.login-card .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.login-card .form-group input:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(200, 168, 118, 0.18);
}

.login-links {
    text-align: right;
    margin: -4px 0 16px;
}

.login-links a {
    color: var(--brand-accent);
    font-size: 13px;
    text-decoration: none;
}

.login-links a:hover { color: #2563EB; }

.btn-login {
    width: 100%;
    padding: 13px;
    font-size: 15px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: #fff;
    font-weight: 700;
    letter-spacing: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login:hover {
    box-shadow: 0 12px 28px rgba(10, 31, 68, 0.35);
    transform: translateY(-2px);
}

.login-tip {
    margin-top: 22px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.8;
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 12px 14px;
}

.login-tip i { color: var(--brand-success); margin-right: 4px; }

/* ==================== 忘记密码页 ===================== */
.forgot-card {
    width: min(520px, 92vw);
    background: #fff;
    border-radius: 20px;
    padding: 40px 42px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
}

.forgot-card h1 {
    font-size: 22px;
    color: var(--brand-primary);
    margin-bottom: 6px;
}

.forgot-steps {
    display: flex;
    gap: 8px;
    margin: 18px 0 26px;
}

.forgot-step {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    padding: 8px 0;
    border-radius: 8px;
    background: var(--bg-primary);
}

.forgot-step.on {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: #fff;
    font-weight: 600;
}

.code-row {
    display: flex;
    gap: 10px;
}

.code-row input { flex: 1; }

.btn-send-code {
    white-space: nowrap;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-send-code:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 900px) {
    .login-wrap { flex-direction: column; min-height: auto; }
    .login-showcase { display: none; }
}

/* ==================== AI 聊天组件 ==================== */
.ai-panel .ai-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 14px;
}

.ai-chat {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.ai-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.ai-msg-user { flex-direction: row-reverse; }

.ai-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.ai-avatar-user {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
}

.ai-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    font-size: 13px;
    line-height: 1.8;
    word-break: break-word;
}

.ai-msg-user .ai-bubble {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: #fff;
    border: none;
}

.ai-bubble h2, .ai-bubble h3, .ai-bubble h4 { margin: 8px 0 4px; font-size: 14px; }
.ai-bubble code { background: rgba(200, 168, 118, 0.15); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

.ai-input-row {
    display: flex;
    gap: 10px;
}

.ai-input-row input {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
}

.ai-input-row input:focus { border-color: var(--brand-gold); }

.dots { display: inline-flex; gap: 4px; align-items: center; }
.dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-gold);
    animation: dotBlink 1.2s infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBlink {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1.1); }
}

/* ==================== 云课堂卡片 ==================== */
.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.course-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.course-cover {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #fff;
}

.course-cover i { font-size: 40px; opacity: 0.9; }

.cat-0 { background: linear-gradient(135deg, #0A1F44, #1A3060); }
.cat-1 { background: linear-gradient(135deg, #8A6D3B, #C8A876); }
.cat-2 { background: linear-gradient(135deg, #1B5E62, #2EC4B6); }
.cat-3 { background: linear-gradient(135deg, #4A148C, #7B3FA8); }
.cat-4 { background: linear-gradient(135deg, #B3541E, #E8853D); }

.course-dur {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.45);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
}

.course-info { padding: 14px 16px; }

.course-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.course-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.course-progress-label {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.player-box {
    height: 320px;
    background: linear-gradient(135deg, #06122B, #0A1F44);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
}

.player-box > i { font-size: 64px; color: var(--brand-gold); }

.player-title { margin-top: 14px; font-size: 17px; font-weight: 700; }

.player-hint { margin-top: 8px; font-size: 13px; color: rgba(255, 255, 255, 0.5); }

.player-playing {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

.rel-course {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.rel-course:hover { background: var(--bg-primary); }

.rel-cover {
    width: 56px;
    height: 40px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0A1F44, #1A3060);
    color: var(--brand-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rel-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ==================== 学习路径 ==================== */
.path-stage { margin-bottom: 18px; }

.path-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.path-courses {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 12px;
    border-left: 2px dashed var(--brand-gold);
    margin-left: 4px;
}

.path-course {
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.path-course i { color: var(--brand-gold); margin-right: 6px; }

/* ==================== 排名 / 待办行 ==================== */
.rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px dashed var(--border-color);
}

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

.rank-no {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.rank-name { flex: 1; font-weight: 600; font-size: 13px; }

.rank-orders { font-size: 12px; color: var(--text-light); }

.rank-amount { font-weight: 700; color: var(--brand-primary); font-size: 14px; }

.todo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 13px;
}

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

/* ==================== 排班表 ==================== */
.shift-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 720px;
}

.shift-table th {
    padding: 10px 8px;
    background: var(--bg-primary);
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
}

.shift-table td {
    padding: 8px 6px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.shift-cell {
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
}

.shift-cell:hover { outline: 2px solid var(--brand-gold); }

.shift-cell-early { background: rgba(200, 168, 118, 0.15); color: #2563EB; }
.shift-cell-mid { background: rgba(74, 144, 226, 0.12); color: #2F6FC1; }
.shift-cell-late { background: rgba(10, 31, 68, 0.08); color: var(--brand-primary); }
.shift-cell-rest { background: rgba(107, 114, 128, 0.1); color: var(--text-light); }

.shift-legend { display: flex; gap: 8px; }

.shift-chip {
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.shift-chip.shift-0 { background: rgba(200, 168, 118, 0.15); color: #2563EB; }
.shift-chip.shift-1 { background: rgba(74, 144, 226, 0.12); color: #2F6FC1; }
.shift-chip.shift-2 { background: rgba(10, 31, 68, 0.08); color: var(--brand-primary); }
.shift-chip.shift-3 { background: rgba(107, 114, 128, 0.1); color: var(--text-light); }

/* ==================== 产品选择卡片 ==================== */
.prod-pick {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 10px;
}

.prod-pick:hover {
    border-color: var(--brand-gold);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.prod-pick .pp-name { font-weight: 700; font-size: 13px; color: #1a1a1a; }
.prod-pick .pp-meta { font-size: 12px; color: var(--text-light); margin: 2px 0 6px; }
.prod-pick .pp-price { font-size: 13px; color: var(--brand-gold); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.prod-pick .pp-price i { color: var(--brand-gold); font-size: 16px; }

/* ==================== 响应式 v2.0（三档断点：≥1200 PC / 768-1199 平板 / <768 手机）==================== */

/* ---- Logo 溢出修正：方形标识 + 文字，杜绝超边距 ---- */
.sidebar-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.96);
    padding: 3px;
    flex-shrink: 0;
}
.sidebar-brand { gap: 10px; }
.sidebar-brand-text { min-width: 0; }
.sidebar-brand-name { white-space: nowrap; }
.sidebar-brand-sub { white-space: nowrap; }
.sidebar-close {
    display: none;
    margin-left: auto;
    width: 30px; height: 30px;
    border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff; cursor: pointer; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-left .logo { min-width: 0; }
.header-left .logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 26vw;
}

/* ---- 汉堡按钮（仅小屏显示） ---- */
.menu-toggle {
    display: none;
    width: 38px; height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--brand-primary);
    font-size: 17px;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}
.menu-toggle:active { background: var(--bg-primary); }

/* ---- 侧边栏菜单纵向可滚动（PC 端同样修复“点最下面弹回顶部”） ---- */
.app-sidebar {
    overflow-y: auto;
    overscroll-behavior: contain;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.app-sidebar .menu { flex: 1 0 auto; margin-bottom: 90px; }
.sidebar-footer { position: static; padding: 14px 16px 4px; }

/* ---- 遮罩 ---- */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(6, 18, 43, 0.55);
    z-index: 1090;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.sidebar-overlay.show { display: block; opacity: 1; }

/* ---- 表格分页条 ---- */
.table-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
    background: #fff;
    flex-wrap: wrap;
    /* v3.1：分页控件常驻可视区底部（上一页 / 下一页随滚动贴底） */
    position: sticky;
    bottom: 0;
    z-index: 6;
    box-shadow: 0 -4px 12px rgba(10, 31, 68, 0.06);
}
.table-pager .pager-info { font-size: 12px; color: var(--text-secondary); margin-right: auto; }
.table-pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- 平板（768-1199px） ---- */
@media (max-width: 1199px) {
    .app-layout { grid-template-columns: 200px 1fr; }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2-1, .grid-1-2, .grid-3-2 { grid-template-columns: 1fr; }
    .header-center { gap: 6px; }
    .header-chip { padding: 4px 8px; font-size: 14px; }
    .app-main {
    margin-top: 64px; padding: 16px 18px 36px; }
}

/* ---- 手机（<768px） ---- */
@media (max-width: 767px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 56px 1fr;
        grid-template-areas: "header" "main";
    }
    /* 侧边栏 → 抽屉 */
    .app-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 258px;
        max-width: 84vw;
        z-index: 1100;
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-lg);
        display: flex;
        flex-direction: column;
    }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-close { display: flex; align-items: center; justify-content: center; }
    .app-sidebar .menu { margin-bottom: 0; }
    .sidebar-footer { margin-top: auto; }

    /* 顶栏折叠 */
    .app-header {
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    height: 64px;
    background: #fff;
        padding: 0 12px;
        flex-wrap: wrap;
        height: auto;
        min-height: 56px;
        row-gap: 6px;
        padding-bottom: 6px;
    }
    .menu-toggle { display: flex; align-items: center; justify-content: center; }
    .header-left .logo-text { font-size: 14px; max-width: 34vw; }
    .header-center {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .header-center::-webkit-scrollbar { display: none; }
    .header-chip { flex-shrink: 0; }
    .role-switcher {
        gap: 6px;
        overflow-x: auto;
        max-width: 44vw;
        scrollbar-width: none;
    }
    .role-switcher::-webkit-scrollbar { display: none; }
    .role-tag { padding: 4px 8px; font-size: 14px; flex-shrink: 0; }
    .user-avatar span { display: none; }

    /* 主内容 */
    .app-main {
    margin-top: 64px; padding: 12px 12px 84px; }
    .page-title { font-size: 17px; }
    .page-head { margin-bottom: 12px; }
    .page-head .btn { width: 100%; justify-content: center; }
    .grid-2, .grid-3, .grid-4, .grid-5,
    .grid-cols-2, .grid-cols-3, .grid-cols-4,
    .grid-2-1, .grid-1-2, .grid-3-2 { grid-template-columns: 1fr; }

    /* 统计卡横向两列（数字卡更紧凑） */
    .grid.grid-4, .grid.grid-5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 12px 14px; }
    .stat-card .stat-value { font-size: 19px; }
    .stat-card .stat-icon { width: 34px; height: 34px; font-size: 15px; margin-bottom: 8px; }

    /* 面板与表格 */
    .panel-head { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
    .panel-body { padding: 12px; }
/* V4.0 表格不再使用 display:block 模拟滚动（会破坏列对齐），
   改由 .tbl-box/.table-scroll 承载横向滚动，见 theme-v4.css */

    /* 表单纵向堆叠 */
    .form-row { flex-direction: column; }
    .form-item input, .form-item select, .form-item textarea { width: 100%; }
    .modal { width: 96vw; max-height: 88vh; }
    .modal-head, .modal-body { padding: 12px 16px; }
    .modal-foot { padding: 10px 16px; flex-wrap: wrap; }
    .modal-foot .btn { flex: 1; justify-content: center; }

    /* 按钮热区增大 */
    .btn { min-height: 36px; }
    .btn-sm { min-height: 30px; }
    .steps { flex-wrap: nowrap; overflow-x: auto; }
    .chart-box { min-height: 240px; }
    .login-card { width: 92%; padding: 28px 20px; }
    .table-pager { padding: 8px 10px; }
}

/* ==================== 页面组件补充（v2.0） ==================== */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 表格滚动容器：表格宽于容器时仅表格内部横向滚动，页面不横滚 */
.table-scroll { overflow-x: auto; padding: 0 !important; }
.table-scroll .data-table { min-width: 100%; }

/* 表头垂直居中 + 内容居中 */
.data-table th { vertical-align: middle; }
.data-table th, .data-table td { vertical-align: middle; }

/* 单元格辅助样式 */
.cell-sub { font-size: 14px; color: var(--text-light); margin-top: 2px; line-height: 1.5; }
.cell-muted { font-size: 12px; color: var(--text-secondary); }
.cell-link { color: #4A90E2; font-size: 12px; }
.cell-ok { font-size: 12px; color: #16A34A; }
.cell-danger { font-size: 12px; color: var(--brand-danger); }

/* 行内操作按钮（保证不被裁切） */
.row-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.row-actions .btn { flex-shrink: 0; }

/* 兼容旧弹窗类名（modal-content/header/footer → modal/head/foot 视觉一致） */
.modal-content {
    background: #fff; border-radius: var(--radius-lg); width: min(640px, 92vw);
    max-height: 86vh; overflow-y: auto; box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}
.modal-header, .modal-footer { display: flex; align-items: center; }
.modal-content .modal-header { justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border-color); }
.modal-content .modal-footer { justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border-color); }
.btn-primary-solid { background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light)); color: #fff; }

/* 统计卡片区在窄屏保持两列（不挤压变形） */
@media (max-width: 767px) {
    .kb-stats { gap: 10px; }
    .head-actions { width: 100%; }
    .head-actions .btn { flex: 1; justify-content: center; }
    .table-scroll { padding: 0 !important; }
    .table-scroll .data-table { min-width: 680px; display: table; }
    .row-actions .btn-sm { min-height: 30px; }
}

/* ============================================================
   v3.0 全局统一改造（2026-09 按优化建议实施）
   覆盖：固定布局 / 按钮统一 / 栅格对齐 / 条目组件 /
        站内信 / AI助手 / 一键查价 / 移动端商务适配 / 性能优化
   ============================================================ */

/* ---------- 1. 固定布局：侧边栏钉住，仅右侧主内容滚动 ----------
   v3.1 修复：本段仅限桌面/平板（≥768px）。
   此前未加媒体查询，position:sticky 覆盖了手机端抽屉的 position:fixed，
   导致手机上侧边栏半屏占位、拦截一切点击（AI 无法输入/发送的根因） */
html, body { height: 100%; }

/* 登录/忘记密码页允许自身滚动（不使用 app-layout） */
.login-container, .page-auth-wrap { overflow-y: auto; height: 100vh; height: 100dvh; }

/* 顶栏固定（手机端吸顶同样适用） */
.app-header {
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    height: 64px;
    background: #fff; position: sticky; top: 0; z-index: 100; }

@media (min-width: 768px) {
    .app-layout {
        height: 100vh;
        height: 100dvh;       /* v3.1 动态视口 */
        max-height: 100vh;
        overflow: hidden;     /* 最外层容器禁止滚动 */
        min-height: 0;        /* 允许 grid 子项内部收缩 */
    }

    .app-sidebar {
        height: 100vh;
        height: 100dvh;
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
    }

    .app-main {
    margin-top: 64px;
        overflow-y: auto;    /* 滚动条只出现在右侧主内容容器内部 */
        overflow-x: hidden;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(10,31,68,0.22) transparent;
    }
    .app-main::-webkit-scrollbar { width: 8px; }
    .app-main::-webkit-scrollbar-thumb { background: rgba(10,31,68,0.18); border-radius: 8px; }
    .app-main::-webkit-scrollbar-track { background: transparent; }
}

/* 手机（<768px）：恢复文档流滚动（body 滚动 + fixed 抽屉侧边栏），
   避免内部滚动容器在 iOS 上被地址栏遮挡、弹性滚动手感差 */
@media (max-width: 767px) {
    .app-layout { height: auto; max-height: none; overflow: visible; }
    .app-main {
    margin-top: 64px; height: auto; overflow: visible; min-height: 0; overflow-x: clip; }   /* clip 不创建滚动容器，保住 sticky 分页条 */
    html, body { height: auto; }
}

/* ---------- 2. 侧边栏品牌标识（ROBAM 老板 · 居中） ---------- */
.sidebar-brand {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 18px 16px 14px;
}
.sidebar-logo {
    width: 44px; height: 44px;
    margin: 0 auto;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    padding: 5px;
}
.sidebar-brand-name { font-size: 16px; letter-spacing: 1px; }
.sidebar-brand-sub  { font-size: 14px; letter-spacing: 2px; }
.sidebar-close { position: absolute; top: 12px; right: 12px; }

/* ---------- 3. 全局按钮统一规范 ----------
   统一高度 38px（sm 30px）/ 统一圆角 8px / 统一内边距 /
   宽度随文字自适应，禁止强制撑满容器；同类按钮完全一致 */
.btn {
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;             /* 宽度自适应文字，不再撑满 */
    min-width: 0;
    line-height: 1;
    will-change: transform;
}
.btn i { font-size: 13px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 6px; }
.btn-sm i { font-size: 12px; }

/* 深蓝色主操作按钮：全系统等长对齐（含图标的统一 96px） */
.btn-primary, .btn-primary-solid {
    min-width: 96px;
    justify-content: center;
}
/* 表格行内的紧凑主按钮（跟进/去处理等）：短文字按钮等宽 */
.row-actions .btn-primary, .todo-row .btn-primary { min-width: 76px; }

/* 弹窗底部按钮：取消/保存同尺寸并排整齐 */
.modal-foot .btn { min-width: 96px; height: 38px; }
.modal-foot { gap: 12px; }

/* 按钮点击性能：仅 transform/opacity 过渡，避免重排卡顿 */
.btn, .btn-gold, .btn-primary, .btn-outline, .role-tag {
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}
.btn:active { transform: scale(.96); }

/* ---------- 4. 表格栅格对齐规范 ----------
   表头与每行严格按列对齐；数字右对齐、文本左对齐、状态居中 */
.data-table th, .data-table td { vertical-align: middle; }
.data-table .num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .money { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.data-table .center, td.center { text-align: center; }
.data-table td .badge { vertical-align: middle; }

/* 表格外层统一横向滚动容器（列多时表内滚动，页面不横滚） */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .data-table { min-width: max-content; }

/* ---------- 5. 全局条目组件（图标 + 主标题 + 副标题 成组居中） ----------
   适用于：快捷入口、推荐课程、快捷模板、AI 课件库等所有条目列表 */
.entry-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 18px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    height: 100%;
    min-height: 108px;
    text-decoration: none !important;
    color: inherit;
}
.entry-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-gold);
}
.entry-item .entry-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.entry-item .entry-icon.gold { background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark)); }
/* h3/p 写法的等价映射（practice/script/path 等新页面使用） */
.entry-item h3 { font-size: 14px; font-weight: 700; color: var(--brand-primary); line-height: 1.4; margin: 0; width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-item p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin: 0; width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-item .entry-title {
    font-size: 14px; font-weight: 700; color: var(--brand-primary);
    line-height: 1.4; width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.entry-item .entry-sub {
    font-size: 12px; color: var(--text-secondary);
    line-height: 1.5; width: 100%;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* 条目网格容器：多列排布，窄屏自动换行堆叠 */
.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
@media (max-width: 767px) {
    .entry-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .entry-item { min-height: 96px; padding: 14px 8px; }
    .entry-item .entry-icon { width: 36px; height: 36px; font-size: 16px; }
}

/* ---------- 6. 站内信中心 ---------- */
.msg-badge {
    position: absolute;
    top: -4px; right: -6px;
    min-width: 17px; height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--brand-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.icon-btn {
    position: relative;
    width: 38px; height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--brand-primary);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background-color .15s ease;
}
.icon-btn:hover { background: var(--bg-primary); }
.icon-btn.gold { color: #2563EB; border-color: rgba(200,168,118,.45); }

.msg-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color .15s ease;
    align-items: flex-start;
}
.msg-item:hover { background: var(--bg-primary); }
.msg-item.unread { background: rgba(200,168,118,.06); }
.msg-item .msg-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.msg-item .msg-body { flex: 1; min-width: 0; }
.msg-item .msg-title { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.msg-item .msg-text { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.6;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-item .msg-time { font-size: 14px; color: var(--text-light); white-space: nowrap; flex-shrink: 0; }
.msg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-danger); flex-shrink: 0; }

/* ---------- 7. 全局 AI 助手（AI 标识悬浮球 + 面板） ---------- */
.ai-fab {
    position: fixed;
    bottom: calc(28px + env(safe-area-inset-bottom, 0px)); right: 28px;
    width: 58px; height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 60%, var(--brand-gold) 130%);
    box-shadow: 0 12px 32px rgba(10, 31, 68, 0.35);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 1200;
    border: 2px solid rgba(255,255,255,.35);
    transition: transform .2s ease, box-shadow .2s ease;
    user-select: none;
}
.ai-fab:hover { transform: scale(1.08); box-shadow: 0 16px 40px rgba(10,31,68,.45); }
.ai-fab:active { transform: scale(.95); }
.ai-fab .ai-fab-badge {
    font-size: 19px; font-weight: 900; color: #fff; letter-spacing: .5px;
    font-family: "Segoe UI", -apple-system, sans-serif;
}
.ai-fab::after {
    content: '';
    position: absolute; inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(200,168,118,.55);
    animation: aiRipple 2s infinite;
    pointer-events: none;
}
@keyframes aiRipple {
    0% { transform: scale(.9); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* AI 助手抽屉面板 */
.ai-assistant-mask {
    display: none;
    position: fixed; inset: 0;
    background: rgba(6,18,43,.45);
    z-index: 1300;
    opacity: 0;
    transition: opacity .2s ease;
}
.ai-assistant-mask.show { display: block; opacity: 1; }
.ai-assistant {
    position: fixed;
    right: 28px;
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    width: min(420px, calc(100vw - 32px));
    max-height: min(640px, calc(100vh - 140px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(10,31,68,.35);
    z-index: 1310;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(16px) scale(.97);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
}
.ai-assistant.show { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.ai-assistant-head {
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: #fff;
    display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.ai-assistant-head .ai-head-icon {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 16px; flex-shrink: 0;
}
.ai-assistant-head .ai-head-title { font-size: 15px; font-weight: 700; }
.ai-assistant-head .ai-head-sub { font-size: 11.5px; color: rgba(255,255,255,.75); margin-top: 2px; }
.ai-assistant-head .ai-head-close {
    margin-left: auto; width: 30px; height: 30px; border-radius: 50%;
    border: none; background: rgba(255,255,255,.15); color: #fff; cursor: pointer; font-size: 14px;
}
.ai-assistant-body {
    flex: 1; overflow-y: auto; padding: 14px 16px;
    background: var(--bg-primary);
    min-height: 200px;
}
.ai-assistant-foot {
    padding: 12px 14px;
    border-top: 1px solid var(--border-color);
    display: flex; gap: 8px; flex-shrink: 0;
    background: #fff;
}
.ai-assistant-foot input {
    flex: 1; padding: 10px 14px;
    border: 1px solid var(--border-color); border-radius: 10px;
    font-size: 13px; outline: none; min-width: 0;
}
.ai-assistant-foot input:focus { border-color: var(--brand-gold); }
.ai-assistant-foot .btn { height: 40px; }
.ai-quick-tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; background: #fff; }
.ai-quick-tags .btn { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 999px; }

/* ---------- 8. 一键查价 ---------- */
.price-quick-card {
    border: 1px solid rgba(200,168,118,.4);
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(200,168,118,.08), rgba(10,31,68,.04));
}
.price-quick-row { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; font-size: 13px; }
.price-quick-row b { color: var(--brand-primary); }
.price-quick-row .pq-label { color: var(--text-secondary); }
.price-quick-row .pq-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.price-quick-row.final { border-top: 1px dashed var(--border-color); margin-top: 6px; padding-top: 10px; }
.price-quick-row.final .pq-val { color: #2563EB; font-size: 18px; }

/* ---------- 9. 通知公告页 ---------- */
.notice-item {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex; gap: 14px; align-items: flex-start;
}
.notice-item .notice-icon {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.notice-item .notice-icon.info { background: rgba(74,144,226,.12); color: #2F6FC1; }
.notice-item .notice-icon.success { background: rgba(46,196,182,.12); color: #1A9E92; }
.notice-item .notice-icon.warning { background: rgba(255,159,28,.14); color: #D97E00; }
.notice-item h3 { font-size: 15px; color: var(--brand-primary); margin-bottom: 4px; }
.notice-item .notice-meta { font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.notice-item .notice-content { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }

/* ---------- 10. 注册页 / 登录页单栏居中 ---------- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(74,144,226,.10), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(200,168,118,.14), transparent 45%),
        linear-gradient(160deg, #EEF3FB 0%, #F7F9FD 55%, #EDF1F9 100%);
    padding: 24px 16px;
    overflow-y: auto;
}
.auth-card {
    width: min(440px, 100%);
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(10,31,68,.14);
    padding: 40px 38px 30px;
    position: relative;
    z-index: 2;
    animation: cardEnter .5s ease;
}
.auth-card .auth-logo { text-align: center; margin-bottom: 24px; }
.auth-card .auth-logo img { height: 56px; width: 56px; object-fit: contain; border-radius: 14px; padding: 6px; background: var(--bg-primary); }
.auth-card .auth-logo h1 { font-size: 22px; font-weight: 800; color: var(--brand-primary); margin-top: 12px; letter-spacing: 1px; }
.auth-card .auth-logo .auth-sub { font-size: 13px; color: var(--text-secondary); margin-top: 6px; letter-spacing: 2px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-light); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.auth-links-row { display: flex; justify-content: space-between; align-items: center; margin: -2px 0 16px; }
.auth-links-row a { color: var(--brand-accent); font-size: 13px; }
.auth-links-row a:hover { color: #2563EB; }
.auth-demo {
    margin-top: 20px;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}
.auth-demo summary {
    padding: 10px 14px;
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
    background: var(--bg-primary);
    list-style: none;
    user-select: none;
}
.auth-demo summary::-webkit-details-marker { display: none; }
.auth-demo summary i { color: var(--brand-gold); margin-right: 6px; }
.auth-demo .acct-item { padding: 8px 12px; border-radius: 8px; margin: 4px 8px; }
.auth-demo .acct-item:hover { background: rgba(200,168,118,.14); }

/* ---------- 11. 图表图例防遮挡（全局图表规范） ---------- */
.chart-box { position: relative; width: 100%; min-height: 220px; overflow: visible; }
.chart-box canvas { max-width: 100%; }
.chart-wrap { position: relative; padding: 6px 4px 10px; }
.chart-legend-scroll { max-height: 120px; overflow-y: auto; }

/* ---------- 12. 弹窗性能优化（秒开，不卡顿） ---------- */
.modal-mask { contain: layout style; }
.modal {
    will-change: transform, opacity;
    animation: modalIn .18s ease;
    overscroll-behavior: contain;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
/* 弹窗内加载骨架 */
.skeleton-line {
    height: 14px; border-radius: 6px;
    background: linear-gradient(90deg, #EEF1F6 25%, #F7F9FC 50%, #EEF1F6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    margin: 8px 0;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 13. 培训中心课程横排卡片 ---------- */
/* V5.1：旧写法 minmax(240px,1fr) 在 1200px+ 容器里只能排出 4 列，
   每列被拉到 290px+ 却只放两行 meta，卡片内部右侧大片空白。
   这里把最小列宽收窄到 210px 并放开 auto-fill，宽屏自然多排一列、窄屏自动减列，
   卡片宽高比更紧凑，右侧不留白。 */
.course-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    min-width: 0;
}
.course-card-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    overflow: hidden;
    display: flex; flex-direction: column;
    min-width: 0;
    transition: transform .15s ease, box-shadow .15s ease;
}
.course-card-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.course-card-item .cc-cover {
    height: 86px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 30px; position: relative;
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #23407a 60%, var(--brand-gold) 130%);
}
.course-card-item .cc-cover .badge { position: absolute; top: 8px; right: 8px; }
.course-card-item .cc-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; cursor: pointer; }
.course-card-item .cc-title { font-size: 14px; font-weight: 700; color: var(--brand-primary); line-height: 1.45;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.course-card-item .cc-meta {
    display: flex; flex-wrap: wrap; gap: 6px 12px;
    font-size: 11.5px; color: var(--text-secondary);
    min-width: 0;
}
/* V5.1：meta 里的每项都 nowrap，卡片被自动填充压窄时整行会溢出（实测 196 > 181）。
   给它们加 min-width:0 + 单行省略，让"内部讲师"这类长值优雅截断而不是顶破卡片。 */
.course-card-item .cc-meta span {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.course-card-item .cc-meta i { color: var(--brand-gold); font-size: 14px; flex-shrink: 0; }
/* 卡片底部操作条：两个按钮等宽平分，卡片宽度变化时也始终铺满、不出现右侧留白 */
.course-card-item .cc-foot {
    padding: 9px 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FBFCFE;
}
.course-card-item .cc-foot .btn {
    flex: 1 1 0;
    min-width: 0;
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* ---------- 14. 行内 AI 生成结果展开区（竞品反制话术等） ---------- */
.ai-inline-result {
    background: linear-gradient(135deg, rgba(10,31,68,.045), rgba(200,168,118,.06));
    border: 1px solid rgba(200,168,118,.35);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.9;
    animation: fadeIn .25s ease;
    position: relative;
}
.ai-inline-result .ai-inline-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px; padding-bottom: 8px;
    border-bottom: 1px dashed rgba(200,168,118,.4);
}
.ai-inline-result .ai-inline-bar b { color: var(--brand-primary); font-size: 12.5px; }

/* ---------- 15. 徽标状态中文化辅助 ---------- */
.status-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.status-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-chip.ok { background: rgba(46,196,182,.12); color: #1A9E92; }
.status-chip.warn { background: rgba(255,159,28,.13); color: #D97E00; }
.status-chip.err { background: rgba(231,29,54,.1); color: var(--brand-danger); }
.status-chip.info { background: rgba(74,144,226,.1); color: #2F6FC1; }
.status-chip.muted { background: rgba(107,114,128,.1); color: var(--text-secondary); }

/* ---------- 16. 审批流程（注册审批） ---------- */
.approval-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reject-reason { font-size: 12px; color: var(--brand-danger); background: rgba(231,29,54,.06); border-radius: 8px; padding: 8px 12px; margin-top: 6px; }

/* ---------- 17. 销售话术 / 学习路径模块 ---------- */
.script-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--bg-card);
    position: relative;
    transition: transform .15s ease, box-shadow .15s ease;
}
.script-card:hover { box-shadow: var(--shadow-md); }
.script-card .sc-type {
    position: absolute; top: 12px; right: 12px;
}
.script-card h4 { font-size: 14px; color: var(--brand-primary); margin-bottom: 8px; padding-right: 78px; }
.script-card .sc-content { font-size: 13px; color: var(--text-secondary); line-height: 1.9; white-space: pre-wrap; }
.path-node {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    background: var(--bg-primary); margin-bottom: 8px;
    border: 1px solid var(--border-color);
}
.path-node .pn-order {
    width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.path-node .pn-title { font-size: 13px; font-weight: 600; color: var(--text-primary); flex: 1; }
.path-node .pn-meta { font-size: 11.5px; color: var(--text-light); }

/* ---------- 18. 移动端商务精美适配（<768px 深度优化） ---------- */
@media (max-width: 767px) {
    /* AI 悬浮球缩小 */
    .ai-fab { width: 50px; height: 50px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); right: 20px; }
    .ai-fab .ai-fab-badge { font-size: 16px; }
    .ai-assistant { right: 16px; left: 16px; width: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); max-height: 70vh; }
    /* v3.1 软键盘弹出：面板压缩上移，输入框不被键盘遮挡 */
    .ai-assistant.keypad-open { bottom: 8px; max-height: 52vh; }
    .ai-assistant.keypad-open .ai-assistant-body { min-height: 120px; }

    /* 弹窗自适应屏幕 */
    .modal { width: 94vw; max-height: 86vh; }
    .modal-foot .btn { flex: 1; min-width: 0; }

    /* 移动端按钮：保证热区不溢出 */
    .btn { height: 40px; padding: 0 14px; }
    .btn-sm { height: 32px; }
    /* V5.1：这里原来是 flex-wrap: wrap —— 手机端表格操作列被压到 78px 时，
       两个图标按钮就会上下叠成两行（实测 top 相差 36px），看起来"按钮没对齐"。
       操作列按钮必须保持同一水平线，宽度不够时让表格横向滚动，而不是折行。 */
    .row-actions { flex-wrap: nowrap; gap: 6px; }

    /* 站内信/顶栏紧凑 */
    .msg-item { padding: 12px; }
    .icon-btn { width: 34px; height: 34px; }

    /* 统计卡两列 */
    .grid.grid-4, .grid.grid-5 { grid-template-columns: repeat(2, 1fr); }
    .stat-card { padding: 12px; }
    .stat-card .stat-value { font-size: 18px; }
    .stat-card .stat-icon { width: 30px; height: 30px; font-size: 14px; margin-bottom: 6px; }

    /* 课程卡片单列堆叠 */
    .course-card-grid { grid-template-columns: 1fr; }

    /* 认证卡片 */
    .auth-card { padding: 30px 22px 22px; }
    .auth-card .auth-logo h1 { font-size: 19px; }

    /* 图表高度 */
    .chart-box { min-height: 200px; }
}

/* 平板增强（768-1199） */
@media (min-width: 768px) and (max-width: 1199px) {
    .ai-assistant { width: min(400px, calc(100vw - 40px)); }
    .course-card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 19. 打印样式（学习路径 PDF 下载辅助） ---------- */
@media print {
    .app-sidebar, .app-header, .ai-fab, .ai-assistant, .btn, .no-print { display: none !important; }
    .app-layout { display: block; height: auto; overflow: visible; }
    .app-main {
    margin-top: 64px; overflow: visible; height: auto; }
    body { background: #fff; }
}

/* ---------- 20. 动效性能：全局 GPU 加速提示 ---------- */
.stat-card, .panel, .quick-card, .course-card { transform: translateZ(0); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════════════════════════════════════════════════════
   v3.3 全域优化终版（2026-09 交付版）
   1. 顶栏角色下拉菜单（替代横排标签，不遮挡右侧电话）
   2. 表格全局：外框圆角 + 表头底色 + 容器撑满不留白 + 左对齐
   3. 图表溢出防护与 X 轴标签空间
   4. AI 面板对话修复（层级 / 选中 / 滚动 / 软键盘）
   5. 手机端输入体验（16px 防缩放 / 触控热区 / 零横滚）
   ═══════════════════════════════════════════════════════════════ */

/* ---------- 21.1 顶栏角色切换下拉菜单（v3.3） ---------- */
.role-menu {
    position: relative;
    display: inline-flex;
}
.role-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
    color: #fff;
    border: none;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    min-height: 34px;
    transition: var(--transition);
}
.role-menu-toggle:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.role-menu.open .role-menu-toggle {
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-dark));
}
.role-menu-toggle .fa-chevron-down { transition: transform .2s; }
.role-menu.open .role-menu-toggle .fa-chevron-down { transform: rotate(180deg); }
.role-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 168px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 1300;
    display: none;
    flex-direction: column;
}
.role-menu.open .role-menu-dropdown { display: flex; animation: fadeIn .18s ease; }
.role-menu-label {
    font-size: 14px;
    color: var(--text-light);
    padding: 6px 10px 4px;
    letter-spacing: 1px;
}
.role-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    text-decoration: none;
    text-align: left;
}
.role-menu-item:hover { background: var(--bg-primary); }
.role-menu-item.active {
    background: rgba(200, 168, 118, .14);
    color: #2563EB;
    font-weight: 600;
}

/* ---------- 21.2 表格全局美化（外框圆角 + 撑满不留白） ---------- */
/* 表格容器：数据行不足时由容器背景补齐，杜绝表格下方大片空白。
   使用 :has() 向上找到包含表格的面板体，同时兼容 .table-wrap 手动包裹 */
.panel-body:has(.data-table),
.panel-body:has(.table-scroll),
.table-wrap {
    min-height: 380px;
    background: #fff;
}
/* 表格页面板体取消内边距，让表格占满整宽 */
.panel-body:has(> .data-table),
.panel-body:has(> .table-scroll) { padding: 0; }
.panel-body:has(> .data-table) .data-table,
.panel-body:has(> .table-scroll) .data-table { min-height: 380px; }
/* 空提示行居中不被 min-height 顶走 */
.data-table .empty-tip { text-align: center; padding: 40px 16px !important; }

/* 表格外框 + 圆角 + 表头底色（桌面端；手机端由 21.5 接管保持横向滚动） */
@media (min-width: 768px) {
    table.data-table, .data-table, .shift-table {
        border-collapse: separate;
        border-spacing: 0;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        /* V4.0：必须用 clip 而非 hidden —— hidden 会让表格自身成为滚动容器，
           导致 operation 列的 position:sticky 失效（无法吸附在右侧）。 */
        overflow: clip;
    }
}
table.data-table thead th,
.data-table thead th,
.data-table th,
.shift-table th {
    background: var(--bg-primary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}
table.data-table tbody td,
.data-table tbody td { border-bottom: 1px solid #F1F3F7; }
table.data-table tbody tr:last-child td,
.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover,
.data-table tbody tr:hover { background: rgba(200, 168, 118, .05); }
/* 班次色块圆角 */
.shift-chip, .shift-cell [class*="shift-chip"] { padding: 4px 10px; border-radius: 6px; }

/* ---------- 21.3 全站列表靠左对齐 ----------
   V5.1 修复：原先把 .entry-item / .course-card-item 这类「卡片式（图标在上、
   文字在下）」的条目也纳入了左对齐，与卡片自身的居中声明互相打架，
   导致同一屏里居中/靠左混杂。卡片类已移出本名单，见 21.13 节的居中规则。 */
.rank-row, .todo-row, .notice-item, .notice-list > *,
.prod-pick, .rel-course,
.price-quick-card, .role-menu-item {
    justify-content: flex-start;
    text-align: left;
}

/* ---------- 21.4 图表与卡片 ---------- */
.chart-box { width: 100% !important; max-width: 100% !important; overflow: hidden; }
.chart-box canvas { max-width: 100% !important; }
/* 产品选择卡：同排等高，价格贴底，名称两行也不高低不齐 */
.prod-pick {
    height: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.prod-pick .pp-name { min-height: 36px; }
.prod-pick .pp-price { margin-top: auto; }
.prod-pick .pp-name, .prod-pick .pp-meta { overflow-wrap: anywhere; }
/* 竞品对标卡片允许收缩，长英文/型号不撑破容器 */
.comp-card, .cc-body { min-width: 0; overflow-wrap: anywhere; }
/* 弹窗边框观感 */
.modal-content {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.modal-header { border-bottom: 1px solid var(--border-color); background: var(--bg-primary); }
.modal-foot { border-top: 1px solid var(--border-color); background: var(--bg-primary); }
/* 表单聚焦金色高亮（培训师话术表单等全站统一观感） */
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
    border-color: var(--brand-gold);
    box-shadow: 0 0 0 3px rgba(200, 168, 118, .15);
}
/* 页面底部留白收紧 */
.app-main {
    margin-top: 64px; padding: 24px 24px 32px; }

/* ---------- 21.5 AI 面板对话修复（v3.3 重点） ---------- */
/* 装饰层不再拦截点击/触摸：消息区可滚动、输入框可聚焦 */
.ai-panel::before { z-index: 0; pointer-events: none; }
.ai-panel .ai-chat,
.ai-panel .ai-input-row,
.ai-panel .ai-header,
.ai-input-wrap, .ai-input-wrap input, .ai-input-wrap textarea,
.ai-panel .ai-assistant-body {
    position: relative;
    z-index: 2;
}
/* 输入元素强制可选中可聚焦（iOS Safari / 微信内置浏览器关键修复） */
input, textarea, select {
    -webkit-user-select: text !important;
    user-select: text !important;
    touch-action: auto !important;
}
/* 消息区始终可滚动手感顺滑 */
.ai-chat, .ai-assistant-body {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}
.ai-bubble { max-width: min(78%, calc(100% - 50px)); overflow-wrap: anywhere; }

/* ---------- 21.6 手机端深度适配（≤767px，不污染桌面端） ---------- */
@media (max-width: 767px) {
    /* 顶栏：角色下拉按钮 + 隐藏姓名文字只留头像 */
    .role-menu-toggle { max-width: 44vw; padding: 6px 10px; font-size: 12px; }
    .role-menu-toggle .role-current { overflow: hidden; text-overflow: ellipsis; }
    .role-menu-dropdown { right: -60px; max-width: calc(100vw - 24px); }
    .user-avatar .user-avatar-text { display: none; }

    /* 输入框 ≥16px：防 iOS Safari 聚焦自动放大页面 */
    .ai-input-wrap input, .ai-input-wrap textarea,
    .ai-input-row input, .ai-assistant-foot input,
    .form-group input, .form-group select,
    .form-item input, .form-item select, .form-item textarea,
    .code-row input, .search-bar input,
    input[type="text"], input[type="tel"], input[type="password"],
    input[type="number"], input[type="search"], input[type="email"],
    select, textarea {
        font-size: 16px !important;
    }
    /* 表格：容器内横向滚动，页面本体零横滚 */
    .data-table, table.data-table {
        border: 1px solid var(--border-color);
        border-radius: 10px;
    }
    /* 数字卡双列 */
    .stat-grid, .stat-cards { grid-template-columns: repeat(2, 1fr); }
    /* 面板边距统一 12px */
    .app-main {
    margin-top: 64px; padding: 12px 12px 24px; }
    /* 触控热区 */
    .btn, .btn-primary, .btn-gold, .btn-outline { min-height: 40px; }
    .icon-btn { min-width: 40px; min-height: 40px; }
}
/* 新增栅格：3:1（顾问工作台成交订单更宽） */
.grid-3-1 { grid-template-columns: 3fr 1fr; gap: 16px; }
@media (max-width: 1024px) { .grid-3-1 { grid-template-columns: 1fr; } }

/* ==================== v3.3.1 需求清单补充补丁 ==================== */

/* ---- 21.7 全局 loading 进度条（接口请求期间） ---- */
#global-loading-bar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: linear-gradient(90deg, var(--brand-gold, #C8A876), var(--brand-primary, #0A1F44));
    z-index: 9999; opacity: 0; transition: width .3s ease, opacity .3s ease;
    pointer-events: none; border-radius: 0 2px 2px 0;
}
#global-loading-bar.on { opacity: 1; width: 82%; }

/* ---- 21.8 表格「操作」列拉宽铺满 + 按钮统一尺寸 ----
   V5.5 修订：原先给末列写死 min-width:128px，会与前列宽度不一，
   且对「末列不是操作列」的表造成吸右覆盖。现取消该强制值，
   列宽统一交由 theme-v4.css 的 V5.5 表格硬规则决定。 */
.data-table { width: 100%; }
.data-table td:last-child { text-align: left; }
.data-table td:last-child .btn, .data-table td:last-child .btn-sm {
    min-width: 74px; height: 30px; padding: 0 12px;
    justify-content: center; display: inline-flex; align-items: center; gap: 5px;
    box-sizing: border-box;
}
/* 表格外框统一：深浅一致、粗细一致 */
.data-table th { font-weight: 600; }
.table-wrap, .table-scroll { border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }

/* ---- 21.9 模拟对练：三步方框放大，杜绝文字溢出 ---- */
.entry-grid .entry-item { padding: 18px 20px; min-height: 92px; align-items: center; }
.entry-grid .entry-item h3 { font-size: 15px; line-height: 1.5; margin-bottom: 4px; }
.entry-grid .entry-item p { font-size: 12.5px; line-height: 1.6; overflow: visible; text-overflow: clip; }

/* ---- 21.10 内嵌 AI 面板：预备文案候选列表可滚动 ----
   PC 鼠标滚轮 / 滚动条 + 手机触摸滑动均可浏览全部候选 */
.ai-quick-tags.ai-quick-scroll {
    flex-wrap: wrap; max-height: 132px; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
    margin: 0 14px 10px; padding: 8px; background: var(--bg-page, #F5F7FB);
    border-radius: 10px; border: 1px solid var(--border-color);
}
.ai-quick-tags.ai-quick-scroll .btn { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border-color); }
.ai-quick-tags.ai-quick-scroll .btn:active { background: var(--brand-gold-soft, #F3E9D7); }

/* ---- 21.11 话术卡片边框减淡（观感柔和） ---- */
.script-card { border: 1px solid var(--border-color) !important; box-shadow: none !important; background: #fff; }
.script-card:hover { border-color: var(--brand-gold, #C8A876) !important; box-shadow: 0 2px 10px rgba(200,168,118,.12) !important; }
.script-card .sc-content { color: var(--text-secondary); }

/* ---- 21.12 报价清单（智能价格测算）元素十字对齐 ---- */
#cart-table th, #cart-table td { text-align: center; vertical-align: middle; }
#cart-table td input[type="number"], #cart-table td .qty-input {
    width: 72px; height: 32px; margin: 0 auto; display: inline-block; text-align: center;
}
#cart-table .btn { height: 30px; min-width: 60px; justify-content: center; }
#price-result table td, #price-result table th { text-align: left; }

/* ---- 21.13 列表通用左对齐兜底 ----
   V5.1 修复：这条规则原先把 .entry-item（卡片式快捷入口/快捷模板）也一并
   强制左对齐，覆盖了 .entry-item 自身声明的 `align-items:center; text-align:center`。
   结果就是用户截图里看到的：同一屏里有的卡片居中、有的靠左，排版不统一。
   卡片类条目（entry-item / course-card-item）应保持居中，这里把它们移出左对齐名单。
   —— 只有真正「左图标 + 右文字」的列表行才需要左对齐。 */
.rank-row, .todo-row, .notice-item, .prod-pick,
.price-quick-card, .script-card, .ai-quick-tags.ai-quick-scroll {
    justify-content: flex-start; text-align: left;
}

/* 卡片式条目：统一居中（图标在上、标题、说明三行居中排列）
   注意 `align-items: center` 会让子块不再横向 stretch，改为取其 max-content 宽度；
   课程卡里的 .cc-body 内容一长就会撑破卡片（实测 224 > 209）。
   所以这里给非图标子块补 `align-self: stretch`，只把「对齐」居中、宽度仍铺满。 */
.entry-item, .course-card-item {
    justify-content: center;
    align-items: center;
    text-align: center;
}
.entry-item > div:not(.entry-icon),
.entry-item > span:not(.entry-icon),
.course-card-item > div,
.course-card-item > a,
.cc-body, .cc-foot {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.entry-item h3, .entry-item p,
.entry-item .entry-title, .entry-item .entry-sub,
.course-card-item h3, .course-card-item p {
    text-align: center;
}
/* 图标与文字块都居中：文字块用 auto 左右外边距吃掉内部文本对齐差异 */
.entry-item > .entry-icon, .entry-item > i { margin-left: auto; margin-right: auto; }

/* ---- 21.14 竞品对标：AI 输出结果整体下移，模板文字左对齐 ---- */
.comp-card, .cc-body { min-width: 0; }
.comp-card .cc-text, .comp-card p, .comp-card li { text-align: left; justify-content: flex-start; }
.panel.ai-output-panel { order: 99; }
@media (min-width: 768px) {
    .comp-grid, .comp-layout { display: flex; flex-direction: column; }
    .comp-grid > .panel, .comp-layout > .panel { width: 100%; }
}

/* ================================================================
   v3.3.2 视觉与性能升级（登录页 / 系统管理员 / 表格填充 / AI助手）
   ================================================================ */

/* ---- 1. 全局表格修复：恢复原生表格布局，宽度 100% 铺满，右侧不再留白 ---- */
.app-main table { display: table; width: 100%; max-width: 100%; }

/* ---- 2. tbl-box：表格双向滚动容器（横向 + 纵向），滚动条清晰可见 ---- */
.tbl-box {
    overflow: auto;
    max-height: 72vh;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(10,31,68,.25) transparent;
}
.tbl-box::-webkit-scrollbar { width: 10px; height: 10px; }
.tbl-box::-webkit-scrollbar-track { background: #F5F7FB; border-radius: 8px; }
.tbl-box::-webkit-scrollbar-thumb { background: rgba(10,31,68,.25); border-radius: 8px; border: 2px solid #F5F7FB; }
.tbl-box::-webkit-scrollbar-thumb:hover { background: rgba(10,31,68,.4); }
.tbl-box .data-table { min-width: 100%; }
/* V4.0：不再对整表强制 nowrap（会与列宽限制冲突产生文字重叠），
   改由 main.js 的表格扫描器按"关键字段"精确加 .nowrap —— 见 theme-v4.css 第 06 节 */

/* ---- 3. 渲染性能优化：去掉昂贵的全属性过渡，行悬停只过渡背景色 ---- */
table.data-table tbody tr { transition: background-color .15s ease; }
.panel { contain: layout style; }

/* ---- 4. 登录页：ROBAM AI 横版 logo + 说明小字两行排版 ---- */
.auth-card .auth-logo .auth-logo-robam-ai {
    height: 44px; width: auto; max-width: 88%;
    object-fit: contain; border-radius: 0;
    padding: 0; background: transparent;
    display: inline-block;
}
.login-tip.login-tip-block {
    margin-top: 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: left;
    display: flex; flex-direction: column; gap: 8px;
}
.login-tip-block .login-tip-line {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 12px; line-height: 1.7; color: var(--text-secondary);
}
.login-tip-block .login-tip-line i { color: var(--brand-success); margin-top: 4px; flex-shrink: 0; }

/* ---- 5. 侧边栏：横版白色 ROBAM logo（无文字），居中展示 ---- */
.sidebar-brand { justify-content: center; }
.sidebar-logo-h {
    height: 26px; width: auto; max-width: calc(100% - 44px);
    object-fit: contain; flex-shrink: 1; display: block;
}
@media (max-width: 767px) {
    .sidebar-logo-h { max-width: calc(100% - 56px); }
    .header-left .logo { cursor: pointer; }   /* 手机端点 logo 抽出菜单 */
}

/* ---- 6. 顶栏：系统管理员固定角色标识（无下拉切换） ---- */
.role-chip-static {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--brand-primary); font-weight: 700; font-size: 13px;
    white-space: nowrap;
}
.role-chip-static i { color: var(--brand-gold); }

/* ---- 7. 注册审批：三卡等宽铺满 + 字号加大 ---- */
.ra-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ra-card {
    display: flex; align-items: center; gap: 18px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px 26px;
    min-height: 108px;
    box-shadow: 0 2px 10px rgba(10,31,68,.04);
}
.ra-card .ra-icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}
.ra-card h3 { font-size: 19px; font-weight: 800; color: var(--brand-primary); margin: 0 0 6px; line-height: 1.35; }
.ra-card p { font-size: 13.5px; color: var(--text-secondary); margin: 0; line-height: 1.6; }
@media (max-width: 900px) { .ra-cards { grid-template-columns: 1fr; } }

/* ---- 8. 筛选下拉（全部状态等）：圆角胶囊 + 细边框 + 自定义箭头 ---- */
.filter-select {
    appearance: none; -webkit-appearance: none;
    padding: 8px 34px 8px 16px;
    border: 1px solid #E3E8F0;
    border-radius: 999px;
    background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 13px center;
    font-size: 13px; color: var(--text-secondary);
    cursor: pointer; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.filter-select:hover { border-color: var(--brand-gold); }
.filter-select:focus { border-color: var(--brand-gold); box-shadow: 0 0 0 3px rgba(200,168,118,.16); }

/* ---- 9. AI 助手：悬浮球 / 面板头像 / 对话头像 全部换 ROBAM logo ---- */
.ai-fab .ai-fab-logo {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
    padding: 3px;
    display: block;
}
.ai-assistant-head .ai-head-logo {
    width: 100%; height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 2px;
    display: block;
}
.ai-avatar .ai-avatar-logo {
    width: 100%; height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    display: block;
}

/* ==========================================================================
   V5.2 性能与动画修复（只动 CSS，不改任何布局尺寸与配色）
   目标：① 菜单切换零缩放抖动  ② 弹窗秒开  ③ 滚动 60 帧  ④ 登录滚动复位
   ========================================================================== */

/* ---- 1. 禁止一切「整页 / 卡片 / 弹窗」的缩放进入动画 ----
   原 cardEnter / modalIn 用 scale(0.95~0.97) + width/height 过渡，
   每次菜单切换、每次打开弹窗都会触发一次「先放大再缩小」的视觉抖动，
   且 scale 会让浏览器重建光栅层（repaint），是掉帧主因之一。
   统一改成：只动 opacity + translateY（GPU 合成层，不触发 layout/paint）。 */
@keyframes cardEnter {
    from { opacity: 0; transform: translate3d(0, 12px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes modalIn {
    from { opacity: 0; transform: translate3d(0, 10px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.login-card, .auth-card { animation: cardEnter .28s cubic-bezier(.22, 1, .36, 1); }
.modal, .modal-content, .modal-mask.show .modal, .modal-mask.show .modal-content {
    animation: modalIn .18s cubic-bezier(.22, 1, .36, 1);
}

/* 全站禁止「以宽高做过渡」引发的强制重排（进度条改用 transform: scaleX） */
.progress-bar, #global-loading-bar {
    transition: transform .3s ease, opacity .3s ease !important;
}
#global-loading-bar {
    width: 100% !important;
    transform: scaleX(0);
    transform-origin: 0 50%;
    will-change: transform, opacity;
}
#global-loading-bar.on { transform: scaleX(.82); opacity: 1; }
.progress-bar { transform-origin: 0 50%; }

/* 页面级淡入：只作用在「唯一」的主容器上（1 个合成层），
   不逐卡片/逐面板做动画 —— 否则一页几十个面板会同时建层，反而更卡。 */
.app-main {
    margin-top: 64px;
    animation: cardEnter .22s cubic-bezier(.22, 1, .36, 1);
    will-change: opacity, transform;
}
/* 兜底：任何元素都不允许出现整页缩放（防止后续误加 scale 动画） */
.app-layout, .page-wrap, .panel, .card, .stat-card { transform: none; }

/* ---- 2. 菜单切换：淡入淡出 + 骨架屏，不闪白、不缩放 ----
   .rb-navigating 由 main.js 在点击菜单时挂上，新页面 DOMContentLoaded 时移除。 */
.app-main {
    margin-top: 64px; position: relative; }
body.rb-navigating .page-wrap {
    opacity: .001;                 /* 用 opacity 而不是 display，避免高度塌陷引起的抖动 */
    transform: translate3d(0, 0, 0);
}
.rb-page-skeleton {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: #fff;
    padding: 24px;
    overflow: hidden;
    animation: cardEnter .16s ease;
}
.rb-page-skeleton .sk {
    height: 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    background: linear-gradient(90deg, #EEF1F7 25%, #F7F9FC 37%, #EEF1F7 63%);
    background-size: 400% 100%;
    animation: rbSkeleton 1.1s ease infinite;
}
.rb-page-skeleton .sk.t { height: 26px; width: 34%; margin-bottom: 22px; }
.rb-page-skeleton .sk.c { height: 148px; }
.rb-page-skeleton .sk.w40 { width: 40%; }
.rb-page-skeleton .sk.w60 { width: 60%; }
.rb-page-skeleton .sk.w80 { width: 80%; }
.rb-page-skeleton.is-out { opacity: 0; transition: opacity .16s ease; pointer-events: none; }
@keyframes rbSkeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- 3. 滚动性能：全站原生滚动 + 惯性 + 防止滚动链穿透 ---- */
.app-main, .tbl-box, .tbl-scroll-y, .table-scroll, .table-wrap,
.modal-body, .modal, .modal-content, .ai-assistant-body, .panel-body,
.chart-legend-scroll, .messages-list, .notice-list, .app-sidebar {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: auto;          /* 平滑滚动由浏览器处理，不用 JS 模拟 */
}
/* 触摸设备消除 300ms 点击延迟 + 禁止双击缩放引起的布局抖动 */
button, .btn, a, .menu-item, .todo-row, .icon-btn { touch-action: manipulation; }

/* ---- 4. 绘制开销：卡片 / 列表项限制渲染边界（contain: layout paint）----
   contain 让浏览器把每个卡片当成独立渲染单元，滚动时只重绘可视区那几个。 */
.panel, .card, .stat-card, .todo-row, .list-item, .doc-item, .course-card,
.notice-item, .msg-item, .todo-card, .kpi-card, .ai-bubble, .table-pager {
    contain: layout paint style;
}
/* 长列表 / 表格行：视口外的行跳过渲染与布局（浏览器原生「虚拟滚动」）。
   不改 DOM、不影响打印与 Ctrl+F，只让不可见内容不参与每帧计算。 */
.data-table tbody tr,
.todo-row, .list-item, .doc-item, .msg-item, .notice-item {
    content-visibility: auto;
    contain-intrinsic-size: auto 46px;
}

/* ---- 5. 删除高开销的毛玻璃与多余阴影（绘制压力最大的两类属性）---- */
.login-card, .auth-card, .login-container::before, .auth-container::before {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.modal-mask {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(8, 18, 38, .48) !important;   /* 用半透明底色代替模糊，视觉几乎一致 */
    contain: layout paint style;
}
/* 只清理「每帧都要重算」的滤镜类属性，卡片自身阴影保持原样（视觉不变）。
   全屏遮罩的 backdrop-filter 尤其贵：弹窗一开，浏览器要对整屏内容逐帧做模糊。 */
.ai-assistant-mask, .ai-result {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
/* 无限循环的装饰动画在不可见时暂停，滚动时不再持续占用合成器 */
.ai-fab, .float-glow, .pulse-dot { will-change: transform, opacity; }
.app-main.rb-scrolling .ai-fab { animation-play-state: paused; }

/* ---- 6. 点击即时反馈（减少点击延迟感知）----
   pointerdown 即触发，不等 click，手指落下瞬间就有视觉回应。 */
.btn, .icon-btn, .menu-item, .todo-row, .modal-close, .btn-primary {
    transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn.rb-pressed, .icon-btn.rb-pressed, .btn-primary.rb-pressed {
    transform: scale(.97);
    filter: brightness(.96);
    transition: transform .06s ease;
}

/* ---- 7. 分页条移出滚动容器后，固定在表格下方（不再随内容滚走）---- */
.table-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px 0 4px;
    background: #fff;
    contain: layout paint;
}
.table-pager .pager-info { margin-right: auto; font-size: 12.5px; color: var(--text-light, #8A94A6); }

/* ---- 8. 降低动效偏好：直接关掉动画 ---- */
@media (prefers-reduced-motion: reduce) {
    .app-main, .page-wrap, .panel, .card, .stat-card { animation: none !important; }
}

/* ---- 9. 超长列表（>120 项）的原生虚拟渲染 ----
   浏览器只渲染视口内 + 邻近的条目，视口外的不参与布局与绘制，
   等效于虚拟滚动，但 DOM 结构、Ctrl+F、打印全部保持原样。 */
.rb-virtual > * {
    content-visibility: auto;
    contain-intrinsic-size: auto 56px;
}

/* ============================================================================
   V5.5（报障 13/14）报价清单：删除按钮收进产品格，表格更窄更美观
   ============================================================================ */
.quote-table { table-layout: auto; }
.quote-prod { display: flex; align-items: center; gap: 8px; }
.quote-prod > b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-del {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border: none; border-radius: 6px;
    background: rgba(217, 45, 32, .08);
    color: #D92D20;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: background .14s ease;
}
.quote-del:hover { background: rgba(217, 45, 32, .18); }
.quote-table th, .quote-table td { vertical-align: middle; }

/* ============================================================================
   V5.5（报障 16）竞品反制话术：竖排换行，从所属竞品行正下方开始逐条排列
   用户原话：「AI 生成反制话术应该横向排列且换行，从例如方太的表格下方
   开始排列文字，不要横向排列」
   —— 即：不要挤在一横排里，改为一条一行、自动换行的纵向列表。
   ============================================================================ */
.counter-cell {
    background: var(--bg-page, #F5F7FB) !important;
    padding: 14px 18px !important;
}
.counter-block { max-width: 100%; }
.counter-head {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-primary, #0A1F44);
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.counter-head i { color: #C8A876; }
.counter-list { display: flex; flex-direction: column; gap: 8px; }
.counter-line {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: #fff;
    border: 1px solid var(--border-color, #E6EAF2);
    border-left: 3px solid #C8A876;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-secondary, #33415C);
    white-space: normal;
    word-break: break-word;
}
.counter-no {
    flex-shrink: 0;
    color: #C8A876;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.75;
}
.counter-text { flex: 1; min-width: 0; }
.counter-text p { margin: 0; }
.counter-text p + p { margin-top: 4px; }
@media (max-width: 640px) {
    .counter-cell { padding: 10px 12px !important; }
    .counter-line { font-size: 12px; padding: 8px 10px; }
}

/* ============================================================================
   V5.5 站内信附件（需求第 25 条）
   —— 发送弹窗上传区 + 消息列表/详情内的附件胶囊
   ============================================================================ */
.msg-attach-drop {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 14px; margin-top: 2px;
    border: 1.5px dashed var(--border-color, #DCE4EF);
    border-radius: 10px; background: #FAFCFF;
    color: var(--text-light, #7A889E); font-size: 12.5px;
    cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.msg-attach-drop:hover, .msg-attach-drop.dragging {
    border-color: var(--brand-gold, #C8A876);
    background: rgba(200, 168, 118, .06);
    color: var(--brand-gold-dark, #8A6D33);
}
.msg-attach-drop i { font-size: 15px; }

.msg-attach-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.msg-attach-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: 8px;
    background: #F5F8FC; border: 1px solid #E4EBF5;
    font-size: 12.5px; color: var(--text-main, #1B2841);
}
.msg-attach-item i { color: var(--brand-gold, #C8A876); flex: 0 0 auto; }
.msg-attach-item.pending { opacity: .7; }
.msg-attach-name {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg-attach-size { color: var(--text-light, #8A96A8); font-size: 11.5px; flex: 0 0 auto; }
.msg-attach-x {
    flex: 0 0 auto; border: none; background: transparent;
    color: #97A3B6; cursor: pointer; font-size: 15px; line-height: 1;
    padding: 0 2px; border-radius: 4px;
}
.msg-attach-x:hover { color: #D92D20; background: rgba(217, 45, 32, .08); }

/* 消息内的附件胶囊（列表 + 详情共用） */
.msg-attach-view { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.msg-attach-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 18px;
    background: rgba(27, 127, 212, .08); color: #1B7FD4;
    font-size: 11.5px; text-decoration: none; max-width: 100%;
    transition: background .14s ease;
}
.msg-attach-chip:hover { background: rgba(27, 127, 212, .16); text-decoration: none; }
.msg-attach-chip i { font-size: 14px; }
.msg-attach-chip-size { color: #7A889E; font-size: 10.5px; }

/* ===== V6.2 ICP: 全局备案信息条（三端自适应） ===== */
.icp-bar{margin:28px auto 0;padding:14px 8px 6px;text-align:center;font-size:12px;line-height:1.9;color:#8a94a6;border-top:1px solid rgba(15,42,84,.08);letter-spacing:.2px}
.icp-bar span{display:inline-block}
.icp-bar a{color:#8a94a6;text-decoration:none;margin-left:8px}
.icp-bar a:hover{color:#1a56db;text-decoration:underline}
@media (max-width:768px){.icp-bar{font-size:11px;padding:12px 6px 4px;margin-top:20px}}
@media (max-width:420px){.icp-bar{font-size:10px}}
