@charset "utf-8";

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #0d47a1;
    --secondary: #34a853;
    --warning: #f9ab00;
    --danger: #ea4335;
    --info: #5f6368;
    --bg-main: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== 登录页 ===== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.login-overlay.hidden,
#loginOverlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.login-box {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 48px 40px;
    width: 420px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.login-box .logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), #6c5ce7);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: #fff;
}

.login-box h1 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 8px;
}

.login-box p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-box input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 15px;
    margin-bottom: 16px;
    outline: none;
    transition: var(--transition);
}

.login-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.login-box input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
}

.login-box button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #6c5ce7);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.4);
}

/* ===== 主布局 ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-layout.hidden {
    display: none !important;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #6c5ce7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-header .brand-text {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.sidebar-header .brand-text small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.35);
    padding: 16px 12px 8px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px;
    user-select: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), rgba(26, 115, 232, 0.7));
    color: #fff;
    font-weight: 500;
}

.nav-item .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6c5ce7, var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.user-details {
    flex: 1;
}

.user-details .user-name {
    font-size: 13px;
    font-weight: 500;
}

.user-details .user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.btn-logout {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: var(--transition);
}

.btn-logout:hover {
    color: var(--danger);
}

/* 主内容区 */
.main-content {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部栏 */
.top-bar {
    height: 64px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
    color: var(--text-secondary);
    position: relative;
}

.top-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.top-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

/* 内容区 */
.content-area {
    flex: 1;
    padding: 24px 28px;
}

/* ===== 仪表盘 ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #e8f0fe, #d4e4ff);
    color: var(--primary);
}

.stat-icon.green {
    background: linear-gradient(135deg, #e6f4ea, #ceead6);
    color: var(--secondary);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #fef7e0, #feefc3);
    color: #e37400;
}

.stat-icon.red {
    background: linear-gradient(135deg, #fce8e6, #fad2cf);
    color: var(--danger);
}

.stat-info h3 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-trend {
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.up {
    color: var(--secondary);
}

.stat-trend.down {
    color: var(--danger);
}

/* 卡片通用 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h2 .header-icon {
    font-size: 18px;
}

.card-body {
    padding: 20px 24px;
}

/* 两栏布局 */
.two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* ===== 甘特图/排产时间线 ===== */
.timeline-container {
    overflow-x: auto;
}

.timeline-grid {
    display: grid;
    grid-template-columns: 160px repeat(14, 1fr);
    gap: 2px;
    min-width: 900px;
}

.timeline-header-cell {
    background: #f8fafc;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.timeline-row-label {
    background: #f8fafc;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 2px solid var(--border);
}

.timeline-cell {
    padding: 6px 4px;
    min-height: 52px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.timeline-cell.has-bar {
    padding: 0;
}

.order-bar {
    margin: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

.order-bar:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.order-bar.status-pending {
    background: linear-gradient(135deg, #94a3b8, #64748b);
}

.order-bar.status-progress {
    background: linear-gradient(135deg, var(--primary), #4f8ef7);
}

.order-bar.status-assembly {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}

.order-bar.status-testing {
    background: linear-gradient(135deg, var(--warning), #fcd34d);
    color: #92400e;
}

.order-bar.status-done {
    background: linear-gradient(135deg, var(--secondary), #4ade80);
}

.order-bar.status-delayed {
    background: linear-gradient(135deg, var(--danger), #f87171);
}

.order-bar .bar-title {
    font-weight: 600;
    font-size: 11px;
}

.order-bar .bar-meta {
    font-size: 10px;
    opacity: 0.85;
    margin-top: 2px;
}

/* 生产线状态 */
.line-status-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.line-status-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    background: #f8fafc;
    transition: var(--transition);
}

.line-status-item:hover {
    background: #f1f5f9;
}

.line-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.line-indicator.running {
    background: var(--secondary);
    box-shadow: 0 0 8px rgba(52, 168, 83, 0.4);
    animation: pulse 2s infinite;
}

.line-indicator.idle {
    background: var(--warning);
}

.line-indicator.offline {
    background: var(--danger);
}

.line-indicator.maintenance {
    background: var(--info);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.line-info {
    flex: 1;
}

.line-info .line-name {
    font-size: 14px;
    font-weight: 500;
}

.line-info .line-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.line-progress {
    width: 60px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.line-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ===== 订单表格 ===== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar-right {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #4f8ef7);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: #fff;
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    color: var(--text-secondary);
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon.btn-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 9px 14px 9px 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    width: 240px;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
}

.filter-select {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: #fff;
    cursor: pointer;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tr:hover td {
    background: #f8fafc;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.order-id {
    font-weight: 600;
    color: var(--primary);
}

.priority-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.priority-urgent {
    background: #fce8e6;
    color: var(--danger);
}

.priority-high {
    background: #fef7e0;
    color: #e37400;
}

.priority-normal {
    background: #e8f0fe;
    color: var(--primary);
}

.priority-low {
    background: #f0fdf4;
    color: var(--secondary);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-pending {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.status-pending .status-dot {
    background: #94a3b8;
}

.status-scheduled {
    background: #e0f2fe;
    color: #0284c7;
}

.status-scheduled .status-dot {
    background: #0284c7;
}

.status-progress {
    background: #e8f0fe;
    color: var(--primary);
}

.status-progress .status-dot {
    background: var(--primary);
}

.status-assembly {
    background: #f3e8ff;
    color: #7c3aed;
}

.status-assembly .status-dot {
    background: #7c3aed;
}

.status-testing {
    background: #fef7e0;
    color: #92400e;
}

.status-testing .status-dot {
    background: var(--warning);
}

.status-done {
    background: #e6f4ea;
    color: var(--secondary);
}

.status-done .status-dot {
    background: var(--secondary);
}

.status-delayed {
    background: #fce8e6;
    color: var(--danger);
}

.status-delayed .status-dot {
    background: var(--danger);
}

.progress-cell {
    min-width: 120px;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar-track {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.progress-bar-fill.green {
    background: linear-gradient(90deg, var(--secondary), #4ade80);
}

.progress-bar-fill.blue {
    background: linear-gradient(90deg, var(--primary), #4f8ef7);
}

.progress-bar-fill.purple {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.progress-bar-fill.yellow {
    background: linear-gradient(90deg, var(--warning), #fcd34d);
}

.progress-bar-fill.red {
    background: linear-gradient(90deg, var(--danger), #f87171);
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 36px;
}

.action-btns {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    color: var(--text-secondary);
}

.action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #e8f0fe;
}

.action-btn.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fce8e6;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 4px;
}

.page-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.page-btn:hover:not(.active):not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== 模态框 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: #fff;
    border-radius: 16px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 24px 64px 24px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 1001;
}

.modal-close:hover {
    background: #e2e8f0;
}

.modal-body {
    padding: 28px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    margin-top: auto;
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* 表单 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label .required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 序号输入组 */
.seq-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seq-input-group input {
    flex: 1;
    max-width: 120px;
}

.seq-input-group #s_seqLabel {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary), #4285f4);
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    min-width: 80px;
    text-align: center;
}

/* 排单按钮样式 */
.btn-icon.btn-primary {
    color: var(--primary);
}

.btn-icon.btn-primary:hover {
    background: rgba(26, 115, 232, 0.1);
}

.btn-icon.btn-schedule {
    color: var(--warning);
}

.btn-icon.btn-schedule:hover {
    border-color: var(--warning);
    background: rgba(249, 171, 0, 0.1);
}

/* 输入带标签组合 */
.input-with-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-with-label input {
    flex: 1;
    max-width: 120px;
}

.input-with-label .seq-label {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary), #4285f4);
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    min-width: 80px;
    text-align: center;
}

/* ===== 工单详情 ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 14px;
    font-weight: 500;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.bom-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bom-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
}

.bom-item .bom-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #e8f0fe;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.bom-item .bom-info {
    flex: 1;
}

.bom-item .bom-name {
    font-size: 13px;
    font-weight: 500;
}

.bom-item .bom-sku {
    font-size: 11px;
    color: var(--text-secondary);
}

.bom-item .bom-qty {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* 生产工序步骤 */
.process-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.process-step {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    position: relative;
}

.process-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 40px;
    bottom: -14px;
    width: 2px;
    background: var(--border);
}

.process-step.completed::before {
    background: var(--secondary);
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    z-index: 1;
}

.step-indicator.completed {
    background: var(--secondary);
    color: #fff;
}

.step-indicator.active {
    background: var(--primary);
    color: #fff;
    animation: pulse 2s infinite;
}

.step-indicator.pending {
    background: #e2e8f0;
    color: var(--text-secondary);
}

.step-content {
    flex: 1;
}

.step-content .step-title {
    font-size: 14px;
    font-weight: 500;
}

.step-content .step-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===== 通知列表 ===== */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    background: #f8fafc;
    transition: var(--transition);
    cursor: pointer;
}

.notification-item:hover {
    background: #f1f5f9;
}

.notification-item.unread {
    background: #e8f0fe;
}

.notification-item.unread:hover {
    background: #d4e4ff;
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.notif-icon.info {
    background: #e8f0fe;
    color: var(--primary);
}

.notif-icon.warn {
    background: #fef7e0;
    color: #e37400;
}

.notif-icon.error {
    background: #fce8e6;
    color: var(--danger);
}

.notif-icon.success {
    background: #e6f4ea;
    color: var(--secondary);
}

.notif-content {
    flex: 1;
}

.notif-content .notif-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.notif-content .notif-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* ===== 图表区域 ===== */
.chart-container {
    position: relative;
    height: 220px;
}

.chart-legend {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* 日历视图 */
.calendar-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 4px;
}

.cal-cell {
    min-height: 80px;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    padding: 4px;
    font-size: 11px;
    background: #fafbfc;
    transition: var(--transition);
}

.cal-cell:hover {
    background: #f1f5f9;
}

.cal-cell .cal-date {
    font-weight: 600;
    margin-bottom: 2px;
}

.cal-cell.today {
    background: #e8f0fe;
    border-color: var(--primary);
}

.cal-cell.today .cal-date {
    color: var(--primary);
}

.cal-event {
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    color: #fff;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.cal-event:hover {
    opacity: 0.85;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
    opacity: 0;
    transform: translateX(100%);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    border-left-color: var(--secondary);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--primary);
}

.toast-icon {
    font-size: 16px;
}

.toast-message {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    padding: 2px 6px;
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 13px;
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    user-select: none;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* 隐藏 */
.hidden {
    display: none !important;
}

/* 响应式 */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== 物料表格 ===== */
.materials-table-wrapper {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.materials-paste-tip {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 8px;
}

.materials-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.materials-table thead {
    background: #f8fafc;
}

.materials-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.materials-table td {
    padding: 4px 6px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.materials-table tbody tr:last-child td {
    border-bottom: none;
}

.materials-table tbody tr:hover {
    background: #f8fafc;
}

/* 各列宽度设置 */
.materials-table th:nth-child(1),
.materials-table td:nth-child(1) {
    width: 10%;
}

.materials-table th:nth-child(2),
.materials-table td:nth-child(2) {
    width: 68%;
}

.materials-table th:nth-child(3),
.materials-table td:nth-child(3) {
    width: 16%;
}

.materials-table th:nth-child(4),
.materials-table td:nth-child(4) {
    width: 6%;
}

.material-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
    background: transparent;
}

.material-input:hover {
    border-color: var(--border);
}

.material-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.material-model {
    min-height: 50px;
    height: 50px;
    resize: vertical;
    vertical-align: top;
    line-height: 1.4;
    padding: 8px 8px;
}

.btn-remove-material {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-remove-material:hover {
    background: #fee2e2;
    color: var(--danger);
}

.add-row-btn {
    width: 100%;
    padding: 8px;
}

/* 辅助类 */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* 图片上传 */
.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 150px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.image-upload-area:hover,
.image-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(26, 115, 232, 0.05);
}

.upload-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.upload-placeholder .upload-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.upload-placeholder .upload-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

.image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(234, 67, 53, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-seq-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-seq-input input {
    width: 80px;
}

.seq-label {
    color: var(--primary);
    font-weight: 500;
    min-width: 60px;
}