/* ==========================================================================
   致远信息管理系统 - 全局样式与设计系统 (styles.css)
   ========================================================================== */

/* 1. 基础配置与设计变量 */
:root {
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
    --font-primary: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', 'Noto Sans SC', sans-serif;
    
    /* 品牌色彩 (不变常量) */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-cyan: #06b6d4;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
}

/* 2. 黑暗模式变量 (默认) */
body.dark-theme {
    --bg-main: #070913;
    --bg-glow-1: rgba(37, 99, 235, 0.18);
    --bg-glow-2: rgba(6, 182, 212, 0.15);
    --bg-glow-3: rgba(147, 51, 234, 0.1);
    
    --card-bg: rgba(15, 23, 42, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-blur: 24px;
    --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-focus-border: #2563eb;
    --input-text: #f8fafc;
    --input-placeholder: #475569;
    
    --tab-inactive: #64748b;
    --sso-bg: rgba(255, 255, 255, 0.04);
    --sso-border: rgba(255, 255, 255, 0.08);
    --sso-hover: rgba(255, 255, 255, 0.08);
    
    --panel-card-bg: rgba(15, 23, 42, 0.35);
    --table-hover: rgba(255, 255, 255, 0.02);
}

/* 3. 明亮模式变量 */
body.light-theme {
    --bg-main: #f4f7fc;
    --bg-glow-1: rgba(37, 99, 235, 0.1);
    --bg-glow-2: rgba(6, 182, 212, 0.08);
    --bg-glow-3: rgba(147, 51, 234, 0.05);
    
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(37, 99, 235, 0.12);
    --card-blur: 24px;
    --card-shadow: 0 20px 40px rgba(37, 99, 235, 0.06);
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #8c9ba5;
    
    --input-bg: rgba(255, 255, 255, 0.85);
    --input-border: #cbd5e1;
    --input-focus-border: #2563eb;
    --input-text: #1e293b;
    --input-placeholder: #94a3b8;
    
    --tab-inactive: #94a3b8;
    --sso-bg: rgba(0, 0, 0, 0.02);
    --sso-border: rgba(0, 0, 0, 0.08);
    --sso-hover: rgba(37, 99, 235, 0.05);
    
    --panel-card-bg: rgba(255, 255, 255, 0.9);
    --table-hover: rgba(37, 99, 235, 0.02);
}

/* 4. 基础标签重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    transition: background-color 0.5s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

button {
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

input {
    border: none;
    outline: none;
    font-family: inherit;
}

/* 5. 动态背景层 */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.8;
    transition: var(--transition-smooth);
    animation: floating-glow 20s infinite alternate ease-in-out;
}

.bg-glow-1 {
    top: -10%;
    right: 10%;
    width: 600px;
    height: 600px;
    background-color: var(--bg-glow-1);
    animation-duration: 25s;
}

.bg-glow-2 {
    bottom: -10%;
    left: 5%;
    width: 500px;
    height: 500px;
    background-color: var(--bg-glow-2);
    animation-duration: 20s;
    animation-delay: -5s;
}

.bg-glow-3 {
    top: 30%;
    left: 45%;
    width: 400px;
    height: 400px;
    background-color: var(--bg-glow-3);
    animation-duration: 30s;
    animation-delay: -10s;
}

.bg-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 85%);
    opacity: 0.8;
}

/* 6. 主题切换器 */
.theme-toggle-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--card-shadow);
    z-index: 100;
    transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
    transform: rotate(30deg) scale(1.05);
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.3);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    position: absolute;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

body.dark-theme .sun-icon {
    opacity: 1;
    transform: scale(1);
}

body.dark-theme .moon-icon {
    opacity: 0;
    transform: scale(0.5);
}

body.light-theme .sun-icon {
    opacity: 0;
    transform: scale(0.5);
}

body.light-theme .moon-icon {
    opacity: 1;
    transform: scale(1);
}

/* 7. 主容器框架 */
.main-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    min-height: 700px;
    display: flex;
    z-index: 1;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}

/* 8. 左侧展示面板 */
.brand-panel {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
    padding: 6px;
}

.logo-svg {
    width: 100%;
    height: 100%;
    stroke: #ffffff;
}

.logo-box.small {
    width: 38px;
    height: 38px;
    border-radius: 8px;
}

.brand-title-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--text-primary) 0%, var(--color-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 4px;
}

