/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ===== 现代科技蓝配色体系 (2026-11-18 UI升级) ===== */
    --primary: #2563eb;          /* 主色：明亮科技蓝 */
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --accent: #0ea5e9;           /* 强调色：青蓝 */
    --accent-2: #06b6d4;         /* 辅助青色，用于渐变 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
    --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.08), 0 2px 4px -2px rgba(15,23,42,0.06);
    --shadow-lg: 0 10px 25px -5px rgba(15,23,42,0.1), 0 8px 10px -6px rgba(15,23,42,0.05);
    --shadow-glow: 0 8px 24px -6px rgba(37,99,235,0.35);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== 布局 ========== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent), #64b5f6);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon {
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
}

.logo-text h1 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.logo-text p {
    font-size: 11px;
    opacity: 0.7;
}

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

.nav-section {
    margin-bottom: 8px;
}

.nav-label {
    display: block;
    padding: 8px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    font-weight: 500;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.08);
}

.nav-item.active {
    background: rgba(255,255,255,0.12);
    border-left-color: var(--accent);
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 13px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 11px;
    opacity: 0.6;
    text-align: center;
}

/* ========== 主内容区 ========== */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    background: var(--bg-card);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

#current-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.content-wrapper {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* ========== 模块内容 ========== */
.module-content {
    display: none;
    position: relative;
    overflow: hidden;
}

.module-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
    background: #f5f7fa;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.module-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========== 数据来源标签 ========== */
.data-source {
    font-size: 12px;
    color: var(--accent);
    background: rgba(66, 165, 245, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* ========== 仪表盘 ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 1500px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.status-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 14px 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.status-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px) scale(1.02);
    border-color: var(--accent);
}

.card-bg {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.05) 0%, rgba(26, 35, 126, 0.03) 100%);
    border-radius: 50%;
    transition: all 0.4s ease;
}

.status-card:hover .card-bg {
    top: -60%;
    right: -60%;
    width: 120%;
    height: 120%;
}

.card-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.15), rgba(26, 35, 126, 0.1));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.status-card:hover .card-icon {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(66, 165, 245, 0.25), rgba(26, 35, 126, 0.15));
}

.card-info {
    flex: 1;
}

.card-info h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.card-info .status {
    font-size: 11px;
    margin-bottom: 6px;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 500;
}

.status.online {
    background: #e8f5e9;
    color: var(--success);
}

.status.offline {
    background: #ffebee;
    color: var(--danger);
}

.status.pending {
    background: #fff3e0;
    color: #f57c00;
}

/* 待集成模块导航项 */
.nav-item-pending {
    opacity: 0.7;
}

.nav-item-pending .nav-badge {
    font-size: 10px;
    padding: 1px 6px;
    background: #f57c00;
    color: white;
    border-radius: 10px;
    margin-left: auto;
}

/* 待集成状态卡片 */
.status-card-pending {
    opacity: 0.7;
    border: 2px dashed #ddd;
}

