/* ======================================================== */
/* 1. 基础与画布重置 (iPad 全屏优化)                          */
/* ======================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #f8f9fa;
}

/* 全屏主弹性容器 */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* 右侧主画布 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ======================================================== */
/* 2. 顶部工具栏 (Header & Navigation)                       */
/* ======================================================== */
.top-header {
    height: 70px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Clover 品牌区域 */
.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 15px;
}
.logo-icon {
    font-size: 26px;
    color: #43b02a; /* Clover 经典品牌绿 */
}
.logo-text {
    font-size: 22px;
    font-weight: bold;
    color: #1e252b;
    letter-spacing: -0.5px;
}

.date-navigator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-date {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    min-width: 180px;
    text-align: center;
}

/* 语言切换下拉框 */
.lang-selector-box {
    min-width: 120px;
}
.lang-select {
    width: 100%;
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
}

/* iPad 舒适触控按钮通用规范 (44px 触控法则) */
button {
    font-size: 15px;
    padding: 11px 18px;
    border-radius: 6px;
    border: 1px solid #cbd5e0;
    background-color: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}
button:active {
    background-color: #edf2f7;
}
.nav-arrow {
    padding: 8px 14px;
    color: #4a5568;
}
.btn-today {
    font-weight: 500;
    color: #4a5568;
}
.btn-primary {
    background-color: #43b02a;
    color: white;
    border: none;
    font-weight: 600;
}
.btn-primary:active {
    background-color: #368d20;
}