.brand-content {
    max-width: 580px;
    margin-top: auto;
    margin-bottom: auto;
    z-index: 2;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 16px;
    background: linear-gradient(to right, var(--text-primary) 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.version-tag {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--color-primary);
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
    letter-spacing: 0.5px;
    -webkit-text-fill-color: initial; /* Override text gradient */
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
}

/* 特色卡片组合 */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition-smooth);
}

.feature-card:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.15);
    transform: translateX(8px);
}

body.light-theme .feature-card {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(0, 0, 0, 0.03);
}

body.light-theme .feature-card:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.1);
}

.feat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.feat-icon svg {
    width: 20px;
    height: 20px;
}

.feat-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.feat-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 动感业务节点流程图 */
.workflow-canvas-container {
    width: 100%;
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 16px;
    padding: 10px;
    border: 1px dashed rgba(255,255,255,0.03);
}

body.light-theme .workflow-canvas-container {
    background: rgba(0, 0, 0, 0.01);
    border-color: rgba(0, 0, 0, 0.05);
}

.workflow-nodes {
    width: 100%;
    height: auto;
}

.node-dot {
    fill: var(--color-primary);
    stroke: var(--bg-main);
    stroke-width: 3px;
    transition: var(--transition-smooth);
}

.node-ring {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 1.5px;
    opacity: 0.3;
    animation: ripple 2s infinite ease-out;
    transform-origin: center;
}

.wf-node:nth-child(even) .node-ring {
    animation-delay: 1s;
}

.node-text {
    font-size: 10px;
    fill: var(--text-secondary);
    font-weight: 500;
}

.active-node-line {
    animation: dash 12s linear infinite;
}

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

/* 9. 右侧登录面板 */
.login-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px;
    z-index: 2;
    transition: var(--transition-smooth);
}

.login-card-wrapper {
    width: 100%;
    max-width: 440px;
    position: relative;
}

.login-card {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    animation: card-appear 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-logo-header {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.mobile-logo-svg {
    width: 36px;
    height: 36px;
    color: var(--color-primary);
}

.mobile-logo-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* 静态登录标题样式 */
.login-header-static {
    text-align: center;
    margin-bottom: 32px;
}

.login-header-static h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.login-header-static .line-decor {
    display: block;
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-cyan) 100%);
    margin: 0 auto;
    border-radius: 2px;
}

/* 选项卡内容兼容 (账号登录默认展示) */
.tab-content {
    display: block;
    animation: fade-slide-up 0.5s ease forwards;
}

