/* 云乔智造 - 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #4A6CF7;
    --primary-dark: #3A56D4;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --bg: #F1F5F9;
    --card: #FFFFFF;
    --text: #1E293B;
    --text-secondary: #64748B;
    --border: #E2E8F0;
    --sidebar-bg: #1E293B;
    --sidebar-text: #CBD5E1;
    --sidebar-active: #4A6CF7;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 8px;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    /* 禁止移动端弹性滚动下拉出地址栏 */
    overscroll-behavior: none;
    -ms-scroll-chaining: none;
    overscroll-behavior-y: none;
}
html {
    overscroll-behavior: none;
    overscroll-behavior-y: none;
}

/* ===== 加载遮罩 ===== */
#global-loading {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.9); display: flex;
    align-items: center; justify-content: center;
    z-index: 9999; transition: opacity 0.3s;
}
#global-loading.hidden { opacity: 0; pointer-events: none; }
.loader {
    width: 40px; height: 40px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 登录页 ===== */
.login-container {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
    background: #fff; border-radius: 12px; padding: 40px;
    width: 400px; max-width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-box h1 { text-align: center; color: var(--primary); margin-bottom: 8px; font-size: 22px; }
.login-box .subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 30px; font-size: 13px; }
.login-box .form-group { margin-bottom: 20px; }
.login-box label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text); }
.login-box input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 14px; transition: border-color 0.2s;
}
.login-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,108,247,0.1); }
.login-box .btn-login {
    width: 100%; padding: 12px; background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius); font-size: 16px;
    cursor: pointer; transition: background 0.2s; margin-top: 10px;
}
.login-box .btn-login:hover { background: var(--primary-dark); }
.login-box .btn-login:disabled { background: #94A3B8; cursor: not-allowed; }
.login-box .remember-me {
    display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); cursor: pointer; user-select: none;
}
.login-box .remember-me input[type="checkbox"] {
    width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer;
}