.status-card-pending:hover {
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* 待集成占位面板 */
.pending-panel {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.pending-panel .pending-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.pending-panel h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.pending-panel p {
    font-size: 16px;
    margin-bottom: 8px;
}

.pending-panel .pending-desc {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

.card-info .desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.45;
    display: block;
}

.btn-enter {
    padding: 5px 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-enter:hover {
    background: var(--primary-light);
}

/* ========== 同步面板 ========== */
.sync-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.sync-panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.sync-card {
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sync-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(66, 165, 245, 0.1);
}

.sync-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sync-card:hover::before {
    opacity: 1;
}

.sync-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sync-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.sync-source {
    font-size: 11px;
    padding: 3px 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 20px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sync-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.sync-last {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding: 8px 12px;
    background: #f5f7fa;
    border-radius: 6px;
}

.sync-actions {
    display: flex;
    gap: 8px;
}

.sync-all {
    text-align: center;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

/* ========== 信息面板 ========== */
.info-panel {
    background: linear-gradient(180deg, var(--bg-card) 0%, #fafbfc 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.info-panel::after {
    content: '📋';
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 80px;
    opacity: 0.05;
    transform: rotate(15deg);
}

.info-panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
    position: relative;
    z-index: 1;
}

.info-panel p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.info-panel ul {
    list-style: none;
    padding-left: 0;
    position: relative;
    z-index: 1;
}

.info-panel li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 10px 14px;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    transition: all 0.2s ease;
}

.info-panel li:hover {
    background: rgba(66, 165, 245, 0.05);
    transform: translateX(4px);
}

/* ========== 表单样式 ========== */
.form-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.form-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.param-group {
    background: #fafbfc;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.param-group h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.form-control {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.1);
    background: white;
}

.form-control:read-only {
    background: #f5f5f5;
    color: var(--text-muted);
}

.form-control:disabled {
    background: #f5f5f5;
    color: var(--text-muted);
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ========== 按钮 ========== */
.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: #f5f5f5;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #eeeeee;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #1b5e20;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b71c1c;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #bf360c;
}

.btn-info {
    background: var(--accent);
    color: white;
}

.btn-info:hover {
    background: #1976d2;
}

.btn-large {
    padding: 14px 32px;
    font-size: 15px;
}

/* ========== 表格 ========== */
.table-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.table-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #fafafa;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tr:hover {
    background: #fafafa;
}

td {
    color: var(--text-primary);
}

.btn-small {
    padding: 6px 12px;
    font-size: 11px;
}

/* ========== 上传区域 ========== */
.upload-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--accent);
    background: rgba(66, 165, 245, 0.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-area p {
    font-size: 14px;
    color: var(--text-secondary);
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f5f5f5;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

/* ========== 结果区域 ========== */
.result-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.result-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.result-summary {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px;
    background: #fff3e0;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--warning);
}

.result-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--warning);
}

.sheet-result {
    margin-bottom: 16px;
    padding: 16px;
    background: #fafafa;
    border-radius: var(--radius-sm);
}

.sheet-result h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.ng-item {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border-light);
}

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

.ng-type {
    font-weight: 600;
    min-width: 80px;
}

.ng-type.upper {
    color: var(--danger);
}

.ng-type.lower {
    color: var(--warning);
}

.ng-type.empty {
    color: #9c27b0;
}

/* ========== 启动区域 ========== */
.launch-section {
    display: flex;
    justify-content: center;
    padding: 24px;
}

.launch-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    max-width: 400px;
    width: 100%;
}

.launch-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.launch-card h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.launch-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.launch-card .hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ========== 同步栏 ========== */
.sync-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#dbStatus {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: var(--radius-sm);
}

/* 试模进度追踪的同步状态文字（id=trackingStatus）。
   app.js 的 syncTracking() / initTrackingPanel() 会写入它的 textContent。 */
.tracking-status {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: var(--radius-sm);
    max-width: 520px;
    line-height: 1.4;
}

/* ========== Toast提示 ========== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

/* ========== 修模单系统样式 ========== */
.mold-status-pill:hover {
    border-color: var(--primary) !important;
    background: #e8eaf6 !important;
    color: var(--primary) !important;
    transform: translateY(-1px);
}

.mold-status-pill.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
    border-color: var(--primary) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.mold-reason-tag:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    transform: translateY(-1px);
}

/* ========== 帮助模态框 ========== */
.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

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

.help-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.help-modal-content {
    position: relative;
    width: 90%;
    max-width: 1100px;
    height: 90%;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    flex-shrink: 0;
}

.help-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.help-icon {
    font-size: 20px;
}

.help-modal-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.help-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.help-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.help-sidebar {
    width: 280px;
    background: #f8fafc;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.help-search {
    padding: 16px;
    position: relative;
}

.help-search input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: white;
    transition: all 0.2s ease;
}

.help-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.1);
}

.search-icon {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-muted);
}

.help-nav {
    padding: 0 12px;
    flex: 1;
}

.help-nav-section {
    margin-bottom: 20px;
}

