*{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", system-ui, sans-serif;
}
body{
    padding: 16px;
    padding-top: 64px;
    background-color: #f2f4f7;
    color:#222;
}
.wrap-container{
    max-width:1200px;
    margin:0 auto;
}
/* 标题白色背景块 */
.title-block{
    background:#fff;
    border-radius:8px;
    margin:20px 0 10px;
    box-shadow:0 1px 4px rgba(0,0,0,0.06);
    position:relative;
}
.block-title{
    padding:12px 0;
    color:#1f2937;
    font-size:18px;
    text-align:center;
}
/* 网格容器 */
.grid-wrap{
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
    gap:12px;
}
/* 卡片磁贴 */
.card-item{
    background:#ffffff;
    border-radius:10px;
    box-shadow:0 2px 6px rgba(0,0,0,0.08);
    padding:16px 10px;
    text-align:center;
    cursor:pointer;
    transition: transform 0.15s ease, box-shadow 0.15s;
    border:1px solid #e5e7eb;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.card-item:active{
    transform:scale(0.97);
    box-shadow:0 1px 3px rgba(0,0,0,0.12);
}
.card-no{
    font-size:32px;
    font-weight:bold;
    color:#111827;
    margin-bottom:6px;
}
.card-part{
    font-size:15px;
    color:#374151;
    margin-bottom:8px;
}
.card-step{
    font-size:13px;
    color:#2563eb;
    margin-bottom:6px;
    line-height:1.4;
}
.card-status{
    font-size:14px;
    color:#16a34a;
    margin-bottom:4px;
}
.card-remark{
    font-size:12px;
    color:#6b7280;
}

/* 手机端强制一行2个 */
@media (max-width:640px){
    .grid-wrap{
        grid-template-columns: repeat(2, 1fr);
    }
    .card-no{
        font-size:28px;
    }
}

/* ================== 弹窗原有样式保留 ================== */
.mask{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.45);
    z-index:999;
    display:none;
    align-items:center;
    justify-content:center;
    padding:16px;
    overscroll-behavior: contain;
}
.pop{
    position:relative;
    background:#fff;
    border-radius:12px;
    width:100%;
    max-width:520px;
    max-height:82vh;
    overflow-y:auto;
    padding:24px;
    box-shadow:0 8px 24px #00000025;
}
.pop-close{
    position:absolute;
    right:16px;
    top:16px;
    font-size:22px;
    cursor:pointer;
    color:#666;
    width:32px;
    height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    border:1px solid #ddd;
}
.pop-close:hover{
    background:#f3f4f6;
}
.pop h4{
    margin-bottom:20px;
    font-size:16px;
    color:#111;
}
.form-item{
    margin-bottom:14px;
}
.form-item label{
    display:block;
    margin-bottom:6px;
    font-size:14px;
    color:#374151;
}
.form-item input[type="text"], .form-item textarea{
    width:100%;
    padding:10px 12px;
    border:1px solid #d1d5db;
    border-radius:8px;
    font-size:14px;
}
.form-item input:focus, .form-item textarea:focus{
    outline:none;
    border-color:#2563eb;
}
.radio-group{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    padding:6px 0;
}
.radio-item{
    display:flex;
    align-items:center;
    gap:4px;
}
.pop-footer{
    display:flex;
    justify-content:stretch;
    gap:16px;
    margin-top:22px;
}
.pop-footer button{
    flex:1;
}
.pop-footer button{
    padding:11px 24px;
    border-radius:8px;
    border:none;
    cursor:pointer;
    font-size:15px;
}
.btn-cancel{
    background:#e5e7eb;
    color:#333;
}
.btn-save{
    background:#2563eb;
    color:#fff;
}
.ck{
    color:#16a34a;
    font-weight:bold;
}
.cross{
    color:#dc2626;
    font-weight:bold;
}
.input-wrap{
    position:relative;
}
.input-wrap input{
    padding-right:36px !important;
}
.icon-today{
    position:absolute;
    right:10px;
    top:50%;
    transform:translateY(-50%);
    cursor:pointer;
    font-size:16px;
    color:#2563eb;
    width:24px;
    height:24px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:4px;
}
.icon-today:hover{
    background:#eff6ff;
}
.text-mod{
    color:#dc4444;
}

/* ========== 新增分区样式 ========== */
.section-block{
    background:#ffffff;
    border-radius:12px;
    padding:16px;
    margin-bottom:18px;
    box-shadow:0 2px 8px rgba(0,0,0,0.07);
    margin-top: 16px;
}
.section-block .title-block{
    margin:0 0 12px 0;
    box-shadow:none;
    padding-bottom:8px;
    position: relative;
}
.section-block .title-block::after{
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background-color: #eee;
}
.section-block .block-title{
    padding:0;
}
.section-block .grid-wrap{
    margin:0;
}

/* 圆形加号按钮 */
.add-btn-round{
    width:34px;
    height:34px;
    border-radius:50%;
    background:#2563eb;
    color:#fff;
    font-size:22px;
    line-height:34px;
    text-align:center;
    position:absolute;
    right:16px;
    top:50%;
    transform:translateY(-50%);
    cursor:pointer;
}