/* 表单输入组 */
.input-group {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.input-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forget-pwd-link {
    font-size: 12px;
    color: var(--text-muted);
}

.forget-pwd-link:hover {
    color: var(--color-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    height: 48px;
    padding: 0 44px;
    font-size: 15px;
    border-radius: 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    transition: var(--transition-fast);
}

.input-wrapper input::placeholder {
    color: var(--input-placeholder);
}

.input-wrapper input:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    background: var(--bg-main);
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.clear-btn, .pwd-toggle {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 4px;
    border-radius: 4px;
}

.clear-btn:hover, .pwd-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.clear-btn svg, .pwd-toggle svg {
    width: 16px;
    height: 16px;
}

.clear-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.clear-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.error-msg {
    font-size: 12px;
    color: var(--color-error);
    display: none;
    animation: fade-in 0.3s ease;
}

/* 验证码样式 */
.captcha-wrapper {
    display: flex;
    gap: 12px;
}

.captcha-input-box {
    flex: 1.2;
}

.captcha-img-box {
    flex: 0.8;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: #ffffff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#captchaCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.refresh-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 99, 235, 0.9);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-fast);
}

.captcha-img-box:hover .refresh-indicator {
    opacity: 1;
}

.refresh-indicator svg {
    width: 20px;
    height: 20px;
    animation: spin 3s infinite linear;
}

/* 记住密码与安全条幅 */
.remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    margin-bottom: 26px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
    color: var(--text-secondary);
    gap: 8px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 18px;
    width: 18px;
    border-radius: 5px;
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    transition: var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--color-primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.safe-badge {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-icon {
    width: 12px;
    height: 12px;
    color: var(--color-success);
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #3b82f6 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
    background: linear-gradient(135deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-loader {
    display: none;
    position: absolute;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .btn-loader {
    display: flex;
}

/* 旋转加载动画 */
.spinner {
    animation: rotate 2s infinite linear;
    width: 24px;
    height: 24px;
}

.spinner .path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: dash-spinner 1.5s infinite ease-in-out;
}

/* 扫码登录页 */
.qr-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.qr-box-outer {
    padding: 12px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.qr-box {
    width: 170px;
    height: 170px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-svg {
    width: 100%;
    height: 100%;
}

.qr-scan-overlay, .qr-expired-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.qr-scan-overlay.visible, .qr-expired-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.scan-success-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-success-icon svg {
    width: 24px;
    height: 24px;
}

.qr-scan-overlay p, .qr-expired-overlay p {
    font-size: 14px;
    font-weight: 600;
}

.qr-scan-overlay .sub {
    font-size: 11px;
    color: var(--text-secondary);
}

.refresh-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.refresh-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.refresh-icon-btn svg {
    width: 18px;
    height: 18px;
}

.refresh-qr-btn {
    padding: 6px 16px;
    border-radius: 20px;
    background: var(--color-primary);
    color: white;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    margin-top: 4px;
}

.refresh-qr-btn:hover {
    background: var(--color-primary-hover);
}

.qr-tips {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.qr-tips .hl {
    color: var(--color-primary);
    font-weight: 600;
}

.qr-status-desc {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse-ring 1.5s infinite;
}

/* SSO 第三方登录分界线 */
.sso-divider {
    display: flex;
    align-items: center;
    margin-top: 32px;
    margin-bottom: 20px;
}

.sso-divider .line {
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

.sso-divider .text {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 16px;
    letter-spacing: 0.5px;
}

.sso-options {
    display: flex;
    gap: 12px;
}

.sso-btn {
    flex: 1;
    height: 42px;
    border-radius: 10px;
    background: var(--sso-bg);
    border: 1px solid var(--sso-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.sso-btn:hover {
    background: var(--sso-hover);
    border-color: rgba(37, 99, 235, 0.25);
    color: var(--text-primary);
}

.sso-icon {
    width: 16px;
    height: 16px;
}

.icon-wecom { color: #238efa; }
.icon-ding { color: #007fff; }
.icon-lark { color: #00d2c4; }

.mobile-footer {
    display: none;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 30px;
}

/* ==========================================================================
   10. 模拟系统控制台仪表盘样式 (dashboard)
   ========================================================================== */
.dashboard-panel {
    position: absolute;
    top: 0;
    left: 100vw; /* Hidden outside right screen edge */
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    z-index: 10;
    display: flex;
    flex-direction: column;
    transition: transform 0.8s cubic-bezier(0.76, 0, 0.24, 1);
    opacity: 0;
    overflow-y: auto;
}

/* Active panel layout transition in JS */
body.in-dashboard .main-wrapper {
    transform: translateX(-100vw);
}

body.in-dashboard .dashboard-panel {
    transform: translateX(-100vw);
    opacity: 1;
}

/* 仪表盘头部 */
.dash-header {
    height: 70px;
    padding: 0 40px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dash-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-title-group h2 {
    font-size: 16px;
    font-weight: 600;
}

.badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.badge.online {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--color-success);
}

.dash-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 10px;
    color: var(--text-muted);
}

.avatar-box {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-primary);
}

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

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--color-error);
}

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

/* 仪表盘主体 */
.dash-body {
    flex: 1;
    padding: 32px 40px;
    max-width: 1400px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 欢迎页区块 */
.welcome-section {
    display: flex;
    gap: 20px;
}

.welcome-text-card {
    flex: 1;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 1px solid var(--card-border);
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-text-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}

.greeting-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.hl-count {
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 700;
    margin: 0 2px;
}

.text-success {
    color: var(--color-success);
    font-weight: 600;
}

.sys-time-card {
    width: 260px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.time-now {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 1px;
}

.date-now {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 4格指标 */
.dash-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.icon-blue {
    background: rgba(37, 99, 235, 0.08);
    color: var(--color-primary);
}

.icon-green {
    background: rgba(16, 185, 129, 0.08);
    color: var(--color-success);
}

.icon-purple {
    background: rgba(147, 51, 234, 0.08);
    color: #9333ea;
}

.icon-orange {
    background: rgba(245, 158, 11, 0.08);
    color: var(--color-warning);
}

.stat-data {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.stat-data .number {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
}

.stat-data .unit {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.trend {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend.up {
    color: var(--color-success);
}

.trend.down {
    color: var(--color-error);
}

.trend svg {
    width: 10px;
    height: 10px;
}

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

/* 两列大板块组合 */
.dash-row {
    display: flex;
    gap: 20px;
}

.panel-card {
    border-radius: 16px;
    background: var(--panel-card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 30px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}

.panel-card.flex-2 { flex: 2; }
.panel-card.flex-1 { flex: 1; }

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

.panel-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.p-icon {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
}

.panel-title-row h5 {
    font-size: 14px;
    font-weight: 600;
}

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

.more-btn:hover {
    color: var(--color-primary);
}

.panel-body {
    padding: 20px 24px;
    flex: 1;
}

/* 流程图表格 */
.workflow-table {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.table-header {
    display: flex;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.table-rows {
    display: flex;
    flex-direction: column;
}

.table-row {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 13px;
    transition: var(--transition-fast);
}

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

.table-row:hover {
    background: var(--table-hover);
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 8px;
}

.col-title {
    flex: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 15px;
}

.col-sender { flex: 1; }
.col-type { flex: 0.8; color: var(--text-muted); }
.col-date { flex: 0.8; color: var(--text-muted); }
.col-priority { flex: 0.6; text-align: right; }

.highlight-title {
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.highlight-title:hover {
    color: var(--color-primary);
}

.priority-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
}

.priority-badge.high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.priority-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.priority-badge.low {
    background: rgba(37, 99, 235, 0.08);
    color: var(--color-primary);
}

/* 监控条 */
.resource-chart-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.r-progress-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.r-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
}

.r-labels .value {
    color: var(--text-primary);
}

.font-num {
    font-family: var(--font-display);
}

.progress-bar-container {
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

body.dark-theme .progress-bar-container {
    background: rgba(255, 255, 255, 0.04);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-blue { background: linear-gradient(90deg, var(--color-primary), var(--color-cyan)); }
.progress-green { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-purple { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.progress-orange { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* ==========================================================================
   11. Toast 吐司提示系统样式
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-20px);
    opacity: 0;
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: var(--transition-smooth);
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

.toast-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

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

.toast-close {
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

/* 不同类型 Toast 样式 */
.toast.success { border-left: 4px solid var(--color-success); }
.toast.success .toast-icon { color: var(--color-success); }

.toast.error { border-left: 4px solid var(--color-error); }
.toast.error .toast-icon { color: var(--color-error); }

.toast.info { border-left: 4px solid var(--color-primary); }
.toast.info .toast-icon { color: var(--color-primary); }

.toast.warning { border-left: 4px solid var(--color-warning); }
.toast.warning .toast-icon { color: var(--color-warning); }

/* ==========================================================================
   12. 关键帧动画定义
   ========================================================================== */
@keyframes floating-glow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, 10%) scale(1.1); }
    100% { transform: translate(-5%, -5%) scale(0.95); }
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes ripple {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes dash {
    to {
        stroke-dashoffset: -100;
    }
}

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

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash-spinner {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

@keyframes card-appear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fade-slide-up {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes toast-in {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
}

/* ==========================================================================
   13. 响应式布局优化 (Media Queries)
   ========================================================================== */
@media (max-width: 1024px) {
    .brand-panel {
        display: none; /* Hide brand panel on smaller layouts, focus on login card */
    }
    
    .login-panel {
        flex: 1;
        padding: 24px;
        min-height: 100vh;
        background-color: var(--bg-main);
    }
    
    .login-card-wrapper {
        max-width: 460px;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .mobile-logo-header {
        display: flex;
    }
    
    .mobile-footer {
        display: block;
    }
    
    /* Dashboard Responsive */
    .dash-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dash-row {
        flex-direction: column;
    }
    
    .welcome-section {
        flex-direction: column;
    }
    
    .sys-time-card {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .dash-header {
        padding: 0 16px;
    }
    
    .dash-user-profile .user-info {
        display: none; /* Hide user name string on small screens */
    }
    
    .dash-body {
        padding: 16px;
    }
    
    .dash-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .table-header .col-type, 
    .table-header .col-date,
    .table-row .col-type,
    .table-row .col-date {
        display: none; /* Hide secondary columns in table on mobile */
    }
}