/* ======================================================== */
/* 3. 预约看板底色网格 (Schedule Grid)                         */
/* ======================================================== */
.grid-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 固定左侧时间轴 */
.time-column {
    width: 90px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.time-slot-header {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #a0aec0;
    border-bottom: 1px solid #e2e8f0;
    font-weight: bold;
}
.time-slot {
    height: 70px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
    font-size: 12px;
    color: #718096;
    border-bottom: 1px solid #edf2f7;
}

/* 双轴滑动看板主体 */
.schedule-board {
    flex: 1;
    overflow: auto;
    background-color: #f7fafc;
    -webkit-overflow-scrolling: touch; /* iPad 丝滑滚动 */
}
.board-columns {
    display: flex;
    height: 100%;
}

/* 独立员工大列 */
.staff-column {
    width: 250px;
    border-right: 1px solid #e2e8f0;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.staff-header {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}
.slots-container {
    position: relative;
    height: 700px;
    background-image: linear-gradient(#edf2f7 1px, transparent 1px);
    background-size: 100% 70px;
}

/* 看板预约记录卡片 */
.appointment-card {
    position: absolute;
    left: 8px;
    right: 8px;
    border-radius: 6px;
    padding: 10px;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    border-left: 4px solid #43b02a;
    display: flex;
    flex-direction: column;
}
.card-confirmed { background-color: #e6f6e6; border-left-color: #43b02a; color: #235815; }
.card-pending { background-color: #fef3c7; border-left-color: #d97706; color: #78350f; }
.app-client { font-weight: bold; margin-bottom: 2px; }
.app-service { font-size: 11px; opacity: 0.9; }

/* ======================================================== */
/* 4. 新版大模态框 (Premium Wide Modal)                      */
/* ======================================================== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* 强制依靠 .active 类通过 JS 触发 */
    align-items: center;
    justify-content: center;
    z-index: 9999 !important; /* 绝对置顶层级保护 */
}
.modal-overlay.active { display: flex !important; }

.modal-box.wide-modal {
    background: #ffffff;
    width: 85vw;
    max-width: 960px;
    max-height: 92vh; /* 适配 iPad 安全视区，绝不撑爆屏幕 */
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 顶部蓝色大通栏 */
.modal-blue-header {
    background-color: #0066ff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.header-datetime-pickers { display: flex; gap: 10px; }
.picker-box {
    background-color: #ffffff; border-radius: 6px; padding: 6px 12px;
    display: flex; align-items: center; gap: 6px;
}
.picker-box input { border: none; font-size: 16px; font-weight: 600; color: #1e252b; outline: none; }
.picker-icon { font-size: 14px; color: #4a5568; }
.btn-close-x { background: transparent; border: none; color: #ffffff; font-size: 22px; cursor: pointer; }

/* 弹窗核心滚动表单区 */
.modal-body-premium {
    padding: 24px;
    background-color: #ffffff;
    overflow-y: auto; /* 内容过长时，内部平滑纵向滚动 */
    flex: 1;
}
.form-row-flex { display: flex; gap: 20px; align-items: flex-end; }
.margin-top-md { margin-top: 16px; }
.margin-top-lg { margin-top: 24px; }
.flex-1 { flex: 1; }

/* 带有左侧固定修饰图标的输入栏 */
.input-with-icon {
    display: flex;
    align-items: center;
    border: 1px solid #b3d1ff;
    border-radius: 6px;
    padding: 10px 14px;
    background-color: #ffffff;
}
.phone-flex { flex: 2; border-color: #a3c7ff; }
.notes-flex { flex: 4; background-color: #e9ecef; border-color: #ced4da; }
.notes-flex input { background-color: #e9ecef; }
.input-with-icon span { margin-right: 8px; font-size: 16px; }
.input-with-icon input { border: none; width: 100%; font-size: 16px; outline: none; color: #333; }

/* 名/姓 纯白表单字段 */
.flex-field { flex: 2; display: flex; flex-direction: column; }
.flex-field input { width: 100%; padding: 12px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 16px; outline: none; color: #333; background: #fafafa; }
.flex-field input:focus { border-color: #0066ff; background: #ffffff; }
.premium-label { font-size: 15px; font-weight: bold; color: #1e252b; margin-bottom: 8px; display: flex; align-items: center; gap: 4px; }
.label-icon { color: #0066ff; }

/* 出勤率与多人数下拉槽 */
.flex-field-short { flex: 1.5; display: flex; flex-direction: column; }
.premium-label-status { font-size: 14px; font-weight: bold; color: #1e252b; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.status-check { color: #0066ff; font-weight: bold; }
.badge-green { background-color: #198754; color: white; font-size: 12px; padding: 2px 6px; border-radius: 4px; margin-left: 4px; }
.people-selector-wrapper { display: flex; align-items: center; border: 1px solid #cbd5e0; border-radius: 6px; padding: 6px 10px; background-color: #ffffff; gap: 6px; }
.people-selector-wrapper select { border: none; font-size: 16px; outline: none; flex: 1; background: transparent; color: #333; }
.crown-icon { color: #ffc107; font-size: 16px; }

/* 分块小标题栏 */
.section-title-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #edf2f7; padding-bottom: 8px; }
.title-left { display: flex; align-items: center; gap: 6px; }
.title-icon { color: #0066ff; font-size: 16px; }
.title-text { font-size: 15px; font-weight: bold; color: #0066ff; }

/* 线框新增联动激发钮 */
.btn-outline-add { border: 1px solid #0066ff; color: #0066ff; font-weight: 600; background: #ffffff; padding: 6px 14px; border-radius: 4px; font-size: 14px; }

/* ======================================================== */
/* 5. 还原图片细节：明细账目表单 (Premium Table)              */
/* ======================================================== */
.premium-table-wrapper { margin-top: 12px; border: 1px solid #dee2e6; border-radius: 4px; overflow: hidden; }
.premium-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.premium-table th { background-color: #f8f9fa; color: #212529; padding: 12px; font-weight: bold; border-bottom: 2px solid #dee2e6; }
.premium-table td { padding: 12px; border-bottom: 1px solid #dee2e6; vertical-align: middle; color: #495057; }

/* 垃圾桶图标 */
.btn-delete-row { color: #dc3545; margin-right: 6px; cursor: pointer; font-size: 14px; user-select: none; }

/* 表格内技师蓝色小气泡按钮 */
.btn-staff-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #b3d1ff; color: #0066ff; background-color: #f0f5ff; padding: 6px 14px; border-radius: 4px; font-size: 14px; font-weight: 500; }

/* 时长微调步进器布局 ([-] 11:21-12:06(45min) [+]) */
.duration-stepper { display: inline-flex; align-items: center; border: 1px solid #cbd5e0; border-radius: 6px; overflow: hidden; background: #ffffff; }
.step-btn { border: none; background: #ffffff; color: #0066ff; font-size: 18px; font-weight: bold; padding: 6px 14px; cursor: pointer; }
.step-btn:active { background-color: #f7fafc; }
.step-btn.btn-minus { border-right: 1px solid #cbd5e0; }
.step-btn.btn-plus { border-left: 1px solid #cbd5e0; }
.duration-display-text { padding: 0 12px; font-size: 13px; font-weight: 500; color: #2d3748; white-space: nowrap; }

/* 表格底部概况重排小横条 */
.table-footer-summary { background-color: #f8f9fa; padding: 10px 12px; display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.summary-text { font-size: 14px; font-weight: bold; color: #212529; }
.text-green { color: #198754; }
.btn-warning-sm { background-color: #ffc107; border: none; color: #212529; font-weight: bold; padding: 6px 12px; border-radius: 4px; font-size: 13px; }

/* 底部备注大文本域 */
.premium-textarea { width: 100%; height: 90px; border: 1px solid #cbd5e0; border-radius: 6px; padding: 12px; font-size: 15px; margin-top: 8px; outline: none; resize: none; color: #333; }

/* ======================================================== */
/* 6. 大弹窗底部全功能固化操作栏                                */
/* ======================================================== */
.modal-premium-footer {
    padding: 16px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* 强行在底部锁死，绝不随中段变长而掉出视图 */
}
.footer-left-buttons { display: flex; gap: 8px; }
.btn-action-outline { background: #ffffff; padding: 10px 14px; font-weight: 600; font-size: 14px; border-radius: 6px; }
.text-blue { border: 1px solid #b3d1ff; color: #0066ff; }
.text-orange { border: 1px solid #ffe3b3; color: #ff9900; }
.text-gray { border: 1px solid #ced4da; color: #6c757d; }

.btn-action-submit { background-color: #198754; color: #ffffff; border: none; font-weight: bold; padding: 12px 24px; border-radius: 6px; font-size: 15px; }
.btn-action-submit:active { background-color: #146c43; }

/* ======================================================== */
/* 7. 核心重构：三级高频流式联动触控矩阵 (Service Matrix)       */
/* ======================================================== */
.service-picker-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: none; align-items: center; justify-content: center;
    z-index: 10000 !important; /* 二级深层大浮面，比第一层更高 */
}
.service-picker-overlay.active { display: flex !important; }

.matrix-picker-box {
    background: #ffffff;
    width: 90vw;
    max-width: 1000px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.25s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.matrix-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}
.matrix-title { font-size: 16px; font-weight: bold; color: #2d3748; }
.matrix-close { background: transparent; border: none; font-size: 20px; color: #a0aec0; cursor: pointer; }

.matrix-body {
    padding: 20px;
    background: #ffffff;
    max-height: 75vh;
    overflow-y: auto;
}

.matrix-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid #f7fafc;
    padding-bottom: 16px;
}
.matrix-section:last-child { border-bottom: none; }

.matrix-label {
    font-size: 13px;
    font-weight: bold;
    color: #718096;
    margin-bottom: 4px;
}

/* 磁贴流式平铺自动换行容器 */
.matrix-flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 🌟 高清打磨的高质感触控磁贴 (完全还原图片效果) 🌟 */
.matrix-btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    color: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* 一级大类尺寸 */
.matrix-btn.level-1 {
    font-size: 15px;
    padding: 14px 24px;
}

/* 二级服务项目尺寸 */
.matrix-btn.level-2 {
    font-size: 13px;
    padding: 10px 18px;
}

/* 三级周数模板尺寸 */
.matrix-btn.level-3 {
    font-size: 12px;
    padding: 8px 14px;
    font-weight: 500;
}

/* 实体化下凹式触控反馈 */
.matrix-btn:active {
    transform: scale(0.96);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 选中高亮保护框 */
.matrix-btn.active-filter {
    outline: 3px solid #0066ff;
    outline-offset: 2px;
}

/* 暗度衰减逻辑：当某个元素被独立选中时，其余未选中的非同级会被柔和降暗 */
.matrix-btn.dimmed {
    opacity: 0.4;
    box-shadow: none;
}