/* ===== 布局 ===== */
.app-layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: 240px; background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column; position: fixed; top: 0; left: 0;
    height: 100vh; z-index: 100; transition: transform 0.3s;
}
.sidebar-header {
    padding: 20px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header .logo { font-size: 18px; font-weight: 700; color: #fff; }
.sidebar-header .version { font-size: 11px; color: var(--sidebar-text); }
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: var(--sidebar-text);
    text-decoration: none; cursor: pointer; transition: all 0.2s;
    border-left: 3px solid transparent; font-size: 14px;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(74,108,247,0.15); color: #fff; border-left-color: var(--sidebar-active); }
.nav-item .icon { width: 20px; text-align: center; font-size: 16px; }
.nav-section { padding: 12px 20px 6px; font-size: 11px; text-transform: uppercase; color: #64748B; letter-spacing: 1px; }

/* 二级菜单样式 */
.nav-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 8px 12px; }
.nav-group { display: flex; align-items: center; gap: 10px; padding: 10px 20px; cursor: pointer; transition: all 0.2s; color: var(--sidebar-text); }
.nav-group:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-group-icon { width: 20px; text-align: center; font-size: 16px; }
.nav-group-title { flex: 1; font-size: 14px; }
.nav-group-arrow { font-size: 10px; opacity: 0.6; transition: transform 0.2s; }
.nav-group.expanded { color: #fff; background: rgba(74,108,247,0.1); }
.nav-group-items { overflow: hidden; }
.nav-item-child { padding-left: 50px; font-size: 13px; }
.nav-item-child .icon { font-size: 14px; }

.sidebar-footer {
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.sidebar-footer .user-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
    display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600;
}
.sidebar-footer .logout-btn {
    margin-left: auto; color: #94A3B8; cursor: pointer; font-size: 12px;
}
.sidebar-footer .logout-btn:hover { color: #EF4444; }

/* 汉堡菜单 */
.hamburger {
    display: none; position: fixed; top: 12px; left: 12px;
    z-index: 200; background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius); padding: 8px 12px;
    cursor: pointer; font-size: 18px;
}
.mobile-back-btn {
    display: none; position: fixed; top: 12px; left: 60px;
    z-index: 200; background: #fff; color: var(--primary);
    border: 1px solid var(--primary); border-radius: var(--radius); padding: 8px 12px;
    cursor: pointer; font-size: 13px; font-weight: 500;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 99;
}

/* 主内容区 */
.main-content { flex: 1; margin-left: 240px; padding: 24px; min-height: 100vh; }
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.page-header p { color: var(--text-secondary); font-size: 13px; }

/* ===== 卡片 ===== */
.card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.card-header h3 { font-size: 16px; font-weight: 600; }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card {
    background: var(--card); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
}
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
}
.stat-card .stat-icon.blue { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.stat-card .stat-icon.green { background: linear-gradient(135deg, #22C55E, #16A34A); }
.stat-card .stat-icon.orange { background: linear-gradient(135deg, #F59E0B, #D97706); }
.stat-card .stat-icon.purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.stat-card .stat-icon.red { background: linear-gradient(135deg, #EF4444, #DC2626); }
.stat-card .stat-icon.cyan { background: linear-gradient(135deg, #06B6D4, #0891B2); }
.stat-info .stat-value { font-size: 24px; font-weight: 700; color: var(--text); }
.stat-info .stat-label { font-size: 12px; color: var(--text-secondary); }

/* ===== 表格 ===== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table th { background: #F8FAFC; font-weight: 600; font-size: 12px; color: var(--text-secondary); text-transform: uppercase; }
table tr:hover { background: #F8FAFC; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius); font-size: 13px;
    cursor: pointer; border: 1px solid transparent; transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ===== 表单 ===== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 14px; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ===== 状态标签 ===== */
.status-tag {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 500;
}
/* 任务状态 */
.status-tag.pending { background: #FEF3C7; color: #B45309; }     /* 待派工-橙黄 */
.status-tag.assigned { background: #DBEAFE; color: #1D4ED8; }    /* 已派工-蓝 */
.status-tag.in-progress { background: #E0E7FF; color: #4338CA; } /* 进行中-靛蓝 */
.status-tag.submitted { background: #FCE7F3; color: #BE185D; }    /* 已提交-粉红 */
.status-tag.reviewed { background: #CFFAFE; color: #0E7490; }    /* 主管已审-青 */
.status-tag.completed { background: #D1FAE5; color: #047857; }   /* 已完成-绿 */
.status-tag.rejected { background: #FEE2E2; color: #B91C1C; }    /* 已驳回-红 */
.status-tag.returned { background: #FED7AA; color: #C2410C; }    /* 已返回-橙 */
/* 员工状态 */
.status-tag.active { background: #D1FAE5; color: #047857; }      /* 在职-绿 */
.status-tag.disabled { background: #F3F4F6; color: #6B7280; }    /* 禁用-灰 */

/* ===== Toast 提示 ===== */
#toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 10000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 20px; border-radius: var(--radius);
    color: #fff; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    min-width: 200px; display: flex; align-items: center; gap: 8px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== WebSocket 通知红点动画 ===== */
.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

/* ===== Modal 弹窗 ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: flex;
    align-items: center; justify-content: center; z-index: 1000;
}
.modal {
    background: #fff; border-radius: 12px; width: 520px;
    max-width: 90%; max-height: 80vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: var(--text-secondary);
}
.modal-body { padding: 24px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px; border-top: 1px solid var(--border);
}

/* ===== 分页 ===== */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 4px; margin-top: 20px;
}
.pagination button {
    padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius);
    background: #fff; cursor: pointer; font-size: 13px;
}
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination .page-info { padding: 0 12px; font-size: 13px; color: var(--text-secondary); }

/* ===== 工具栏 ===== */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select {
    padding: 8px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 13px;
}
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--primary); }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .hamburger { display: block; }
    .mobile-back-btn { display: block; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; padding: 16px; padding-top: 60px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .modal { width: 95%; margin: 10px; }
}

/* ===== 员工首页 ===== */
.task-card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
    border-left: 4px solid var(--primary);
}
.task-card .task-title { font-weight: 600; margin-bottom: 8px; }
.task-card .task-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-secondary); }
.task-card .task-actions { margin-top: 12px; display: flex; gap: 8px; }

/* ===== 审核卡片 ===== */
.review-card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
    border-left: 4px solid var(--warning);
}
.review-card .review-header { margin-bottom: 4px; }
.review-card .review-actions { display: flex; gap: 8px; margin-top: 12px; }
.review-card textarea { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 8px; }

/* ===================================================
   移动端工作台专属样式
   =================================================== */

/* ----- 移动工作台布局 ----- */
.mobile-workbench {
    display: flex; flex-direction: column; min-height: 100vh;
    background: #F1F5F9; padding-bottom: 72px; /* 为底部导航预留 */
}

/* ----- 顶部Header ----- */
.mobile-header {
    background: linear-gradient(135deg, #4A6CF7 0%, #764ba2 100%);
    color: #fff; padding: 16px 20px 20px; position: sticky; top: 0; z-index: 50;
}
.mobile-header-top {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.mobile-header-title { font-size: 18px; font-weight: 700; }
.mobile-header-sub { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.mobile-header-actions { display: flex; gap: 8px; }
.mobile-header-btn {
    background: rgba(255,255,255,0.2); color: #fff; border: none;
    border-radius: 20px; padding: 6px 14px; font-size: 12px; cursor: pointer;
    backdrop-filter: blur(4px);
}
.mobile-header-btn:hover { background: rgba(255,255,255,0.3); }

/* ----- 设置下拉菜单 ----- */
.mobile-settings-btn {
    display: flex; align-items: center; justify-content: center;
    padding: 8px 10px !important;
}
.settings-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 8px;
    background: #fff; border-radius: 12px; min-width: 180px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18); z-index: 100;
    overflow: hidden; animation: dropIn 0.2s ease;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.settings-dropdown-item {
    padding: 12px 16px; font-size: 14px; color: var(--text);
    cursor: pointer; transition: background 0.15s;
    display: flex; align-items: center; gap: 8px;
    -webkit-tap-highlight-color: transparent;
}
.settings-dropdown-item:hover { background: #F1F5F9; }
.settings-dropdown-item:active { background: #E2E8F0; }
.settings-dropdown-separator {
    height: 1px; background: var(--border); margin: 4px 0;
}
.settings-dropdown-danger {
    color: #EF4444 !important;
}
.settings-dropdown-danger:hover { background: #FEF2F2 !important; }

/* ----- 移动端统计卡片网格 ----- */
.mobile-stats {
    display: grid; grid-template-columns: repeat(2,1fr); gap: 10px;
    padding: 0 16px 16px;
    margin-top: -12px; /* 与header重叠产生层次感 */
}
.mobile-stat-card {
    background: #fff; border-radius: 12px; padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); display: flex; align-items: center; gap: 12px;
}
.mobile-stat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    flex-shrink: 0;
}
.mobile-stat-icon.blue   { background: linear-gradient(135deg,#DBEAFE,#BFDBFE); }
.mobile-stat-icon.green  { background: linear-gradient(135deg,#D1FAE5,#A7F3D0); }
.mobile-stat-icon.orange { background: linear-gradient(135deg,#FEF3C7,#FDE68A); }
.mobile-stat-icon.red    { background: linear-gradient(135deg,#FEE2E2,#FECACA); }
.mobile-stat-icon.cyan   { background: linear-gradient(135deg,#CFFAFE,#A5F3FC); }
.mobile-stat-icon.purple { background: linear-gradient(135deg,#EDE9FE,#DDD6FE); }
.mobile-stat-icon.gray  { background: linear-gradient(135deg,#F3F4F6,#E5E7EB); }
.mobile-stat-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.mobile-stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ----- 移动端页面内容区 ----- */
.mobile-page { padding: 0 16px 12px; }
.mobile-section-title {
    font-size: 15px; font-weight: 700; color: var(--text);
    margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.mobile-section-title .badge {
    background: var(--primary); color: #fff;
    font-size: 11px; padding: 1px 8px; border-radius: 10px; font-weight: 600;
}

/* ----- 移动任务卡片 ----- */
.m-task-card {
    background: #fff; border-radius: 14px; margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07); overflow: hidden;
}
.m-task-card-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #F1F5F9;
}
.m-task-card-title {
    font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.m-task-card-sub {
    font-size: 12px; color: var(--text-secondary);
    display: flex; align-items: center; gap: 4px;
}
.m-task-card-body {
    padding: 10px 16px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.m-task-info-item { font-size: 12px; }
.m-task-info-item .label { color: var(--text-secondary); margin-bottom: 2px; }
.m-task-info-item .value { font-weight: 600; color: var(--text); }
.m-task-card-footer {
    padding: 10px 16px 14px;
    display: flex; gap: 8px;
}
.m-btn {
    flex: 1; padding: 10px 0; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.2s; -webkit-tap-highlight-color: transparent;
}
.m-btn:active { transform: scale(0.96); }
.m-btn-primary { background: var(--primary); color: #fff; }
.m-btn-success { background: var(--success); color: #fff; }
.m-btn-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; flex: 0 0 auto; padding: 10px 16px; }
.m-btn-danger  { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; flex: 0 0 auto; padding: 10px 16px; }
.m-btn-outline { background: #F8FAFC; color: var(--text-secondary); border: 1px solid var(--border); }

/* ----- 移动审核卡片 ----- */
.m-review-card {
    background: #fff; border-radius: 14px; margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07); overflow: hidden;
    border-top: 3px solid var(--warning);
}
.m-review-header { padding: 14px 16px 12px; border-bottom: 1px solid #F1F5F9; }
.m-review-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.m-review-sub { font-size: 12px; color: var(--text-secondary); }
.m-review-body { padding: 12px 16px; }
.m-review-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: 1px solid #F8FAFC; font-size: 13px;
}
.m-review-row:last-child { border-bottom: none; }
.m-review-row .r-label { color: var(--text-secondary); }
.m-review-row .r-value { font-weight: 600; color: var(--text); }
.m-review-qty-row { padding: 12px 16px 0; }
.m-review-qty-row label { font-size: 13px; color: var(--text); font-weight: 500; display: block; margin-bottom: 8px; }
.m-review-qty-input {
    width: 100%; padding: 10px 14px; border: 2px solid var(--border);
    border-radius: 10px; font-size: 16px; text-align: center; font-weight: 600;
    background: #F8FAFC; transition: border-color 0.2s;
}
.m-review-qty-input:focus { outline: none; border-color: var(--primary); background: #fff; }
.m-review-remark-row { padding: 10px 16px; }
.m-review-remark-row textarea {
    width: 100%; padding: 10px 12px; border: 2px solid var(--border);
    border-radius: 10px; font-size: 13px; resize: none;
    background: #F8FAFC; transition: border-color 0.2s;
}
.m-review-remark-row textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.m-review-footer { padding: 10px 16px 14px; display: flex; gap: 10px; }
.m-review-footer .m-btn { font-size: 15px; }

/* ----- 移动端公告 ----- */
.m-ann-item {
    padding: 12px; border-radius: 10px; background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 10px;
}
.m-ann-item .m-ann-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.m-ann-item .m-ann-content { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.m-ann-item .m-ann-date { font-size: 11px; color: #94A3B8; margin-top: 6px; }

/* ----- 底部 TabBar ----- */
.mobile-tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; height: 68px;
    background: #fff; display: flex; align-items: stretch;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    z-index: 200;
    /* 安全区域适配（刘海/圆角屏） */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-tabbar-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 4px;
    cursor: pointer; color: var(--text-secondary);
    transition: color 0.2s; -webkit-tap-highlight-color: transparent;
    position: relative;
}
.mobile-tabbar-item.active { color: var(--primary); }
.mobile-tabbar-item .tab-icon { font-size: 22px; line-height: 1; }
.mobile-tabbar-item .tab-label { font-size: 11px; font-weight: 500; }
.mobile-tabbar-item .tab-badge {
    position: absolute; top: 6px; right: calc(50% - 18px);
    background: var(--danger); color: #fff; font-size: 10px;
    padding: 1px 5px; border-radius: 8px; font-weight: 700;
    min-width: 16px; text-align: center;
}

/* ===== 侧边滑出面板（更多菜单） ===== */
.more-panel {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background: #fff;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    z-index: 1001;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}
.more-panel.open {
    left: 0;
}
.more-panel-header {
    padding: 20px;
    padding-left: 60px;
    background: linear-gradient(135deg, #4A6CF7 0%, #764ba2 100%);
    color: #fff;
    min-height: 70px;
    display: flex;
    align-items: center;
}
.more-panel-header h3 {
    font-size: 18px;
    font-weight: 700;
}
.more-panel-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
}
.more-panel-close:hover {
    background: rgba(255,255,255,0.3);
}
.more-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.more-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.more-panel-item:active {
    background: #F1F5F9;
}
.more-panel-item .icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #F1F5F9;
}
.more-panel-item .arrow {
    margin-left: auto;
    color: #CBD5E1;
    font-size: 14px;
}
.more-panel-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 20px;
}
.more-panel-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}
.more-panel-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #EF4444;
    font-size: 15px;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s;
}
.more-panel-logout:active {
    background: #FEF2F2;
}

/* 更多面板遮罩 */
.more-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.more-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* ----- 移动端内嵌tabs ----- */
.m-tabs {
    display: flex; background: #F1F5F9; border-radius: 10px;
    padding: 3px; margin-bottom: 16px;
}
.m-tab {
    flex: 1; text-align: center; padding: 8px 0; font-size: 13px;
    font-weight: 500; border-radius: 8px; cursor: pointer;
    color: var(--text-secondary); transition: all 0.2s;
}
.m-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.1); font-weight: 600; }

/* ----- 移动端修改密码 / Modal适配 ----- */
@media (max-width: 768px) {
    .modal { width: 96%; max-height: 90vh; border-radius: 16px 16px 0 0; margin: 0; align-self: flex-end; }
    .modal-overlay { align-items: flex-end; }
    .modal-body { padding: 16px 20px; }
    .modal-footer { padding: 12px 20px; }
    .form-group input, .form-group select, .form-group textarea {
        padding: 11px 14px; font-size: 16px; /* 阻止iOS缩放 */
    }
    #toast-container { right: 12px; left: 12px; top: auto; bottom: 80px; }
    .toast { min-width: unset; width: 100%; text-align: center; justify-content: center; }
}

/* ----- 移动端滚动区域 ----- */
.mobile-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ----- "空状态"移动版 ----- */
.m-empty {
    text-align: center; padding: 40px 20px;
    color: var(--text-secondary);
}
.m-empty .m-empty-icon { font-size: 44px; margin-bottom: 12px; }
.m-empty p { font-size: 14px; }

/* ----- 进度条（用于任务进度） ----- */
.m-progress-bar {
    height: 6px; background: #E2E8F0; border-radius: 3px; overflow: hidden;
}
.m-progress-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, #4A6CF7, #764ba2);
    transition: width 0.4s ease;
}

/* ===== 管理员移动端样式 ===== */
@media (max-width: 768px) {
    /* 管理员首页统计卡片 */
    .m-stat-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 12px;
        margin-bottom: 16px;
    }
    .m-stat-card {
        background: #fff;
        border-radius: 12px;
        padding: 16px;
        box-shadow: 0 1px 6px rgba(0,0,0,0.06);
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .m-stat-card .m-stat-icon {
        width: 44px; height: 44px;
        border-radius: 12px;
        display: flex; align-items: center; justify-content: center;
        font-size: 20px;
    }
    .m-stat-card .m-stat-icon.blue { background: #EFF6FF; }
    .m-stat-card .m-stat-icon.green { background: #F0FDF4; }
    .m-stat-card .m-stat-icon.orange { background: #FFF7ED; }
    .m-stat-card .m-stat-icon.purple { background: #F5F3FF; }
    .m-stat-card .m-stat-info h4 { font-size: 20px; font-weight: 700; color: var(--text); }
    .m-stat-card .m-stat-info p { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

    /* 管理员列表表格 - 卡片式 */
    .m-list-card {
        background: #fff; border-radius: 12px; margin: 0 12px 12px;
        overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }
    .m-list-card .m-card-header {
        padding: 12px 16px; border-bottom: 1px solid var(--border);
        display: flex; justify-content: space-between; align-items: center;
    }
    .m-list-card .m-card-title { font-size: 15px; font-weight: 600; }
    .m-list-card .m-card-body { padding: 0; }
    .m-list-card .m-card-footer {
        padding: 10px 16px; border-top: 1px solid var(--border);
        display: flex; gap: 8px;
    }

    /* 移动端表单 */
    .m-form-row {
        display: flex; align-items: center; padding: 12px 16px;
        border-bottom: 1px solid var(--border);
    }
    .m-form-row:last-child { border-bottom: none; }
    .m-form-row label {
        width: 70px; font-size: 14px; color: var(--text-secondary); flex-shrink: 0;
    }
    .m-form-row .m-form-input {
        flex: 1; padding: 8px 0; font-size: 15px; border: none; outline: none;
        background: transparent;
    }
    .m-form-row select.m-form-input {
        padding: 8px 0; font-size: 15px;
    }

    /* 移动端操作按钮 */
    .m-action-bar {
        position: fixed; bottom: 68px; left: 0; right: 0;
        padding: 10px 16px;
        background: #fff; display: flex; gap: 10px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
        z-index: 150;
        padding-bottom: env(safe-area-inset-bottom, 10px);
    }

    /* 移动端搜索栏 */
    .m-search-bar {
        padding: 12px; background: #fff; border-bottom: 1px solid var(--border);
        display: flex; gap: 10px;
    }
    .m-search-bar input {
        flex: 1; padding: 10px 14px; border: 1px solid var(--border);
        border-radius: 10px; font-size: 15px;
    }
    .m-search-bar input:focus { outline: none; border-color: var(--primary); }

    /* 管理员空状态 */
    .m-empty-state {
        text-align: center; padding: 60px 20px; color: var(--text-secondary);
    }
    .m-empty-state .m-empty-icon { font-size: 48px; margin-bottom: 16px; }
    .m-empty-state p { font-size: 14px; }

    /* 表格移动端：横向滚动 */
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-wrapper table { min-width: 600px; }

    /* 移动端分页 */
    .m-pagination {
        display: flex; justify-content: center; align-items: center;
        padding: 16px; gap: 12px;
    }
    .m-pagination button {
        padding: 8px 16px; border: 1px solid var(--border);
        border-radius: 8px; background: #fff; font-size: 13px;
    }
    .m-pagination button:disabled { opacity: 0.5; }
    .m-pagination span { font-size: 13px; color: var(--text-secondary); }
}

/* 隐藏所有数字输入框的上下箭头按钮 */
input[type="number"] {
    -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* ===== 参数配置页面样式 ===== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.settings-card {
    padding: 20px;
}
.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}
.settings-item {
    margin-bottom: 16px;
}
.settings-item:last-child {
    margin-bottom: 0;
}
.settings-item label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.settings-item input,
.settings-item select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.settings-item input:focus,
.settings-item select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}
.settings-desc {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 8px;
}
.input-with-unit input {
    flex: 1;
}
.input-unit {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.btn-lg {
    padding: 12px 32px;
    font-size: 15px;
}

/* ===== 产品工序关联 - 左侧产品列表 + 右侧工序详情 ===== */
.pp-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 160px);
    min-height: 500px;
}

.pp-left {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pp-search {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.pp-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.pp-search input:focus {
    border-color: var(--primary);
}

.pp-product-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.pp-product-item {
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.pp-product-item:hover {
    background: #F8FAFC;
}

.pp-product-item.active {
    background: #EFF6FF;
    border-left: 3px solid var(--primary);
}

.pp-product-name {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    font-size: 14px;
}

.pp-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.pp-product-no {
    color: var(--text-secondary);
}

.pp-product-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.pp-product-status.status-ok {
    background: #F0FDF4;
    color: #16A34A;
}

.pp-product-status.status-empty {
    background: #FEF3C7;
    color: #D97706;
}

.pp-right {
    flex: 1;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pp-detail-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pp-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    padding: 40px;
}

.pp-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.pp-empty-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.pp-empty-hint {
    font-size: 13px;
}

.pp-detail-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FAFBFC;
}

.pp-detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pp-detail-icon {
    font-size: 20px;
}

.pp-detail-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.pp-detail-no {
    color: var(--text-secondary);
    font-size: 13px;
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 4px;
}

.pp-detail-drawing {
    color: #0891B2;
    font-size: 13px;
    background: #ECFEFF;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.pp-process-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.pp-process-table {
    width: 100%;
    border-collapse: collapse;
}

.pp-process-table th,
.pp-process-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.pp-process-table th {
    background: #F8FAFC;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.pp-process-table tbody tr:hover {
    background: #FAFBFC;
}

.pp-process-table td:nth-child(1) { width: 20%; }
.pp-process-table td:nth-child(2) { width: 12%; }
.pp-process-table td:nth-child(3) { width: 10%; text-align: center; }
.pp-process-table td:nth-child(4) { width: 12%; text-align: right; }
.pp-process-table td:nth-child(5) { width: 12%; text-align: right; }
.pp-process-table td:nth-child(6) { width: 15%; text-align: center; }

.pp-empty-process {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.pp-empty-process-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.pp-empty-process-text {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
}

.pp-empty-process-hint {
    font-size: 13px;
}

.pp-process-info-panel {
    background: #F8FAFC;
    padding: 16px;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid var(--border);
}

/* 小按钮样式 */
.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    margin: 0 2px;
}

.btn-xs.btn-outline {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-xs.btn-outline:hover {
    background: #F1F5F9;
}

.btn-xs.btn-danger {
    background: #FEE2E2;
    color: #DC2626;
}

.btn-xs.btn-danger:hover {
    background: #FECACA;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .pp-layout {
        flex-direction: column;
        height: auto;
    }
    .pp-left {
        width: 100%;
        max-height: 200px;
    }
    .pp-right {
        min-height: 400px;
    }
}

/* ===== 任务管理 - 订单分组卡片 ===== */
.order-group-card {
    transition: box-shadow 0.2s;
}

.order-group-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.order-group-header:hover {
    background: #F0F4F8 !important;
}

.order-task-list {
    border-top: 1px solid #E5E7EB;
    padding-top: 8px;
}

.order-task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #F1F5F9;
}

.order-task-item:last-child {
    border-bottom: none;
}

.order-task-info {
    flex: 1;
}

.order-task-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.order-task-meta {
    font-size: 12px;
    color: #6B7280;
}

.order-task-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.toggle-arrow {
    user-select: none;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .order-task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .order-task-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
}

/* ===== 班组成员选择列表 ===== */
.member-select-wrap {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-secondary, #f8fafc);
}
.member-select-search {
    padding: 8px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    position: sticky;
    top: 0;
    background: var(--bg-secondary, #f8fafc);
    z-index: 1;
}
.member-select-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.member-select-search input:focus {
    border-color: var(--primary, #4a6cf7);
}
.member-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}
.member-select-item:hover {
    background: rgba(74, 108, 247, 0.06);
}
.member-select-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary, #4a6cf7);
    cursor: pointer;
    flex-shrink: 0;
}
.member-select-item .emp-name {
    flex: 1;
}
.member-select-item .emp-role {
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
}
.member-select-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    font-size: 13px;
}

/* ===== 班组成员展开行 ===== */
.team-member-expand {
    background: var(--bg-secondary, #f8fafc);
}
.team-member-expand td {
    padding: 0 !important;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.team-member-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
}
.team-member-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(74, 108, 247, 0.08);
    border-radius: 12px;
    font-size: 12px;
    color: var(--primary, #4a6cf7);
}
.team-member-tag.leader-tag {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    font-weight: 600;
}

/* 移动端成员展开 */
.m-member-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
}
.m-member-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(74, 108, 247, 0.08);
    border-radius: 10px;
    font-size: 12px;
    color: var(--primary, #4a6cf7);
}