.help-nav-title {
    display: block;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.help-nav ul {
    list-style: none;
    padding: 0;
}

.help-nav li {
    margin-bottom: 4px;
}

.help-nav a {
    display: block;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.help-nav a:hover {
    background: rgba(66, 165, 245, 0.1);
    color: var(--accent);
}

.help-nav a.active {
    background: rgba(66, 165, 245, 0.15);
    color: var(--primary);
    font-weight: 500;
}

.help-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.help-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.help-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.help-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 10px;
}

.help-section p {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.help-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.help-source {
    font-size: 12px;
    padding: 4px 12px;
    background: rgba(66, 165, 245, 0.1);
    color: var(--accent);
    border-radius: 20px;
    font-weight: 500;
}

.help-local {
    font-size: 12px;
    padding: 4px 12px;
    background: rgba(46, 125, 50, 0.1);
    color: var(--success);
    border-radius: 20px;
    font-weight: 500;
}

.help-steps {
    margin: 16px 0;
}

.help-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: #fafbfc;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.step-number {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.help-step span:last-child {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.help-list {
    list-style: none;
    padding: 0;
}

.help-list li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    font-size: 13px;
}

.help-list li::before {
    content: '•';
    color: var(--accent);
    font-weight: bold;
    position: absolute;
    left: 6px;
}

.help-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: 8px;
    margin: 12px 0;
    border-left: 4px solid var(--success);
}

.tip-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.help-tip span:last-child {
    font-size: 13px;
    color: var(--success);
}

.help-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fff3e0, #fff8e1);
    border-radius: 8px;
    margin: 12px 0;
    border-left: 4px solid var(--warning);
}

.warning-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.help-warning span:last-child {
    font-size: 13px;
    color: var(--warning);
}

.help-faq-item {
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #fafbfc;
    border-radius: 8px;
}

.help-faq-item h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.help-faq-item p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.help-section.hidden {
    display: none;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .sync-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== AI 数据库搜索提示 ========== */
.ai-db-indicator {
    font-size: 12px;
    color: #42a5f5;
    padding: 4px 8px;
    margin-bottom: 8px;
    background: rgba(66, 165, 245, 0.08);
    border-radius: 4px;
    display: inline-block;
    animation: ai-pulse 1.5s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.mold-history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}
.mold-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.mold-history-table th {
    padding: 8px 10px;
    text-align: left;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
}
.mold-history-table td {
    padding: 6px 10px;
}
.mold-history-table td.truncate {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mold-history-table td.truncate-wide {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mold-history-table tr.row {
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.mold-history-table tr.row:hover {
    background: var(--bg-secondary);
}
.mold-history-table .action-center {
    padding: 6px 10px;
    text-align: center;
}
.mold-history-table .download-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 11px;
}
.mold-history-count {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 0;
}

/* ========== 机台实时看板（试模追踪模块内嵌分页） ========== */
.mb-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 10px 0 12px; }
.mb-tab {
    padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
    background: transparent; border: none; border-bottom: 2px solid transparent;
    color: var(--text-secondary); border-radius: 6px 6px 0 0; transition: var(--transition);
}
.mb-tab:hover { color: var(--accent); background: rgba(66,165,245,0.08); }
.mb-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.mb-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.mb-toolbar .form-control { width: auto; min-width: 110px; padding: 5px 10px; font-size: 13px; }
.mb-stamp { font-size: 12px; color: var(--text-muted); margin-left: 4px; }

.mb-note {
    background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--warning);
    border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; color: var(--text-secondary);
    line-height: 1.7; margin-bottom: 12px;
}
.mb-note code { background: #f2f4f7; padding: 1px 4px; border-radius: 3px; font-size: 11px; }

.mb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; margin-bottom: 12px; }
.mb-kpi {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 12px; box-shadow: var(--shadow-sm);
}
.mb-kpi .k { font-size: 11px; color: var(--text-muted); margin-bottom: 5px; }
.mb-kpi .v { font-size: 22px; font-weight: 700; line-height: 1; }
.mb-kpi .u { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-left: 3px; }

.mb-bar {
    display: flex; height: 24px; border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--border); background: var(--bg-card); margin-bottom: 12px;
}
.mb-bar > div {
    display: flex; align-items: center; justify-content: center; color: #fff;
    font-size: 11px; font-weight: 600; transition: width .4s; overflow: hidden; white-space: nowrap;
}