/* ========== 底部ActionSheet ========== */
.sheet-mask{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.4);
    z-index:1001;
    display:none;
}
.sheet-mask.show{
    display:block;
}
.action-sheet{
    position:fixed;
    left:12px;
    right:12px;
    bottom:-500px;
    z-index:1002;
    background:#fff;
    border-radius:14px;
    overflow:hidden;
    transition: bottom 0.25s ease;
}
.action-sheet.show{
    bottom:12px;
}
.sheet-item{
    text-align:center;
    padding:16px;
    font-size:16px;
    border-bottom:1px solid #f1f1f1;
    cursor:pointer;
}
.sheet-item:active{
    background:#f3f4f6;
}
.sheet-del{
    color:#dc2626;
}
.sheet-cancel{
    margin-top:8px;
    text-align:center;
    padding:16px;
    font-size:16px;
    background:#fff;
    border-radius:14px;
    cursor:pointer;
}
.sheet-cancel:active{
    background:#f3f4f6;
}
.add-btn-round{
    width:34px;
    height:34px;
    border-radius:50%;
    background:#2563eb;
    color:#fff;
    font-size:22px;
    line-height:34px;
    text-align:center;
    position:absolute;
    right:0px;
    top:30%;
    transform:translateY(-50%);
    cursor:pointer;
}
.pop{
    overflow:auto;
    scrollbar-width: none;
}
.pop::-webkit-scrollbar{
    display:none;
}

/* ========== 新增顶部标题栏 + 配件分组面板样式 ========== */
.top-header{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    background:#2563eb;
    color:#fff;
    padding:14px 16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-radius:0;
    margin:0;
    z-index:9999;
}
.top-header h1{
    font-size:22px;
    font-weight:bold;
}
.top-expand-btn{
    width:36px;
    height:36px;
    background:rgba(255,255,255,0.25);
    border-radius:8px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
    cursor:pointer;
}
.top-expand-btn:active{
    background:rgba(255,255,255,0.4);
}
/* 配件统计面板，从顶部向下展开 */
.part-group-panel{
    width:100%;
    background:#fff;
    border-radius:12px;
    padding:0;  /* 收起状态内边距改为0 */
    margin-bottom:0;
    box-shadow:0 2px 8px rgba(0,0,0,0.07);
    max-height:0;
    overflow:hidden;
    /* 增加padding过渡 */
    transition: max-height 0.35s ease, margin-bottom 0.35s ease, padding 0.35s ease;
}
.part-group-panel.open{
    max-height:2000px;
    padding:16px; /* 展开的时候才恢复内边距 */
    margin-bottom:16px;
}

.part-grid{
    display:grid;
    grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
    gap:10px;
}
.part-card{
    background:#eff6ff;
    border:1px solid #bfdbfe;
    border-radius:10px;
    padding:14px 8px;
    text-align:center;
    cursor:pointer;
    transition:0.2s;
}
.part-card:active{
    transform:scale(0.97);
}
.part-name{
    font-size:14px;
    color:#1e40af;
    margin-bottom:4px;
    word-break:break-all;
}
.part-count{
    font-size:22px;
    font-weight:bold;
    color:#2563eb;
}
/* 机台号子面板（文件夹展开） */
.machine-sub-wrap{
    max-height:1200px;
    overflow:hidden;
    transition:max-height 0.3s ease;
    margin-top:10px;
    padding-top:10px;
    border-top:1px dashed #dbeafe;
}
/* .open类直接删掉或者保留也没关系，后面JS不再调用 */
.machine-sub-wrap.open{
}
.machine-grid{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}
.machine-small-card{
    background:#ffffff;
    border:1px solid #bfdbfe;
    border-radius:6px;
    padding:8px 4px;
    text-align:center;
    font-size:14px;
    color:#1e40af;
    flex:1 1 calc(50% - 4px);  /* 新增这一行！ */
}
body.no-scroll{
    overflow:hidden;
}
/* 卡片右上角斜菜单按钮 */
.card-item{
    position:relative; /* 给子按钮定位基准，重要！ */
}
.card-menu-btn{
    position:absolute;
    top:6px;
    right:6px;
    width:28px;
    height:28px;
    border-radius:50%;
    border:none;
    background:#f3f4f6;
    color:#444;
    font-size:18px;
    line-height:1;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
    pointer-events: auto;
    
}
.card-menu-btn::after{
    content:"";
    position:absolute;
    inset:-8px;
}
.card-menu-btn:active{
    background:#ddd;
    transform:scale(0.92);
}
html {
    touch-action: manipulation;
}
.remark-preset-btn{
    padding:6px 10px;
    border:1px solid #2563eb;
    background:#eff6ff;
    color:#2563eb;
    border-radius:6px;
    cursor:pointer;
}
.remark-preset-btn:active{
    background:#2563eb;
    color:#fff;
}