
        * { box-sizing: border-box; }
        body { 
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; 
            margin: 0; 
            padding: 20px; 
            background: #f5f5f7; 
            color: #333; 
        }
        .container { max-width: 1200px; margin: 0 auto; }
        
        /* 顶部导航 */
        .header { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            margin-bottom: 30px; 
        }
        
        /* 财务统计 */
        .finance-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }
        .finance-card {
            background: white;
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        }
        .finance-card h3 {
            margin: 0 0 10px 0;
            font-size: 14px;
            color: #666;
        }
        .finance-card p {
            margin: 0;
            font-size: 24px;
            font-weight: 600;
        }
        .finance-card.deposit { border-top: 4px solid #007aff; }
        .finance-card.balance { border-top: 4px solid #34c759; }
        .finance-card.total { border-top: 4px solid #ff9500; }
        .finance-card.received { border-top: 4px solid #af52de; }
        
        /* 订单统计 */
        .order-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-bottom: 18px;
        }
        .stat-card { 
            background: white; 
            padding: 10px 12px; 
            border-radius: 10px; 
            box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
        }
        /* 压缩状态卡高度：清除 h3/p 默认外边距 + 收紧字号行高 */
        .stat-card h3 { font-size: 12px; font-weight: 600; color: #666; margin: 0 0 2px; }
        .stat-card p { font-size: 22px; font-weight: 700; color: #222; margin: 0; line-height: 1.1; }
        
        /* 订单卡片 */
        .orders-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
            gap: 20px;
        }
        /* 列表视图容器：单列通栏，电脑网页端列表占满整行（不套用卡片多列网格） */
        #ordersContainer.orders-list-wrap { display: block; }

        /* 订单列表工具条：搜索 + 阶段筛选 + 视图切换 */
        .order-toolbar {
            display: flex;
            gap: 10px;
            margin-bottom: 16px;
            flex-wrap: wrap;
            align-items: center;
        }
        .order-toolbar-search {
            display: flex;
            gap: 8px;
            flex: 1 1 220px;
            min-width: 0;
        }
        .order-search {
            flex: 1 1 auto;
            width: 100%;
            min-width: 0;
            height: 40px;
            padding: 0 12px;
            border: 1px solid #d0d0d5;
            border-radius: 8px;
            font-size: 14px;
            background: #fff;
            box-sizing: border-box;
            -webkit-appearance: none;
            appearance: none;
        }
        /* 搜索按钮：与新建订单同款实心样式，通用搜索蓝（Google 蓝） */
        .btn-search {
            flex: none;
            height: 40px;
            padding: 0 16px;
            background: rgba(66,133,244,0.78);
            color: #fff;
            font-size: 14px;
        }
        .btn-search:hover { background: rgba(66,133,244,0.92); }
        .order-filter {
            height: 40px;
            padding: 0 12px;
            border: 1px solid #d0d0d5;
            border-radius: 8px;
            font-size: 14px;
            background: #fff;
            color: #333;
            cursor: pointer;
        }
        /* 视图切换（Windows 风格分段控件） */
        .order-view-toggle {
            display: inline-flex;
            border: 1px solid #d0d0d5;
            border-radius: 8px;
            overflow: hidden;
            height: 40px;
            flex: none;
        }
        .order-view-toggle button {
            border: none;
            background: #f5f5f7;
            color: #555;
            font-size: 13px;
            padding: 0 14px;
            cursor: pointer;
            white-space: nowrap;
        }
        .order-view-toggle button + button { border-left: 1px solid #d0d0d5; }
        .order-view-toggle button.active { background: #007aff; color: #fff; font-weight: 600; }
        /* 紧凑列表视图（订单多时快速浏览，点击行看详情） */
        .order-list {
            background: #fff;
            border: 1px solid #e5e5ea;
            border-radius: 12px;
            overflow: hidden;
        }
        .order-list-head, .order-list-row {
            display: grid;
            grid-template-columns: 90px minmax(120px, 1fr) 130px 150px 110px 110px 76px;
            gap: 8px;
            align-items: center;
            padding: 10px 12px;
        }
        .order-list-head {
            background: #f7f7fa;
            font-size: 12px;
            color: #888;
            font-weight: 600;
        }
        .order-list-row {
            border-top: 1px solid #f0f0f3;
            font-size: 13px;
            cursor: pointer;
            transition: background 0.15s;
        }
        .order-list-row:hover { background: #f2f7ff; }
        .order-list-row.urgent { border-left: 3px solid #ff3b30; }
        .order-list-row.warning { border-left: 3px solid #ff9f0a; }
        .order-list-row .cell-no { color: #888; font-size: 12px; }
        .order-list-row .cell-name { font-weight: 600; color: #222; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .order-list-row .cell-phone { color: #666; }
        .order-list-row .cell-stage { display: flex; gap: 4px; flex-wrap: wrap; }
        .order-list-row .cell-date { color: #666; font-size: 12px; }
        .order-list-row .cell-amt { font-weight: 600; color: #007aff; text-align: right; }
        .order-list-row .cell-amt small { display: block; font-weight: 400; color: #999; font-size: 11px; }
        .order-list-row .cell-act { text-align: right; }
        .btn-detail { padding: 5px 10px; font-size: 12px; background: rgba(238,244,255,0.78); color: #007aff; border-radius: 6px; }
        .order-list-count { font-size: 12px; color: #999; text-align: center; padding: 10px 0 0; }
        @media (max-width: 768px) {
            .order-toolbar { flex-direction: row; flex-wrap: wrap; }
            .order-toolbar-search { flex: 1 1 100%; }
            .order-search { flex: 1 1 auto; height: 40px; }
            .order-filter { flex: 1 1 auto; }
            /* 手机端隐藏次要列，保留 单号/客户/阶段/金额/详情 */
            .order-list-head { display: none; }
            .order-list-head, .order-list-row { grid-template-columns: 1fr auto auto auto; }
            .order-list-row .col-phone, .order-list-row .col-date { display: none; }
            .order-list-row .cell-no { grid-column: 1; grid-row: 1; }
            .order-list-row .cell-name { grid-column: 1; grid-row: 2; }
            .order-list-row .cell-stage { grid-column: 2 / 4; grid-row: 1; justify-content: flex-end; }
            .order-list-row .cell-amt { grid-column: 3; grid-row: 2; }
            .order-list-row .cell-act { grid-column: 4; grid-row: 2; }
        }
        .order-card { 
            background: white; 
            border-radius: 12px; 
            padding: 20px; 
            box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
            transition: transform 0.2s; 
            position: relative;
        }
        .order-card:hover { transform: translateY(-2px); }
        
        /* 紧急状态样式 */
        .urgent { 
            border-left: 4px solid #ff3b30; 
            background: #fff5f5; 
        }
        .warning { 
            border-left: 4px solid #ff9500; 
            background: #fff9f0; 
        }
        .normal { border-left: 4px solid #34c759; }
        
        /* 标签样式 */
        .status-badge { 
            display: inline-block; 
            padding: 4px 12px; 
            border-radius: 20px; 
            font-size: 12px; 
            font-weight: 500; 
            margin-right: 8px;
        }
        .status-ongoing { background: #e3f2fd; color: #1976d2; }
        .status-pending { background: #fff3e0; color: #f57c00; }
        .status-completed { background: #e8f5e9; color: #388e3c; }

        /* 订单状态阶段徽章（按流转阶段与预警档位上色） */
        .stage-badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            margin-right: 8px;
            border: 1px solid transparent;
        }
        .stage-blue   { background: #e3f2fd; color: #1976d2; border-color: #bbdefb; }
        .stage-yellow { background: #fffde7; color: #b58100; border-color: #fff3b0; }
        .stage-orange { background: #fff3e0; color: #ef6c00; border-color: #ffe0b2; }
        .stage-green  { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
        .stage-red    { background: #ffebee; color: #c62828; border-color: #ffcdd2; }
        .stage-gray   { background: #eeeeee; color: #757575; border-color: #e0e0e0; }
        /* 订单卡片左侧阶段色条 */
        .order-card.stage-edge-blue   { border-left: 4px solid #1976d2; }
        .order-card.stage-edge-yellow { border-left: 4px solid #fbc02d; }
        .order-card.stage-edge-orange { border-left: 4px solid #ef6c00; }
        .order-card.stage-edge-green  { border-left: 4px solid #2e7d32; }
        .order-card.stage-edge-red    { border-left: 4px solid #c62828; }
        .order-card.stage-edge-gray   { border-left: 4px solid #bdbdbd; }
        /* ===== 档期日历 ===== */
        .calendar { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); margin-top: 14px; }
        .calendar-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
        .calendar-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; color: #222; min-width: 120px; }
        .calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
        .calendar-weekdays > div { text-align: center; font-size: 12px; color: #888; padding: 4px 0; }
        .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
        .cal-cell {
            min-height: 92px; border: 1px solid #eee; border-radius: 10px; padding: 6px;
            background: #fafafa; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
        }
        .cal-cell.empty { background: transparent; border: none; }
        .cal-cell.today { border-color: #007aff; box-shadow: 0 0 0 2px rgba(0,122,255,0.12); }
        .cal-cell.conflict { background: #fff1f0; border-color: #ff7875; }
        .cal-cell.blocked { background: #ffeaea; border: 1px dashed #ff4d4f; }
        .cal-cell.blocked.expired { background: #fff8f8; border-color: #f3c1c1; }
        .cal-cell.blocked.expired .block-dot { opacity: 0.45; }
        .cal-date .block-dot { color: #ff4d4f; font-size: 12px; }
        .cal-date { font-size: 12px; font-weight: 600; color: #555; display: flex; justify-content: space-between; align-items: center; }
        .cal-date .warn-dot { color: #cf1322; font-size: 12px; }
        .cal-chip {
            font-size: 11px; line-height: 1.35; color: #fff; border-radius: 6px; padding: 3px 5px;
            cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .cal-chip.conflict-chip { outline: 1px solid #cf1322; }
        .calendar-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: #666; }
        .calendar-legend span.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
        .conflict-panel { background: #fff1f0; border: 1px solid #ffccc7; border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
        .conflict-panel h4 { margin: 0 0 6px; color: #cf1322; font-size: 14px; }
        .conflict-panel li { font-size: 13px; color: #a8071a; margin: 3px 0; }
        .color-config { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
        .color-config label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #555; }
        .color-config input[type=color] { width: 42px; height: 28px; border: 1px solid #ddd; border-radius: 6px; background: #fff; padding: 0; }

        /* 超期统计卡 */
        .stat-card.stat-danger { background: #fff1f0; border: 1px solid #ffccc7; }
        .stat-card.stat-danger h3 { color: #cf1322; }
        .stat-card.stat-danger p { color: #cf1322; }
        
        /* 按钮样式 */
        .btn { 
            padding: 10px 20px; 
            border: none; 
            border-radius: 8px; 
            cursor: pointer; 
            font-weight: 500; 
            transition: all 0.2s; 
        }
        .btn-primary {
            background: rgba(0,122,255,0.78);
            color: white;
        }
        .btn-primary:hover { background: rgba(0,122,255,0.92); }
        .btn-secondary {
            background: rgba(245,245,247,0.78);
            color: #333;
        }
        /* 危险操作按钮（如删除工作室，不可逆）：红字浅底，与常规次要按钮区分，降低误点概率 */
        .btn-danger {
            background: rgba(255,59,48,0.10);
            color: #d32f2f;
        }
        .btn-danger:hover { background: rgba(255,59,48,0.20); }
        /* 顶栏彩色功能按钮（半透明背景，颜色区分；透明度 0.78，hover 0.92） */
        .btn-push { background: rgba(52,199,89,0.78); color: #fff; }
        .btn-push:hover { background: rgba(52,199,89,0.92); }
        .btn-admin { background: rgba(124,77,255,0.78); color: #fff; }
        .btn-admin:hover { background: rgba(124,77,255,0.92); }
        .btn-schedule { background: rgba(0,184,212,0.78); color: #fff; }
        .btn-schedule:hover { background: rgba(0,184,212,0.92); }
        .btn-packages { background: rgba(255,107,53,0.78); color: #fff; }
        .btn-packages:hover { background: rgba(255,107,53,0.92); }
        .btn-appdl { background: rgba(90,107,123,0.78); color: #fff; }
        .btn-appdl:hover { background: rgba(90,107,123,0.92); }
        .btn-sub { background: rgba(255,159,10,0.78); color: #fff; }
        .btn-sub:hover { background: rgba(255,159,10,0.92); }
        /* 通知/接单安排/导出数据：三色互异，且不与上方按钮撞色 */
        .btn-bell { background: rgba(255,45,85,0.78); color: #fff; }
        .btn-bell:hover { background: rgba(255,45,85,0.92); }
        .btn-block { background: rgba(88,86,214,0.78); color: #fff; }
        .btn-block:hover { background: rgba(88,86,214,0.92); }
        .btn-export { background: rgba(0,137,123,0.78); color: #fff; }
        .btn-export:hover { background: rgba(0,137,123,0.92); }
        
        /* 表单样式 */
        .modal { 
            display: none; 
            position: fixed; 
            top: 0; left: 0; 
            width: 100%; height: 100%; 
            background: rgba(0,0,0,0.5); 
            z-index: 1000; 
            overflow-y: auto;
            /* 手机端：滑动弹窗不再带动底层页面（禁止滚动穿透） */
            overscroll-behavior: contain;
            -webkit-overscroll-behavior: contain;
        }
        /* 弹窗打开时锁住背景滚动 */
        body.modal-open { overflow: hidden; }
        .modal-content {
            background: white;
            width: 90%;
            max-width: 600px;
            margin: 30px auto;
            padding: 30px;
            border-radius: 16px;
            max-height: calc(100vh - 40px);
            overflow-y: auto;
            /* 横向溢出保险：任何子元素（如 date 输入框固有宽度）都不得视觉上溢出卡片 */
            overflow-x: hidden;
        }
        
        /* 表单组样式 */
        .form-group {
            margin-bottom: 20px;
        }
        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
        }
        .form-group label.required::after {
            content: " *";
            color: #ff3b30;
        }
        .form-control {
            width: 100%;
            /* 允许被压缩到容器内：防止 date 等固有宽度输入框撑破表单/弹窗 */
            min-width: 0;
            max-width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
        }
        .form-control.error {
            border-color: #ff3b30;
        }
        .form-row {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 15px;
        }
        .form-row .form-group {
            flex: 1 1 170px;
            min-width: 150px;
            margin-bottom: 0;
        }
        /* 行尾按钮组不参与拉伸换行挤压 */
        .form-row .form-group:has(> button) {
            flex: 0 0 auto;
            min-width: 0;
        }
        
        /* 单选按钮组 */
        .radio-group {
            display: flex;
            gap: 20px;
            margin-top: 10px;
        }
        .radio-group label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: normal;
            cursor: pointer;
        }
        
        /* 错误提示 */
        .error-message {
            color: #ff3b30;
            font-size: 12px;
            margin-top: 5px;
            display: none;
        }
        
        /* 拍摄日期选择 */
        .date-selection {
            margin-top: 10px;
        }
        .selected-dates {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }
        .date-tag {
            background: #e3f2fd;
            padding: 6px 12px;
            border-radius: 16px;
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .date-tag button {
            background: none;
            border: none;
            color: #666;
            cursor: pointer;
            font-size: 16px;
        }
        
        /* 警告提示 */
        .alert {
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 15px;
            font-size: 13px;
        }
        .alert-warning {
            background: #fff3cd;
            border-left: 4px solid #ffc107;
            color: #856404;
        }
        .alert-info {
            background: #d1ecf1;
            border-left: 4px solid #17a2b8;
            color: #0c5460;
        }
        .alert-success {
            background: #d4edda;
            border-left: 4px solid #28a745;
            color: #155724;
        }
        
        /* 自定义项目输入 */
        .custom-input {
            margin-top: 10px;
            display: none;
        }
        
        /* 尾款结算状态 */
        .balance-status {
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 500;
            display: inline-block;
        }
        .balance-pending {
            background: #fff3cd;
            color: #856404;
        }
        .balance-paid {
            background: #d4edda;
            color: #155724;
        }
        
        /* 负责人标签 */
        .person-tag {
            display: inline-block;
            padding: 4px 10px;
            background: #f0f0f0;
            border-radius: 12px;
            font-size: 12px;
            margin-right: 5px;
            margin-bottom: 5px;
        }
        
        /* 套餐内容预览 */
        .package-preview {
            background: #f8f9fa;
            padding: 12px;
            border-radius: 8px;
            margin: 10px 0;
            font-size: 13px;
            max-height: 100px;
            overflow-y: auto;
            white-space: pre-wrap;
        }
        
        /* 交付期限详情 */
        .deadline-details {
            background: #f9f9f9;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 15px;
        }
        .deadline-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }
        .deadline-item:last-child {
            margin-bottom: 0;
            padding-bottom: 0;
            border-bottom: none;
        }
        .deadline-info {
            flex: 1;
        }
        .deadline-label {
            color: #666;
            font-weight: 500;
            font-size: 12px;
            margin-bottom: 3px;
        }
        .deadline-date {
            color: #333;
            font-weight: 500;
            font-size: 13px;
        }
        .deadline-remaining {
            text-align: right;
            min-width: 70px;
        }
        .deadline-time {
            font-size: 12px;
            font-weight: 500;
            padding: 3px 8px;
            border-radius: 10px;
            display: inline-block;
        }
        .time-urgent {
            background: #ffeaea;
            color: #ff3b30;
        }
        .time-warning {
            background: #fff3e0;
            color: #ff9500;
        }
        .time-normal {
            background: #e8f5e9;
            color: #34c759;
        }
        .time-expired {
            background: #ffebee;
            color: #d32f2f;
            font-weight: 600;
        }
        .time-delivered {
            background: #e8f5e9;
            color: #388e3c;
            font-weight: 600;
        }
        .time-overdue {
            background: #fff3e0;
            color: #ff9500;
            font-weight: 600;
        }
        
        .deadline-pending {
            color: #ff9500;
            font-style: italic;
            font-size: 12px;
        }
        .deadline-none {
            color: #999;
            font-style: italic;
            font-size: 12px;
        }
        
        .actual-delivery {
            font-size: 11px;
            color: #666;
            margin-top: 2px;
        }
        
        /* 日期输入带清除按钮 */
        .date-input-group {
            position: relative;
            display: flex;
            align-items: center;
        }
        .date-input-group .form-control {
            flex: 1;
            /* flex 子项默认 min-width:auto，日期输入框固有宽度会撑破行；归零后才能正常收缩 */
            min-width: 0;
        }
        .clear-date-btn {
            position: absolute;
            right: 10px;
            background: none;
            border: none;
            color: #999;
            cursor: pointer;
            font-size: 16px;
            padding: 0;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .clear-date-btn:hover {
            color: #ff3b30;
        }
        
        /* ===== 新增样式：婚礼地点 ===== */
        .wedding-locations {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 15px;
        }
        .wedding-location-group {
            margin-bottom: 10px;
        }
        .wedding-location-group:last-child {
            margin-bottom: 0;
        }
        .wedding-location-label {
            display: block;
            font-weight: 500;
            font-size: 13px;
            color: #333;
            margin-bottom: 5px;
        }
        .wedding-location-label::before {
            content: "🏠 ";
        }
        .wedding-location-input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 13px;
        }
        .wedding-location-display {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: 13px;
            color: #333;
            margin-bottom: 5px;
        }
        .wedding-location-display::before {
            content: "🏠 ";
        }
        .wedding-location-address {
            color: #666;
            font-size: 12px;
            margin-left: 5px;
        }
        
        /* ===== 新增样式：多选负责人 ===== */
        .multi-select-container {
            position: relative;
        }
        .multi-select-display {
            min-height: 40px;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            align-items: center;
        }
        .multi-select-options {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid #ddd;
            border-radius: 6px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            z-index: 100;
            max-height: 200px;
            overflow-y: auto;
            display: none;
        }
        .multi-select-option {
            padding: 8px 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .multi-select-option:hover {
            background: #f5f5f7;
        }
        .multi-select-option input[type="checkbox"] {
            margin: 0;
        }
        .multi-select-tag {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: #e3f2fd;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 12px;
        }
        .multi-select-tag-remove {
            background: none;
            border: none;
            color: #666;
            cursor: pointer;
            font-size: 14px;
            padding: 0;
            width: 16px;
            height: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .multi-select-tag-remove:hover {
            color: #ff3b30;
        }
        .multi-select-custom-input {
            padding: 8px 12px;
            border-top: 1px solid #eee;
        }
        .multi-select-custom-input .form-control {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 13px;
        }
        .multi-select-placeholder {
            color: #999;
            font-style: italic;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            /* 统计卡片：缩小 + 更紧凑网格（财务2列、阶段3列） */
            .finance-stats {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
            .order-stats {
                grid-template-columns: repeat(4, 1fr);
                gap: 8px;
            }
            .finance-card,
            .stat-card {
                padding: 10px 8px;
                border-radius: 8px;
            }
            .finance-card h3 { font-size: 11px; margin-bottom: 4px; }
            .finance-card p { font-size: 17px; }
            .stat-card h3 { font-size: 11px; margin-bottom: 4px; }
            .stat-card p { font-size: 17px; }
            .orders-grid { 
                grid-template-columns: 1fr; 
            }
            .form-row {
                flex-direction: column;
                gap: 15px;
            }
            .radio-group {
                flex-direction: column;
                gap: 10px;
            }
            .deadline-item {
                flex-direction: column;
                align-items: flex-start;
            }
            .deadline-remaining {
                margin-top: 5px;
                text-align: left;
            }
        }
    
        /* ===== 登录页 ===== */
        #loginScreen {
            position: fixed;
            inset: 0;
            background: linear-gradient(135deg, #007aff 0%, #34c759 100%);
            display: flex;
            align-items: flex-start;
            justify-content: center;
            overflow-y: auto;
            padding: 24px 0;
            -webkit-overflow-scrolling: touch;
            z-index: 2000;
        }
        .login-card {
            background: white;
            width: 90%;
            max-width: 380px;
            padding: 32px;
            border-radius: 16px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.25);
            margin: auto; /* 内容不多时垂直居中；内容超高时可整体滚动，不再被裁切 */
        }
        .login-card h2 { margin: 0 0 6px 0; text-align: center; }
        /* 品牌 Logo 位（登录页）：建议 512×512 透明底 PNG，显示尺寸 96×96 */
        .brand-logo-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
        .brand-logo {
            width: 96px; height: 96px; object-fit: contain; display: block;
            border-radius: 22px;
        }
        /* 顶部标题 Logo（应用内）：36×36（线稿细节多，稍大更清晰） */
        .app-title { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 20px; }
        .header-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
        .login-card .sub { text-align: center; color: #666; font-size: 13px; margin-bottom: 24px; }
        /* 风险声明（红色加粗，登录框内固定展示） */
        .disclaimer {
            margin-top: 14px;
            padding: 10px 12px;
            border-radius: 8px;
            background: #fff1f0;
            border: 1px solid #ffccc7;
            color: #cf1322;
            font-size: 12.5px;
            font-weight: 700;
            line-height: 1.6;
        }
        /* 底部三入口 */
        .auth-links { margin-top: 16px; text-align: center; font-size: 13px; color: #ccc; }
        .auth-links a { color: #007aff; text-decoration: none; margin: 0 6px; }
        .brand-footer { margin-top: 10px; text-align: center; font-size: 11px; color: #bbb; }
        /* 说明文档正文 */
        .doc-body { font-size: 13.5px; color: #444; line-height: 1.85; max-height: 62vh; overflow-y: auto; }
        .doc-body h4 { margin: 16px 0 6px; font-size: 14px; color: #222; }
        .doc-body h4:first-child { margin-top: 4px; }
        .doc-body ul { margin: 6px 0; padding-left: 20px; }
        .doc-body li { margin: 3px 0; }
        .doc-body .warn { color: #cf1322; font-weight: 700; }
        .doc-body .legal-red { color: #cf1322; font-weight: 700; }
        .doc-body .legal-box { border: 1px solid #f0b4b4; background: #fff5f5; border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
        .doc-body .legal-box ul { margin: 6px 0 0; }
        .login-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
        .login-tabs button {
            flex: 1; padding: 10px; border: none; border-radius: 8px;
            background: #f5f5f7; cursor: pointer; font-weight: 500; color: #666;
        }
        .login-tabs button.active { background: #007aff; color: white; }
        .login-error {
            background: #ffebee; color: #c62828; padding: 10px 12px;
            border-radius: 8px; font-size: 13px; margin-bottom: 12px; display: none;
        }
        /* 找回密码等发送成功提示：绿色，与错误态区分；否则用户会把「已发送」当成报错 */
        .login-success {
            background: #e8f5e9; color: #2e7d32; padding: 10px 12px;
            border-radius: 8px; font-size: 13px; margin-bottom: 12px; display: none;
        }
        #appRoot { display: none; }
        .topbar-user {
            display: flex; align-items: center; gap: 12px;
        }
        .topbar-user span { font-size: 14px; color: #666; }
        .btn-logout {
            background: rgba(255,59,48,0.78); color: white; padding: 8px 14px;
            border: none; border-radius: 8px; cursor: pointer; font-size: 13px;
        }

/* ===== 移动端适配修复（追加，勿动上方规则） ===== */
/* 1) 任何标记隐藏的元素必须彻底脱离布局，禁止"隐形占位"（弹窗大空隙根因） */
[hidden], .hidden { display: none !important; }

/* 2) 窄屏顶栏：改纵向堆叠，按钮组换行，杜绝标题竖排/按钮挤压 */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 20px;
  }
  .header > div:last-child {
    flex-wrap: wrap !important; /* 覆盖内联 display:flex;gap:10px 的按钮组 */
  }
  .header > div:last-child .btn {
    flex: 1 1 calc(50% - 10px);
    white-space: nowrap;
    text-align: center;
  }
  .app-title {
    font-size: 18px;
    line-height: 1.4;
    white-space: normal;
    width: 100%;
  }
  .topbar-user {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  /* 3) 弹窗移动端收紧：宽度、内边距、圆角 */
  .modal-content {
    width: 94% !important;
    max-width: none !important;
    margin: 16px auto !important;
    padding: 20px 16px !important;
    max-height: calc(100vh - 32px);
  }
  .modal-content h2 { font-size: 18px; }

  /* 接单安排/导出弹窗的表单行：手机端竖排铺满，避免日期+原因挤在一行溢出被裁 */
  .stack-form-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .stack-form-row > .form-group { flex: 1 1 auto !important; width: 100%; min-width: 0 !important; max-width: 100%; }
  .stack-form-row > .btn { width: 100%; margin-top: 4px; }
  /* 坑：date 输入框有 UA 固有最小宽度，flex/宽度约束不当会把弹窗内边距撑穿（右侧顶边）。
     上方 .form-control 的 min-width:0 + modal-content 的 overflow-x:hidden 为全局兜底。 */

  /* 4) 修复：竖排 form-row 中子项仍带 flex:1 1 170px（桌面横排的宽度基准），
        竖排时 170px 变成每组最小高度，导致字段间出现大片空白 */
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
  .form-row .form-group {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    width: 100%;
    margin-bottom: 0;
  }
  .form-row .form-group:has(> button) {
    justify-content: flex-start !important;
  }
  .form-group { margin-bottom: 14px; }
  .form-group label { margin-bottom: 6px; }
  .form-control { padding: 9px 10px; font-size: 16px; } /* 16px 防 iOS 聚焦自动放大 */
  .modal-content h3 { font-size: 16px; margin-top: 18px; }
  .modal-content h2 { margin-bottom: 12px; }
}

/* ===== 订阅状态卡片（工作室管理弹窗内）===== */
.sub-card {
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fafbfc;
  font-size: 13px;
  color: #444;
}
.sub-card--active { border-color: #b7e4c7; background: #f3fbf5; }
.sub-card--free { border-color: #ffe0b2; background: #fffaf2; }
.sub-card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.sub-badge { font-weight: 600; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.sub-badge--active { background: #e8f5e9; color: #2e7d32; }
.sub-badge--free { background: #fff3e0; color: #ef6c00; }
.sub-card__period { font-size: 12px; color: #888; }
.sub-feats { list-style: none; margin: 0 0 10px; padding: 0; }
.sub-feats li {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 5px 0; border-bottom: 1px dashed #eceff3;
}
.sub-feats li:last-child { border-bottom: none; }
.sub-feats .dot {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; background: #eef1f5; color: #666; margin-top: 1px;
}
.sub-feats .dot--ok { background: #e8f5e9; color: #2e7d32; }
.sub-feats .dot--no { background: #ffebee; color: #c62828; }
.sub-card__fee { font-size: 13px; margin-bottom: 10px; }
.sub-card__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sub-card__actions .btn { flex: 0 1 auto; }
.sub-card__note { font-size: 12px; color: #888; margin-top: 10px; line-height: 1.6; }

@media (max-width: 768px) {
  .sub-card__actions .btn { flex: 1 1 100%; }
}

/* ===== 设备自适应（电脑网页 / 手机网页 / 手机App） ===== */
/* 由 index.html 头部脚本给 <html> 打类：device-desktop-web / device-mobile-web / device-mobile-app */

/* 0) 全端通用：按钮文字禁止折行（顶栏「开启提醒 / App 下载 / 新建订单」文字竖排的根因） */
.btn, .btn-logout { white-space: nowrap; }

/* 1) 电脑网页：顶栏放不下时整体换行（按钮组整行下移），标题居中不再被挤成竖排 */
.device-desktop-web .header { flex-wrap: wrap; row-gap: 10px; }
.device-desktop-web .header > div:last-child { flex-wrap: wrap; }
.device-desktop-web .header .app-title { flex: 1 1 280px; min-width: 240px; justify-content: center; }

/* 2) 电脑网页中窄窗口（769~1280px）：收紧按钮与标题，避免五六个按钮把标题挤变形 */
@media (min-width: 769px) and (max-width: 1280px) {
  .device-desktop-web .header > div:last-child .btn { padding: 8px 12px; font-size: 13px; }
  .device-desktop-web .app-title { font-size: 16px; }
  .device-desktop-web .topbar-user span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .device-desktop-web .btn-logout { padding: 7px 10px; }
}

/* 3) 手机App（Capacitor / 添加到主屏幕）：适配刘海屏与底部手势条，加大触控目标 */
.device-mobile-app .header { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.device-mobile-app .modal-content { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.device-mobile-app .btn, .device-mobile-app .btn-logout { min-height: 42px; }

/* 4) 手机网页：触控目标下限（≤768px 布局沿用上方既有媒体查询） */
.device-mobile-web .btn, .device-mobile-web .btn-logout { min-height: 40px; }

/* ===== 文档弹窗层级：必须盖在所有业务弹窗（订阅状态/工作室管理/App下载等）之上 ===== */
#docModal { z-index: 3000; }

/* ===== 顶栏「开启提醒」免费版灰色态（仍可点击，点击提示订阅完整版） ===== */
.btn-push-off { opacity: 0.55; filter: grayscale(0.7); cursor: not-allowed; }

/* ===== 站内信铃铛 + 未读红点 ===== */
.btn-bell { position: relative; }
.notif-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: #f44336;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
}
#notifModal { z-index: 3300; }

/* ===== 顶栏用户信息区：用户名 + 订阅徽章（纵向排列） ===== */
.topbar-user-info {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; line-height: 1.25; min-width: 0;
}
/* 订阅徽章：高级金色渐变，仅工作室管理员且已订阅（含白名单）时显示 */
.topbar-user .sub-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  color: #6b4a00;
  background: linear-gradient(135deg, #f9e29c 0%, #ffd700 45%, #d99a1b 100%);
  border: 1px solid #e6b800;
  box-shadow: 0 1px 4px rgba(217, 154, 27, 0.35);
  white-space: nowrap; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 768px) {
  .topbar-user .sub-badge { max-width: 200px; font-size: 11px; }
}

/* ===== 订阅弹窗：自动续订开关 + 开通/续费面板 ===== */
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 13px; color: #444; border-top: 1px solid #eee; }
.sub-pay { margin-top: 12px; padding: 12px; background: #fafbfc; border: 1px solid #eee; border-radius: 10px; }
.sub-pay__title { font-size: 13px; color: #666; margin-bottom: 8px; }
.sub-pay__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sub-pay__hint { font-size: 12px; color: #999; margin-top: 8px; line-height: 1.5; }
.input--sm { padding: 7px 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 13px; background: #fff; }
/* 开关（toggle switch） */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 999px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: #34a853; }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ===== 顶栏「📋 更新日志」按钮（所有角色可见，蓝灰中性色） ===== */
.btn-changelog { background: rgba(96,125,139,0.78); color: #fff; }
.btn-changelog:hover { background: rgba(96,125,139,0.92); }

/* ===== 更新日志条目 ===== */
.cl-item { border-left: 3px solid #007aff; background: #f7f9fb; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.cl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cl-ver { font-size: 12px; font-weight: 700; color: #fff; background: #007aff; border-radius: 999px; padding: 2px 10px; }
.cl-date { font-size: 12px; color: #888; }
.cl-list { margin: 0; padding-left: 18px; }
.cl-list li { font-size: 13px; color: #444; line-height: 1.7; }

/* ===== 订单「📋 日志」弹窗层级：必须盖在订单详情弹窗之上（详情里点日志时不被挡住） ===== */
#orderChangesModal { z-index: 3100; }

/* ===== 弹窗层级阶梯：防止「从弹窗里再打开弹窗」被压在下面 =====
   基础 .modal=1000（顶层业务弹窗）
   订单详情 1200（可从列表打开，内部还要再开编辑/日志）
   说明文档 3000 / 订单日志 3100 / 编辑·新建 3200（永远在最上层） */
#orderDetailModal { z-index: 1200; }
#editOrderModal, #newOrderModal { z-index: 3200; }
