/**
 * 排班系统样式文件 - 柔和配色卡片式布局
 * 编码：UTF-8 无BOM
 */

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

:root {
    /* 柔和主色调 */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    
    /* 班次颜色 */
    --shift-zao: #66BB6A;
    --shift-bai: #42A5F5;
    --shift-wan: #FFA726;
    --shift-manwan: #EF5350;
    --shift-zhongzao: #9CCC65;
    --shift-zhongwan: #FFB74D;
    --shift-xiu: #9E9E9E;
    --shift-special: #AB47BC;
    
    /* 功能色 */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --secondary: #64748b;
    
    /* 背景色 */
    --bg-body: #f1f5f9;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-header: #1e293b;
    --bg-toolbar: #ffffff;
    
    /* 边框和阴影 */
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #334155;
    background: var(--bg-body);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 导航栏 ==================== */
.nav {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav li {
    margin: 0;
}

.nav a {
    display: block;
    padding: 16px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.nav a:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.1);
}

.nav a.active {
    color: #ffffff;
    background: rgba(255,255,255,0.1);
}

/* ==================== 主容器 ==================== */
.main-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== 工具栏 ==================== */
.toolbar {
    background: var(--bg-toolbar);
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-right {
    gap: 8px;
}

/* 月份导航 */
.month-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-body);
    padding: 4px;
    border-radius: var(--radius);
}

.month-nav button {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    color: #64748b;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-nav button:hover {
    background: var(--primary);
    color: white;
}

.month-display {
    font-size: 18px;
    font-weight: 600;
    min-width: 110px;
    text-align: center;
    color: #1e293b;
}

/* 下拉框 */
select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* 视图切换 */
.view-toggle {
    display: flex;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.view-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
}

.view-btn:hover {
    color: #334155;
}

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

/* 周导航 */
.week-nav {
    display: inline-flex;
    gap: 4px;
}

.week-nav button {
    padding: 6px 10px;
    border: none;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: #64748b;
    transition: all 0.2s ease;
}

