/* ========== 全局 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* ========== 顶栏 ========== */
.app-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    position: sticky;
    top: 0;
    z-index: 200;
}
.app-header h1 { font-size: 17px; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* 全选勾选 */
.select-all-wrap {
    display: flex; align-items: center; gap: 5px;
    color: #fff; font-size: 13px; cursor: pointer;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 5px;
}
.select-all-wrap input { width: 14px; height: 14px; cursor: pointer; }

/* ========== 按钮 ========== */
.btn {
    border: none; border-radius: 6px; cursor: pointer; font-size: 13px;
    padding: 7px 14px; transition: all .2s; font-weight: 500;
}
.btn-primary { background: #409eff; color: #fff; }
.btn-primary:hover { background: #66b1ff; }
.btn-success { background: #67c23a; color: #fff; }
.btn-success:hover { background: #85ce61; }
.btn-danger  { background: #f56c6c; color: #fff; }
.btn-danger:hover  { background: #f78989; }
.btn-sm { padding: 3px 10px; font-size: 12px; }

/* ========== 订单容器 ========== */
.orders-container {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.empty-state {
    text-align: center;
    padding: 60px 0;
    color: #909399;
    font-size: 15px;
    display: none;
}

/* ========== 订单块 ========== */
.order-block {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    overflow: hidden;
}

/* 深色表头行 */
.order-block-header {
    background: #2d3748;
    color: #fff;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.chk-wrap { display: flex; align-items: center; }
.chk-wrap input[type="checkbox"] {
    width: 15px; height: 15px; cursor: pointer; accent-color: #409eff;
}
.order-num {
    background: #4a5568;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 4px;
    letter-spacing: .5px;
    min-width: 36px;
    text-align: center;
}
.order-info {
    font-size: 12px;
    color: #a0aec0;
    flex: 1;
}
.order-block-actions { display: flex; gap: 6px; }

/* ========== 统一表格 ========== */
.table-scroll { overflow-x: auto; }

.unified-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

/* 区域标签行 */
.zone-label-row th {
    padding: 6px 8px;
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    color: #fff;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,.15);
}
.zone-a-th { background: linear-gradient(90deg, #409eff, #5aabff); }
.zone-b-th { background: linear-gradient(90deg, #e6a23c, #edbb6b); }
.zone-label-row .col-seq,
.zone-label-row .col-action { background: #4a5568; }

/* 列标签行 */
.col-label-row th {
    padding: 5px 5px;
    font-weight: 600;
    font-size: 11px;
    text-align: center;
    color: #606266;
    background: #f5f7fa;
    border-bottom: 2px solid #ebeef5;
    border-right: 1px solid #ebeef5;
    white-space: nowrap;
}

/* tbody */
.unified-table tbody td {
    padding: 6px 5px;
    vertical-align: middle;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f4f4f5;
}
.unified-table tbody tr:last-child td { border-bottom: none; }
.unified-table tbody tr:hover { background: #e8f5e9; }

/* A/B 分隔 */
.zone-b-col { border-left: 3px solid #f5deb3 !important; }

/* 序号 */
.td-seq { font-size: 12px; color: #909399; font-weight: 600; width: 30px; }

/* ========== 竖排输入组 ========== */
.td-stack { padding: 4px 3px !important; }
.stack-group { display: flex; flex-direction: column; gap: 4px; }
.stack-row { display: flex; align-items: center; gap: 4px; }
.sub-lbl {
    font-size: 10px; color: #909399; white-space: nowrap;
    min-width: 28px; text-align: right; flex-shrink: 0;
}
.total-row { padding-top: 2px; border-top: 1px dashed #ebeef5; }

/* ========== 输入框 ========== */
.unified-table input[type="text"],
.unified-table input[type="number"] {
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    padding: 4px 5px;
    font-size: 12px;
    width: 100%;
    text-align: center;
    transition: border-color .2s;
    background: #fff;
    color: #303133;
}
.unified-table input:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64,158,255,.15);
}
.input-product  { width: 100% !important; }
.input-num      { min-width: 50px !important; max-width: 65px; }

/* 货品名称单元格撑满高度 */
.td-product {
    padding: 4px 3px !important;
}
.td-product .input-product {
    height: 100%;
    min-height: 74px;
    vertical-align: top;
    text-align: left;
    padding: 6px 5px;
    resize: none;
}

/* 去除数字输入框上下箭头 */
.unified-table input[type="number"]::-webkit-outer-spin-button,
.unified-table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.unified-table input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
/* ¥ 前缀包装 */
.price-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 1;
}
.price-sym {
    position: absolute;
    left: 5px;
    font-size: 12px;
    color: #606266;
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}
.price-wrap .input-num {
    padding-left: 16px !important;
    width: 100%;
}

/* 件/对 单位选择 */
.unit-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 3px;
    flex-shrink: 0;
}
.unit-lbl {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: #606266;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}
.unit-lbl input[type="radio"] {
    width: 12px;
    height: 12px;
    cursor: pointer;
    accent-color: #409eff;
    flex-shrink: 0;
}

.input-supplier { flex: 1; min-width: 0 !important; }
.input-sqty     { width: 52px !important; flex-shrink: 0; text-align: center; }

/* ========== 列宽 ========== */
.col-seq      { width: 30px; }
.col-action   { width: 44px; }
.col-code     { width: calc((100% - 74px) * 0.50 * 0.32); }
.col-product  { width: calc((100% - 74px) * 0.50 * 0.35); }
.col-priceqty { width: calc((100% - 74px) * 0.50 * 0.33); }
.col-suppliers { width: calc((100% - 74px) * 0.50 * 0.60); }
.col-reserved  { width: calc((100% - 74px) * 0.50 * 0.20); }

/* 交货状态余量标签 */
.remain-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 28px;
    text-align: center;
}
.remain-none  { color: #c0c4cc; }
.remain-pending { background: #fdf6ec; color: #e6a23c; border: 1px solid #faecd8; }
.remain-done    { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; }
.remain-over    { background: #fef0f0; color: #f56c6c; border: 1px solid #fde2e2; }

/* 总价 */
.total-cell {
    font-weight: 700; color: #e6a23c; font-size: 13px;
    min-width: 50px; display: inline-block; text-align: center;
}

/* 预留列 */
.reserved-cell { color: #c0c4cc; font-style: italic; font-size: 13px; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* ========== 顶栏 ========== */
.app-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.app-header h1 { font-size: 17px; font-weight: 600; }

/* ========== 按钮 ========== */
.btn {
    border: none; border-radius: 6px; cursor: pointer; font-size: 13px;
    padding: 7px 14px; transition: all .2s; font-weight: 500;
}
.btn-primary { background: #409eff; color: #fff; }
.btn-primary:hover { background: #66b1ff; }
.btn-success { background: #67c23a; color: #fff; }
.btn-success:hover { background: #85ce61; }
.btn-danger  { background: #f56c6c; color: #fff; }
.btn-danger:hover  { background: #f78989; }
.btn-sm { padding: 3px 10px; font-size: 12px; }
