*{box-sizing:border-box;margin:0;padding:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;}
body{background:#f4f6fa;padding:10px;font-size:14px;color:#111827;}
a{text-decoration:none;color:inherit;}

/* ========== 通用容器 ========== */
.app-shell{background:#fff;border-radius:22px;overflow:hidden;box-shadow:0 20px 50px rgba(17,24,39,.08);margin-bottom:12px;}
.nav-bar{padding:16px;display:flex;justify-content:space-between;align-items:center;}
.nav-title{font-size:20px;font-weight:700;}
.nav-right{display:flex;gap:8px;}
.round-btn{width:40px;height:40px;border-radius:50%;border:none;background:#f3f4f6;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:18px;}
.round-btn:hover{background:#e5e7eb;}

/* ========== Tab ========== */
.tab-bar{display:flex;gap:6px;padding:0 12px 12px;overflow-x:auto;scrollbar-width:none;}
.tab-bar::-webkit-scrollbar{display:none;}
.tab{padding:9px 16px;border-radius:999px;background:#f3f4f6;border:none;font-size:14px;color:#374151;white-space:nowrap;cursor:pointer;}
.tab.active{background:#1677ff;color:#fff;}

/* ========== 搜索 ========== */
.search-area{margin:0 16px 16px;}
.search-input-wrap{position:relative;margin-bottom:12px;}
.search-icon{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#6b7280;}
.search-input{width:100%;background:#f3f4f6;border:1px solid transparent;border-radius:14px;padding:13px 14px 13px 42px;font-size:14px;outline:none;}
.search-input:focus{background:#fff;border-color:#1677ff;}
.filter-row{display:flex;gap:10px;margin-bottom:12px;}
.select{flex:1;padding:11px 12px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;font-size:14px;outline:none;}
.search-btn{width:100%;padding:14px;background:#1677ff;color:#fff;border:none;border-radius:14px;font-size:15px;font-weight:700;cursor:pointer;}
.search-btn:hover{background:#0958d9;}
.btn-primary{width:100%;padding:14px;background:#1677ff;color:#fff;border:none;border-radius:14px;font-size:15px;font-weight:700;cursor:pointer;}
.btn-primary:hover{background:#0958d9;}
.input{width:100%;padding:12px;border:1px solid #ddd;border-radius:8px;font-size:15px;margin-bottom:12px;}

/* ========== 登录页 ========== */
.login-page{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:15px;}
.login-box{background:#fff;padding:32px 28px;border-radius:16px;width:100%;max-width:400px;box-shadow:0 10px 40px rgba(17,24,39,.12);}
.login-logo{font-size:22px;font-weight:700;text-align:center;margin-bottom:6px;}
.login-sub{font-size:14px;color:#888;text-align:center;margin-bottom:22px;}
.login-err{background:#fef2f2;color:#dc2626;border-radius:8px;padding:10px;font-size:14px;text-align:center;margin-bottom:14px;}

/* ========== 折叠块 ========== */
.stat-collapse-wrap{background:#fff;border-radius:12px;margin:12px 0;border:1px solid #e8e8e8;overflow:hidden;}
.stat-collapse-header{padding:14px 16px;display:flex;justify-content:space-between;align-items:center;cursor:pointer;background:#f9fafb;user-select:none;}
.stat-collapse-header h3{font-size:15px;font-weight:600;}
.stat-icon{font-size:14px;transition:transform .25s;}
.stat-collapse-body{max-height:0;overflow:hidden;transition:max-height .35s ease;}
.stat-collapse-body.open{max-height:2400px;}
.stat-inner{padding:14px 16px;}
.stat-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.stat-form select{padding:8px 10px;border:1px solid #ddd;border-radius:8px;font-size:14px;}
.stat-form button{padding:8px 14px;background:#1677ff;color:#fff;border:none;border-radius:8px;font-size:14px;cursor:pointer;}
.stat-table-wrap{overflow-x:auto;}
.stat-table{width:100%;border-collapse:collapse;min-width:540px;}
.stat-table th,.stat-table td{padding:12px 8px;text-align:center;border:1px solid #e8e8e8;font-size:14px;}
.stat-table th{background:#eef4ff;font-weight:600;color:#1677ff;}
.stat-total{font-weight:bold;color:#28a745;}
.stat-mobile-cards{display:none;gap:12px;flex-direction:column;}
.stat-card-item{background:#fff;padding:14px;border-radius:10px;border:1px solid #e8e8e8;}
.stat-card-month{font-size:16px;font-weight:bold;margin-bottom:10px;}
.stat-card-row{display:flex;justify-content:space-between;padding:6px 0;font-size:14px;border-bottom:1px dashed #f0f0f0;}
.stat-card-row:last-child{border-bottom:none;}

/* ========== 表格 ========== */
.table-box{overflow-x:auto;border-radius:8px;margin:12px 0;border:1px solid #eee;background:#fff;}
table{width:100%;border-collapse:collapse;min-width:700px;}
th,td{padding:12px 10px;text-align:left;border:1px solid #eee;font-size:14px;}
th{background:#f3f4f6;white-space:nowrap;}
tr:hover{background:#f9fafb;}
.btn-group{display:flex;gap:6px;flex-wrap:wrap;align-items:center;}
.edit{background:#1677ff;color:#fff;padding:6px 10px;border-radius:4px;font-size:13px;border:none;cursor:pointer;display:inline-block;}
.edit:hover{background:#0958d9;}
.del-btn{background:#dc2626;color:#fff;padding:6px 10px;border:none;border-radius:4px;font-size:13px;cursor:pointer;}

/* ========== 分页 ========== */
.page-box{text-align:center;margin:10px 0;}
.page-box a, .page-box .page-dot{display:inline-block;padding:6px 12px;margin:0 3px;border:1px solid #ddd;border-radius:4px;font-size:14px;}
.page-box a.active{background:#1677ff;color:#fff;border-color:#1677ff;}
.page-total{text-align:center;font-size:14px;color:#666;margin-bottom:12px;}

/* ========== 弹窗 ========== */
.modal{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;padding:15px;z-index:999;}
.modal .box{background:#fff;width:100%;max-width:480px;max-height:90vh;border-radius:12px;position:relative;display:flex;flex-direction:column;}
.modal .box-content{padding:22px;overflow-y:auto;flex:1;}
.modal h3{margin-bottom:14px;font-size:18px;}
.modal input,.modal textarea,.modal select{width:100%;padding:12px;margin-bottom:12px;border:1px solid #ddd;border-radius:8px;font-size:15px;}
.modal button{padding:10px 14px;border:none;border-radius:8px;cursor:pointer;font-size:14px;margin:4px 2px;}
.modal .submit-black{background:#1677ff;color:#fff;}
.modal .submit-black:hover{background:#0958d9;}
.modal .cancel-gray{background:#e5e7eb;color:#333;}
.close{position:absolute;right:14px;top:14px;background:none;border:none;font-size:20px;cursor:pointer;color:#666;z-index:2;}

/* ========== 计算器 ========== */
.calc-row{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-bottom:10px;}
.calc-row input{flex:1 1 100%;margin:0;}
.btn-group-calc{display:flex;gap:6px;width:100%;}
.btn-group-calc button{flex:1;background:#f3f4f6;border:1px solid #ddd;}
.total-text{display:block;width:100%;color:#dc2626;font-weight:bold;padding:6px 0;font-size:16px;}

/* ========== 手机端卡片 ========== */
.mobile-order-list{display:none;padding:0 4px;}
.mobile-order-item{background:#fff;border-radius:12px;padding:16px;margin-bottom:10px;border:1px solid #e8e8e8;cursor:pointer;position:relative;}
.mobile-order-item:active{background:#f1f3f5;}
.item-name{font-size:18px;font-weight:bold;padding-right:70px;}
.item-area{font-size:16px;color:#1677ff;margin-top:6px;}
.item-tag{position:absolute;top:14px;right:14px;font-size:12px;background:#e8f3ff;color:#1677ff;padding:3px 10px;border-radius:14px;}

/* ========== 抽屉 ========== */
.detail-mask{position:fixed;inset:0;background:rgba(0,0,0,0.45);display:none;z-index:1050;}
.detail-drawer{position:fixed;bottom:0;left:0;width:100%;background:#fff;border-radius:18px 18px 0 0;transform:translateY(100%);transition:transform .3s ease;max-height:85vh;display:flex;flex-direction:column;z-index:1060;}
.detail-drawer.show{transform:translateY(0);}
.drawer-header{padding:18px 20px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #eee;}
.drawer-header h4{font-size:18px;}
.drawer-close{border:none;background:none;font-size:22px;color:#888;cursor:pointer;}
.drawer-body{padding:18px 20px;overflow-y:auto;flex:1;}
.drawer-row{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px dashed #eee;}
.drawer-row:last-child{border-bottom:none;}
.drawer-label{color:#888;font-size:15px;}
.drawer-val{color:#111;font-size:15px;word-break:break-all;text-align:right;max-width:60%;}
.drawer-footer{padding:16px 20px;border-top:1px solid #eee;display:flex;gap:12px;}
.drawer-btn-edit{flex:1;text-align:center;padding:12px 0;background:#1677ff;color:#fff;border-radius:10px;font-size:16px;}
.drawer-btn-del-wrap{flex:1;}
.drawer-btn-del{width:100%;padding:12px 0;border:1px solid #dc2626;background:#fff;color:#dc2626;border-radius:10px;font-size:16px;cursor:pointer;}

/* ========== 导出 ========== */
.export-row{margin-bottom:12px;}
.export-row label{display:block;margin-bottom:6px;font-size:14px;color:#555;}
.export-row select{width:100%;padding:9px;border:1px solid #ddd;border-radius:6px;font-size:14px;}
.type-checkboxes{display:flex;flex-wrap:wrap;gap:10px;padding:4px 0;}
.type-checkboxes label{display:flex;align-items:center;gap:4px;font-size:14px;cursor:pointer;}
.export-form-btn{width:100%;padding:12px;background:#1677ff;color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:15px;}
.export-form-btn:hover{background:#0958d9;}

/* ========== 提示 ========== */
.tip-ok{background:#ecfdf5;color:#059669;border-radius:8px;padding:10px;font-size:14px;margin-bottom:12px;}

/* ========== 响应式 ========== */
@media (max-width:768px){
    .filter-row{flex-direction:column;}
    .table-box table{display:none !important;}
    .mobile-order-list{display:block;}
    .stat-table-wrap{display:none;}
    .stat-mobile-cards{display:flex;}
}
/* ========== 退出按钮：红底白箭头，与新增按钮同尺寸 ========== */
.round-btn-logout {
    background: transparent !important;
    padding: 0 !important;
    width: 40px !important;
    height: 40px !important;
    overflow: visible;
}
.round-btn-logout:hover {
    background: transparent !important;
    opacity: 0.85;
}
.round-btn-logout svg {
    width: 40px !important;
    height: 40px !important;
    display: block;
    border-radius: 50%;
}
.nav-right .round-btn,
.nav-right .round-btn-logout,
.nav-right .round-btn-logout svg {
    width: 40px !important;
    height: 40px !important;
}
/* ========== 圆形按钮统一：图标铺满 ========== */
.round-btn {
    padding: 0 !important;
    box-sizing: border-box;
    overflow: hidden;
}
.round-btn svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
/* ============================================================
   抽屉样式（新增订单 / 修改订单）
   ============================================================ */

/* 遮罩 */
.drawer-mask{
    position:fixed;inset:0;
    background:rgba(17,24,39,.5);
    z-index:1000;
    opacity:0;pointer-events:none;
    transition:opacity .25s;
}
.drawer-mask.show{opacity:1;pointer-events:auto;}

/* 抽屉主体 */
.drawer{
    position:fixed;
    left:0;bottom:0;
    width:100%;
    height:70vh;
    max-height:70vh;
    background:#fff;
    border-radius:20px 20px 0 0;
    z-index:1001;
    transform:translateY(100%);
    transition:transform .3s cubic-bezier(0.32, 0.72, 0, 1);
    display:flex;
    flex-direction:column;
    box-shadow:0 -10px 40px rgba(17,24,39,.15);
    overflow:hidden;
    touch-action:auto;
}
.drawer.show{transform:translateY(0);}
.drawer.dragging{transition:none;}

/* 顶部拖拽条 */
.drawer-handle{
    padding:10px 0 6px;
    display:flex;justify-content:center;
    cursor:grab;
    flex-shrink:0;
    touch-action:none;
}
.drawer-handle:active{cursor:grabbing;}
.drawer-handle::before{
    content:'';
    width:40px;height:4px;
    background:#d1d5db;
    border-radius:2px;
}

/* 抽屉头部（固定） */
.drawer-header{
    padding:8px 20px 14px;
    display:flex;justify-content:space-between;align-items:center;
    border-bottom:1px solid #f0f0f0;
    flex-shrink:0;
}
.drawer-title{
    display:flex;align-items:center;gap:10px;
    font-size:17px;font-weight:700;
}
.drawer-title-icon{
    width:32px;height:32px;border-radius:9px;
    background:linear-gradient(135deg,#1677ff,#0958d9);
    display:flex;align-items:center;justify-content:center;
    color:#fff;font-size:18px;font-weight:600;
    box-shadow:0 4px 10px rgba(22,119,255,.25);
}
.drawer-close{
    width:32px;height:32px;border-radius:50%;
    background:#f3f4f6;border:none;cursor:pointer;
    color:#6b7280;font-size:16px;
    display:flex;align-items:center;justify-content:center;
    transition:all .15s;
}
.drawer-close:hover{background:#fee2e2;color:#dc2626;}

/* 抽屉表单容器（撑满） */
.drawer-form{
    display:flex;
    flex-direction:column;
    flex:1 1 auto;
    min-height:0;
    overflow:hidden;
}

/* 抽屉主体（滚动） */
.drawer-body{
    padding:18px 20px;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    flex:1 1 auto;
    min-height:0;
}
.drawer-body::-webkit-scrollbar{width:6px;}
.drawer-body::-webkit-scrollbar-thumb{background:#e5e7eb;border-radius:3px;}

/* 抽屉底部（固定） */
.drawer-foot{
    padding:14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    display:flex;gap:10px;
    border-top:1px solid #f0f0f0;
    background:#fff;
    flex-shrink:0;
}

/* ============ 抽屉内的表单 ============ */
.drawer .field{margin-bottom:14px;}
.drawer .field:last-child{margin-bottom:0;}
.drawer .field-label{
    display:block;font-size:13px;color:#6b7280;
    margin-bottom:6px;font-weight:500;
}
.drawer .field-label .required{color:#dc2626;margin-left:2px;}

.drawer .input-wrap{position:relative;}
.drawer .input-icon{
    position:absolute;left:12px;top:50%;
    transform:translateY(-50%);
    font-size:15px;color:#9ca3af;
    pointer-events:none;
}
.drawer .input, .drawer .textarea{
    width:100%;
    padding:12px 14px 12px 38px;
    border:1.5px solid #e5e7eb;
    border-radius:10px;
    font-size:15px;
    outline:none;
    transition:all .15s;
    background:#fff;
    font-family:inherit;color:#111827;
}
.drawer .input:focus, .drawer .textarea:focus{
    border-color:#1677ff;
    box-shadow:0 0 0 3px rgba(22,119,255,.1);
}
.drawer .textarea{
    min-height:60px;resize:vertical;
    line-height:1.5;
}

/* 类型按钮组 */
.drawer .type-group{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:8px;
}
.drawer .type-btn{
    padding:11px 6px;
    border:1.5px solid #e5e7eb;
    background:#fff;
    border-radius:10px;
    font-size:13px;
    color:#6b7280;
    cursor:pointer;
    transition:all .15s;
    text-align:center;
    font-family:inherit;
}
.drawer .type-btn:hover{border-color:#c7d9ff;background:#f8fbff;}
.drawer .type-btn.active{
    background:#1677ff;color:#fff;
    border-color:#1677ff;
    font-weight:600;
    box-shadow:0 2px 8px rgba(22,119,255,.25);
}

/* 抽屉底部按钮 */
.drawer .btn{
    flex:1;
    padding:13px 16px;
    border-radius:10px;
    font-size:15px;font-weight:600;
    cursor:pointer;transition:all .15s;
    border:none;font-family:inherit;
}
.drawer .btn-cancel{
    background:#f3f4f6;color:#6b7280;
    flex:0 0 100px;
}
.drawer .btn-cancel:hover{background:#e5e7eb;color:#111827;}
.drawer .btn-submit{
    background:#1677ff;color:#fff;
    box-shadow:0 4px 12px rgba(22,119,255,.25);
}
.drawer .btn-submit:hover{background:#0958d9;}
.drawer .btn-submit:disabled{background:#94a3b8;cursor:not-allowed;box-shadow:none;}

/* ============ 彩色类型标签 ============ */
.tag{
    display:inline-flex;align-items:center;
    padding:2px 8px;border-radius:6px;
    font-size:11px;font-weight:500;line-height:1.6;
}
.tag-门板{background:#e8f3ff;color:#1677ff;}
.tag-柜体{background:#e8fce8;color:#22AC38;}
.tag-门板补件{background:#fff4e6;color:#fa8c16;}
.tag-柜体补件{background:#fef0f0;color:#F15454;}

/* ============ 手机端订单卡片 ============ */
.mobile-order-list{display:none;padding:0 4px;}
.order-card{
    background:#fff;border-radius:14px;
    padding:14px 16px;margin-bottom:8px;
    border:1px solid #f0f0f0;
    display:flex;justify-content:space-between;align-items:center;gap:12px;
    transition:all .15s;cursor:pointer;
}
.order-card:active{background:#f1f3f5;}
.order-card .left{flex:1;min-width:0;}
.order-card .name{font-size:15px;font-weight:600;margin-bottom:5px;display:flex;align-items:center;gap:6px;}
.order-card .meta{font-size:12px;color:#9ca3af;display:flex;align-items:center;gap:8px;}
.order-card .meta .dot{width:3px;height:3px;border-radius:50%;background:#d1d5db;}
.order-card .right{text-align:right;white-space:nowrap;}
.order-card .area{font-size:16px;font-weight:700;color:#1677ff;font-variant-numeric:tabular-nums;}
.order-card .area.large{color:#fa8c16;}
.order-card .time{font-size:11px;color:#9ca3af;margin-top:4px;}

/* 手机端隐藏表格，显示卡片 */
@media (max-width:768px){
    .table-box table{display:none !important;}
    .mobile-order-list{display:block;}
    .drawer .type-group{grid-template-columns:repeat(2,1fr);}
}

/* ============ 电脑端：抽屉变居中弹窗 ============ */
@media (min-width:769px){
    .drawer{
        left:50%;
        bottom:auto;
        top:50%;
        width:100%;
        max-width:520px;
        height:auto;
        max-height:85vh;
        border-radius:20px;
        transform:translate(-50%, -50%) scale(.95);
        opacity:0;
        transition:all .25s;
    }
    .drawer.show{
        transform:translate(-50%, -50%) scale(1);
        opacity:1;
    }
    .drawer-handle{display:none;}
    .drawer-header{padding:18px 22px 14px;}
    .drawer-foot{border-radius:0 0 20px 20px;}
}
/* ========== 修复抽屉里的下拉框样式 ========== */
.drawer .input-wrap select{
    width:100%;
    padding:12px 14px 12px 38px;
    border:1.5px solid #e5e7eb;
    border-radius:10px;
    font-size:15px;
    outline:none;
    transition:all .15s;
    background:#fff;
    font-family:inherit;
    color:#111827;
    appearance:none;
    -webkit-appearance:none;
    background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 12px center;
    background-size:16px;
    cursor:pointer;
}
.drawer .input-wrap select:focus{
    border-color:#1677ff;
    box-shadow:0 0 0 3px rgba(22,119,255,.1);
}
/* ========== 卡片面积单位 ========== */
.order-card .area .unit{
    font-size:11px;
    font-weight:500;
    color:#9ca3af;
    margin-left:2px;
}