.week-nav button:hover {
    background: var(--primary);
    color: white;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

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

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16a34a; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #475569; }
.btn-outline-light { background: transparent; color: #cbd5e1; border: 1px solid #475569; }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); color: white; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    font-size: 14px;
    padding: 0 8px;
}

.user-avatar { font-size: 16px; }
.user-name { font-weight: 500; }

/* ==================== 登录提示 ==================== */
.login-hint {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 10px 20px;
    font-size: 13px;
    color: #92400e;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-hint a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

/* ==================== 表格容器 ==================== */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.table-wrapper {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
    max-height: calc(100vh - 200px);
}

.table-wrapper::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrapper::-webkit-scrollbar-track { background: #f1f1f1; }
.table-wrapper::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: #a0a0a0; }

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

/* 排班表格 - WPS风格：fixed布局自适应+放大出滚动条 */
#scheduleTable {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: fixed;
}

#scheduleTable th,
#scheduleTable td {
    border-right: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    padding: 6px 4px;
    text-align: center;
}

/* 表头 - WPS风格 */
.header-row th {
    background: #f5f6f7;
    padding: 8px 4px;
    font-weight: 500;
    color: #333;
    text-align: center;
    border-bottom: 1px solid #d9d9d9;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    font-size: 13px;
}

/* 姓名列表头固定 */
.header-row th:first-child {
    position: sticky;
    left: 0;
    z-index: 25;
    background: #f5f6f7;
    width: 72px;
}

/* 岗位列表头固定 */
.header-row th:nth-child(2) {
    position: sticky;
    left: 72px;
    z-index: 25;
    background: #f5f6f7;
    width: 80px;
}

.date-cell {
    padding: 4px 2px !important;
}

.date-num {
    font-weight: 500;
    font-size: 13px;
    color: #333;
}

.date-week {
    font-size: 10px;
    color: #999;
    margin-top: 1px;
}

/* 姓名列 - WPS风格固定列 */
.user-cell {
    padding: 6px 8px !important;
    text-align: left;
    position: sticky;
    z-index: 5;
    background: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 姓名列 */
td.user-cell:first-child,
th.user-cell:first-child {
    left: 0;
    width: 72px;
    border-right: 1px solid #d9d9d9;
}

/* 岗位列 */
td.user-cell:nth-child(2),
th.user-cell:nth-child(2) {
    left: 72px;
    width: 80px;
    border-right: 1px solid #d9d9d9;
}

.user-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.user-position {
    font-size: 12px;
    color: #4a4a4a;
    margin-top: 2px;
}

/* 统计列 */
th.stat-header {
    background: #f5f6f7;
    width: 44px;
}

.stat-cell {
    padding: 4px 2px !important;
    text-align: center;
    background: #fafafa;
    border-left: 1px solid #e8e8e8;
}

.stat-value {
    font-weight: 500;
    font-size: 13px;
    color: #333;
    line-height: 1.2;
}

.stat-label {
    font-size: 10px;
    color: #999;
    margin-top: 1px;
}

.stat-value.weekend {
    color: var(--warning);
}

/* 排班格子 - WPS风格 */
.schedule-cell {
    min-height: 48px;
    padding: 2px !important;
    cursor: pointer;
    vertical-align: top;
    transition: background 0.15s ease;
    text-align: center;
}

.schedule-cell:hover {
    background: #e8f4fd;
}

.schedule-cell.empty:hover {
    background: #fef3c7;
}

/* ==================== 班次色块 ==================== */
.shift-badge {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    margin: 1px;
    white-space: nowrap;
    line-height: 1.4;
}

.shift-badge[data-code="zao"], .shift-zao { background: var(--shift-zao); color: white; }
.shift-badge[data-code="bai"], .shift-bai { background: var(--shift-bai); color: white; }
.shift-badge[data-code="wan"], .shift-wan { background: var(--shift-wan); color: white; }
.shift-badge[data-code="manwan"], .shift-manwan { background: var(--shift-manwan); color: white; }
.shift-badge[data-code="zhongzao"], .shift-zhongzao { background: var(--shift-zhongzao); color: white; }
.shift-badge[data-code="zhongwan"], .shift-zhongwan { background: var(--shift-zhongwan); color: white; }
.shift-badge[data-code="xiu"], .shift-xiu { background: var(--shift-xiu); color: white; }
.shift-badge[data-code*="peixun"], .shift-badge[data-code*="jinxiu"], .shift-badge[data-code*="huiyi"], .shift-special { background: var(--shift-special); color: white; }
.shift-badge[data-code="daozhenban"], .shift-badge[data-code="daohao"] { background: #26c6da; color: white; }
.shift-badge[data-code="jiaban"] { background: #ec4899; color: white; }

/* ==================== 列状态 ==================== */
.weekend-col { background: #f8fafc; }
.weekend-col .date-week { color: var(--danger); }

.today-col { background: #eff6ff; }
.today-col .date-num {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.gap-cell { background: #fef2f2 !important; position: relative; }
.gap-warning { display: block; font-size: 10px; color: var(--danger); margin-top: 2px; font-weight: 500; }

.position-separator td {
    background: #e2e8f0 !important;
    color: #334155 !important;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 12px;
    letter-spacing: 1px;
}

.position-group-header { text-align: left; }

tbody tr:not(.position-separator):nth-child(even) td:not(.schedule-cell) {
    background: #fafbfc;
}

/* ==================== 换班模式 ==================== */
.swap-mode .schedule-cell {
    outline: 2px dashed var(--warning);
    outline-offset: -2px;
}

.swap-selected {
    outline: 3px solid var(--success) !important;
    background: #f0fdf4 !important;
}

/* ==================== 加载状态 ==================== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 14px;
}

.loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 16px auto 0;
    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); } }

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-white);
    padding: 24px;
    border-radius: var(--radius-lg);
    width: 440px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.modal-body { margin-bottom: 20px; }

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

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

/* ==================== 表单 ==================== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: #475569; font-size: 13px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s ease;
}
.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(99, 102, 241, 0.1);
}
.form-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.form-section-title { font-size: 13px; font-weight: 600; color: #64748b; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-help { font-size: 12px; color: #94a3b8; margin-top: 4px; }

/* ==================== 提示消息 ==================== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ==================== 信息提示 ==================== */
.info-text { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.gap-info { background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-sm); padding: 12px; margin-top: 12px; }
.gap-info h4 { color: #991b1b; font-size: 13px; margin-bottom: 8px; }
.gap-info ul { margin: 0; padding-left: 20px; font-size: 12px; color: #7f1d1d; }
.gap-info li { margin-bottom: 4px; }

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .main-container { padding: 12px; }
    .toolbar { padding: 12px 16px; }
    .date-cell { min-width: 42px; }
    .schedule-cell { min-height: 48px; }
}

@media (max-width: 768px) {
    .nav { padding: 0 12px; }
    .nav a { padding: 12px 14px; font-size: 13px; }
    .toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
    .toolbar-left, .toolbar-right { justify-content: center; }
    .month-nav { width: 100%; justify-content: center; }
    .btn { padding: 8px 12px; font-size: 13px; }
    .user-info { width: 100%; justify-content: center; padding: 8px 0; border-bottom: 1px solid #334155; }
    .table-container { border-radius: var(--radius); }
    .header-row th { padding: 8px 4px; font-size: 11px; }
    .date-cell { min-width: 38px; }
    .date-num { font-size: 12px; }
    .user-cell { min-width: 80px; }
    .user-name { font-size: 12px; }
    .shift-badge { padding: 2px 4px; font-size: 10px; }
    .modal-content { padding: 16px; margin: 12px; width: calc(100% - 24px); }
}

/* 移动端滚动提示 */
@media (max-width: 768px) {
    .table-wrapper::after {
        content: '← 左右滑动查看更多 →';
        position: sticky;
        right: 0;
        bottom: 0;
        background: linear-gradient(transparent, rgba(255,255,255,0.95));
        padding: 8px;
        text-align: center;
        font-size: 11px;
        color: #94a3b8;
        display: block;
        pointer-events: none;
    }
}

/* 隐藏滚动提示（PC端） */
@media (min-width: 769px) {
    .table-wrapper::after { display: none; }
}

/* ==================== 手机端响应式 ==================== */
@media (max-width: 768px) {
    .table-wrapper {
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #c1c1c1 #f1f1f1;
    }
    .table-wrapper::-webkit-scrollbar { height: 6px; }
    .table-wrapper::-webkit-scrollbar-track { background: #f1f1f1; }
    .table-wrapper::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
    /* 手机端不用fixed布局，用auto+滚动条 */
    #scheduleTable {
        table-layout: auto;
        font-size: 10px;
        width: auto;
        min-width: 100%;
    }
    #scheduleTable th, #scheduleTable td { padding: 2px 1px; font-size: 10px; }
    #scheduleTable .shift-badge { font-size: 9px !important; padding: 1px 3px !important; }
    #scheduleTable .user-name { font-size: 10px !important; }
    #scheduleTable .stat-cell .stat-value { font-size: 9px !important; }
    #scheduleTable .date-cell { min-width: 30px; padding: 3px 1px !important; }
    #scheduleTable .date-num { font-size: 10px; }
    #scheduleTable .date-week { font-size: 8px; }
    #scheduleTable .user-cell { min-width: 50px; max-width: 50px; padding: 4px 3px !important; font-size: 9px; }
    .header-row th:first-child { width: 50px; }
    .header-row th:nth-child(2) { left: 50px; width: 50px; }
    td.user-cell:first-child, th.user-cell:first-child { left: 0; width: 50px; }
    td.user-cell:nth-child(2), th.user-cell:nth-child(2) { left: 50px; width: 50px; }
    #scheduleTable .schedule-cell { min-height: 40px; padding: 1px !important; }
    #scheduleTable th.stat-header { min-width: 35px; font-size: 8px; }
    #scheduleTable .stat-cell { padding: 2px 1px !important; }
    .table-wrapper::after { display: none !important; }
}

/* ==================== 移动端响应式缩放增强 ==================== */
@media (max-width: 768px) {
    .shift-badge { padding: 1px 2px !important; font-size: 10px !important; }
    .user-name { font-size: 10px !important; }
    #scheduleTable th, #scheduleTable td { padding: 2px 1px; font-size: 10px; }
}

/* PC端允许横向滚动，手机端缩放 */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

/* ==================== 自动排班选项面板样式 ==================== */
#autoScheduleModal .modal-content { max-width: 500px; }
#autoScheduleModal .modal-header { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; font-size: 16px; }

.position-checkbox-list { border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px; background: #fafafa; }
.position-checkbox-item { margin-bottom: 10px; }
.position-checkbox-item label { display: flex; align-items: center; padding: 8px 0; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
.position-checkbox-item:last-child label { border-bottom: none; }
.position-checkbox-item input[type="checkbox"] { margin-right: 10px; width: 18px; height: 18px; cursor: pointer; }
.position-checkbox-item .position-name { font-weight: 600; color: #1e293b; min-width: 60px; }
.position-checkbox-item .position-desc { color: #64748b; font-size: 13px; margin-left: 8px; }

.support-option { display: flex; align-items: center; padding: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; margin-top: 12px; }
.support-option input[type="checkbox"] { margin-right: 10px; width: 18px; height: 18px; cursor: pointer; }
.support-option .support-label { font-weight: 600; color: #166534; }
.support-option .support-desc { color: #15803d; font-size: 13px; margin-left: 8px; }

.rules-info { background: #fffbeb; border: 1px solid #ffe58f; border-radius: 8px; padding: 14px; margin-top: 16px; }
.rules-info .rules-title { font-weight: 600; margin-bottom: 10px; color: #ad6800; }
.rules-info .rule-item { font-size: 13px; color: #92400e; line-height: 1.8; margin-bottom: 4px; }
.rules-info .rule-item strong { color: #78350f; }

.batch-action-buttons { display: flex; gap: 8px; margin-top: 8px; }
.batch-action-buttons button { padding: 6px 14px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; font-size: 13px; transition: all 0.2s ease; }
.batch-action-buttons button:hover { background: #f5f5f5; border-color: #ccc; }

#copyScheduleModal .modal-header { background: linear-gradient(135deg, #4CAF50, #45a049); color: white; }
#copyScheduleModal .copy-days-btn:hover { background: #4CAF50 !important; color: white !important; }

#quickPanel .shift-badge-with-delete { position: relative; display: inline-block; }
#quickPanel .shift-delete-btn { position: absolute; top: -6px; right: -6px; background: #f44336; color: white; border-radius: 50%; width: 16px; height: 16px; line-height: 16px; text-align: center; cursor: pointer; font-size: 10px; border: none; padding: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
#quickPanel .shift-delete-btn:hover { background: #d32f2f; transform: scale(1.1); }

.quick-action-buttons { display: flex; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee; }
.quick-action-buttons button { flex: 1; padding: 10px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s ease; }
.quick-action-buttons .copy-btn { background: #4CAF50; color: white; }
.quick-action-buttons .copy-btn:hover { background: #45a049; }
.quick-action-buttons .clear-btn { background: #FF9800; color: white; }
.quick-action-buttons .clear-btn:hover { background: #f57c00; }

/* 开关组件样式 */
.switch { position: relative; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch input:checked + .slider { background: #4CAF50; }
.switch input:checked + .slider:before { transform: translateX(20px); }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 24px; transition: .3s; }
.switch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; transition: .3s; border-radius: 50%; }

#scheduleConfigContent .position-tag { display: inline-flex; align-items: center; padding: 4px 12px; background: #e8f5e9; border-radius: 16px; margin: 2px; font-size: 12px; cursor: pointer; transition: all 0.2s; }
#scheduleConfigContent .position-tag:hover { background: #c8e6c9; }
#scheduleConfigContent .position-tag.selected { background: #4CAF50; color: white; }

#exportYear, #exportMonth { min-width: 100px; }

/* ==================== 手机端底部面板 ==================== */
.mobile-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 9998; opacity: 0; transition: opacity 0.25s ease; }
.mobile-overlay.show { opacity: 1; }

.mobile-bottom-panel { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -2px 20px rgba(0,0,0,0.15); max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch; transform: translateY(100%); transition: transform 0.3s ease; padding: 0; }
.mobile-bottom-panel.show { transform: translateY(0); }
.mobile-panel-handle { width: 36px; height: 4px; background: #d1d5db; border-radius: 2px; margin: 8px auto 0; }
.mobile-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f0f0f0; }
.mobile-panel-title { font-size: 16px; font-weight: 600; color: #1e293b; }
.mobile-panel-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: none; background: #f1f5f9; border-radius: 50%; font-size: 18px; color: #64748b; cursor: pointer; }
.mobile-panel-body { padding: 12px 16px 24px; }

.mobile-current-shifts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mobile-shift-tag { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; color: #fff; font-size: 14px; font-weight: 500; min-height: 36px; }
.mobile-shift-delete { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.3); border-radius: 50%; font-size: 14px; cursor: pointer; margin-left: 4px; }
.mobile-shift-delete:active { background: rgba(255,255,255,0.6); }
.mobile-shift-input { width: 100%; padding: 12px 14px; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 16px; box-sizing: border-box; margin-bottom: 10px; }
.mobile-shift-results { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mobile-shift-btn { padding: 10px 18px; border: none; border-radius: 8px; color: #fff; font-size: 15px; font-weight: 500; cursor: pointer; min-height: 44px; min-width: 56px; }
.mobile-action-row { display: flex; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.mobile-action-btn { flex: 1; padding: 12px 8px; border: none; border-radius: 10px; color: #fff; font-size: 15px; font-weight: 500; cursor: pointer; min-height: 48px; }
.mobile-all-shifts { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.mobile-all-shifts-title { font-size: 13px; color: #94a3b8; margin-bottom: 8px; }
.mobile-all-shifts-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==================== 手机端工具栏折叠 ==================== */
.mobile-more-btn { display: none; padding: 8px 14px; background: #475569; color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; min-height: 38px; }
.mobile-more-menu { display: none; position: absolute; top: 100%; right: 0; background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); min-width: 160px; z-index: 100; overflow: hidden; }
.mobile-more-menu.show { display: block; }
.mobile-more-menu button { display: block; width: 100%; padding: 14px 16px; border: none; background: #fff; text-align: left; font-size: 14px; color: #334155; cursor: pointer; min-height: 48px; }
.mobile-more-menu button:active { background: #f1f5f9; }
.mobile-more-menu button + button { border-top: 1px solid #f0f0f0; }
.mobile-more-menu button.danger { color: #ef4444; }

/* ==================== 手机端响应式 ==================== */
@media (max-width: 768px) {
    .schedule-cell { min-height: 48px !important; min-width: 40px !important; padding: 4px !important; }
    .shift-badge { padding: 3px 6px !important; font-size: 11px !important; min-height: 24px; display: inline-flex; align-items: center; }
    .toolbar-right .btn-warning, .toolbar-right .btn-success, .toolbar-right .btn-secondary, .toolbar-right .btn-danger, .toolbar-right .btn-primary, .toolbar-right .btn-info { display: none; }
    .mobile-more-btn { display: inline-block; }
    .toolbar-right { position: relative; }
    .mobile-bottom-panel, .mobile-overlay { display: block; }
    #quickPanel { display: none !important; }
    .nav a { padding: 10px 10px; font-size: 13px; }
    th.stat-header, td.stat-cell { display: none; }
}

/* 隐藏人员行样式（半透明+标签） */
.user-hidden-row { opacity: 0.6; }
.user-hidden-row:hover { opacity: 0.85; }
.user-hidden-tag {
    display: inline-block;
    background: #9e9e9e;
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}
.user-hidden-row td {
    background: #fafafa !important;
}