.mb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 9px; }
.mb-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 11px; box-shadow: var(--shadow-sm); border-left: 4px solid #9aa4b0;
}
.mb-card .no { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.mb-card .ton {
    font-size: 11px; font-weight: 600; color: var(--text-secondary);
    background: #f0f2f5; padding: 1px 6px; border-radius: 4px;
}
.mb-card .st {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 4px; margin: 7px 0 6px;
}
.mb-card .mot { font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.mb-card .row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.mb-card .row b { color: var(--text-primary); font-weight: 600; }
.mb-bar-mini { height: 5px; background: #f0f2f5; border-radius: 3px; margin-top: 7px; overflow: hidden; }
.mb-bar-mini i { display: block; height: 100%; border-radius: 3px; }
.mb-msg { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; grid-column: 1 / -1; }

@media (max-width: 640px) {
    .mb-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
}
/*PROBE-STATIC-*/

/* ==================================================================
   ========== UI 视觉升级覆盖层 · 现代科技蓝 (2026-11-18 v2) ==========
   说明：本区块只覆盖视觉样式，不改动任何 DOM 结构/ID/事件。
        如需回滚，删除本区块并将 :root 恢复为原配色即可。
   ================================================================== */

/* ---------- 全局字体与背景 ---------- */
body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "微软雅黑", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-body);
}
/* 全局细滚动条 */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* ---------- 侧边栏：深蓝玻璃质感 ---------- */
.sidebar {
    background: linear-gradient(165deg, #0f2744 0%, #143358 45%, #1e4a7c 100%);
    box-shadow: 4px 0 24px -8px rgba(15,39,68,0.5);
}
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 0%, rgba(56,189,248,0.18), transparent 55%),
                radial-gradient(circle at 90% 100%, rgba(37,99,235,0.12), transparent 45%);
    pointer-events: none;
    z-index: 0;
}
.sidebar-header, .sidebar-nav, .sidebar-footer { position: relative; z-index: 1; }
.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(148,197,255,0.12);
}
.logo {
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
    border-radius: 12px;
    box-shadow: 0 4px 14px -3px rgba(56,189,248,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
    width: 44px; height: 44px;
}
.logo-icon { font-size: 15px; letter-spacing: 0.5px; }
.logo-text h1 { font-size: 15px; letter-spacing: 0.3px; }
.logo-text p { color: #8ec5ff; opacity: 0.9; letter-spacing: 0.5px; }
.nav-label { color: #7dd3fc; opacity: 0.75; }
.nav-item {
    border-radius: 0 10px 10px 0;
    margin: 2px 12px 2px 0;
    padding: 11px 20px;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(148,197,255,0.1); }
.nav-item.active {
    background: linear-gradient(90deg, rgba(56,189,248,0.22), rgba(56,189,248,0.04));
    border-left-color: #38bdf8;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.nav-item.active .nav-icon { filter: drop-shadow(0 0 6px rgba(56,189,248,0.6)); }
.nav-icon { font-size: 17px; }
.nav-text { letter-spacing: 0.2px; }
.sidebar-footer { border-top: 1px solid rgba(148,197,255,0.12); color: #93c5fd; }

/* ---------- 顶栏 ---------- */
.top-bar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(15,23,42,0.02);
}
.top-bar h2 {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}
#current-time { font-variant-numeric: tabular-nums; }

/* ---------- 模块标题 ---------- */
.module-header h3 {
    position: relative;
    padding-left: 12px;
}
.module-header h3::before {
    content: '';
    position: absolute;
    left: 0; top: 2px; bottom: 2px;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--accent), var(--primary));
}

/* ---------- 数据来源标签 ---------- */
.data-source {
    background: linear-gradient(135deg, rgba(14,165,233,0.12), rgba(37,99,235,0.1));
    color: var(--primary);
    border: 1px solid rgba(37,99,235,0.12);
    font-weight: 600;
}

/* ---------- 仪表盘状态卡片 ---------- */
.status-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 16px 14px;
    background: var(--bg-card);
}
.status-card:hover {
    box-shadow: var(--shadow-glow);
    border-color: rgba(37,99,235,0.35);
    transform: translateY(-3px);
}
.card-bg {
    background: radial-gradient(circle at 30% 30%, rgba(56,189,248,0.08), transparent 70%);
}
.card-icon {
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(14,165,233,0.14), rgba(37,99,235,0.1));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
    font-size: 21px;
}
.status-card:hover .card-icon {
    background: linear-gradient(135deg, rgba(14,165,233,0.24), rgba(37,99,235,0.18));
}
.card-info h3 { font-size: 13.5px; }
.card-info .status { font-size: 10.5px; font-weight: 600; }
/* 状态徽章配色 */
.card-info .status {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
    padding: 3px 10px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.status.online, .card-info .status.online { background: #ecfdf5; color: #059669; border-color: #d1fae5; }
.status.offline, .card-info .status.offline { background: #fef2f2; color: #dc2626; border-color: #fee2e2; }
.status.pending, .card-info .status.pending { background: #fffbeb; color: #d97706; border-color: #fef3c7; }
.btn-enter {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    box-shadow: 0 2px 8px -2px rgba(37,99,235,0.4);
    font-weight: 600;
}
.btn-enter:hover {
    background: linear-gradient(135deg, var(--primary-light), #0284c7);
    box-shadow: 0 4px 12px -2px rgba(37,99,235,0.5);
}

/* ---------- 面板类（同步/信息/表单/表格） ---------- */
.sync-panel, .info-panel, .form-section, .table-section, .result-section {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.sync-card { border-radius: 14px; }
.sync-source {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 2px 8px -2px rgba(37,99,235,0.35);
}
.info-panel h3 { border-bottom-color: var(--accent); }
.info-panel li { border-left-color: var(--accent); border-radius: 8px; }
.param-group h5 { color: var(--primary); }

/* ---------- 表单控件 ---------- */
.form-control {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 13px;
}
.form-control:hover { border-color: #94a3b8; }
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.14);
    background: #fff;
}

/* ---------- 按钮 ---------- */
.btn { border-radius: 8px; font-weight: 600; letter-spacing: 0.2px; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    box-shadow: 0 2px 8px -2px rgba(37,99,235,0.4);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 4px 14px -3px rgba(37,99,235,0.5);
}
.btn-info {
    background: linear-gradient(135deg, var(--accent), #0284c7);
    box-shadow: 0 2px 8px -2px rgba(14,165,233,0.4);
}
.btn-secondary { background: #f8fafc; border-color: var(--border); color: var(--text-secondary); }
.btn-secondary:hover { background: #f1f5f9; }

/* ---------- 表格 ---------- */
th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 2px solid var(--border);
}
tbody tr:hover { background: #f8fafc; }
td { border-bottom: 1px solid #f1f5f9; }

/* ---------- 上传区域 ---------- */
.upload-area {
    border-radius: 14px;
    border: 2px dashed #cbd5e1;
    background: linear-gradient(135deg, rgba(14,165,233,0.03), rgba(37,99,235,0.02));
    transition: var(--transition);
}
.upload-area:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(14,165,233,0.07), rgba(37,99,235,0.04));
}

/* ---------- Toast ---------- */
.toast { border-radius: 10px; box-shadow: var(--shadow-lg); }

/* ---------- 响应式：窄屏侧栏收窄 ---------- */
@media (max-width: 900px) {
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; }
}
@media (max-width: 768px) {
    .sidebar { width: 68px; }
    .main-content { margin-left: 68px; }
    .logo-text, .nav-text, .nav-label, .sidebar-footer { display: none; }
    .sidebar-header { justify-content: center; padding: 18px 12px; }
    .nav-item { justify-content: center; padding: 12px 0; margin: 2px 8px; }
    .nav-icon { font-size: 20px; }
}

