/* =========================================
   material.css - 材料价格查询页
   多列联动：所有列弹性分配宽度
   ========================================= */

/* ===== 全局 ===== */
:root {
    --m-fs: 6px;
}

/* ===== 多列容器 ===== */
.material-cols {
    width: 420px;
    min-width: 420px;
    max-width: 420px;
    flex-shrink: 0;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

/* ===== 每列通用 ===== */
.m-col {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    border-left: 1px solid #FFFFFF;
    box-sizing: border-box;
}

/* 第1列不要左侧线（最左边界） */
.m-col-1 {
    border-left: none;
    flex: 0 0 var(--col-w-1, 40px);
    max-width: var(--col-w-1, 40px);
    background: #FBFBFD;
}

.m-col-2 {
    flex: 0 0 var(--col-w-2, 40px);
    max-width: var(--col-w-2, 40px);
}

.m-col-3 {
    flex: 0 0 var(--col-w-3, 40px);
    max-width: var(--col-w-3, 40px);
}

.m-col-4 {
    flex: 0 0 var(--col-w-4, 40px);
    max-width: var(--col-w-4, 40px);
}

.m-col-5 {
    flex: 0 0 var(--col-w-5, 30px);
    max-width: var(--col-w-5, 30px);
}

.m-col-6 {
    flex: 0 0 var(--col-w-6, 60px);
    max-width: var(--col-w-6, 60px);
}

.m-col-7 {
    flex: 0 0 var(--col-w-7, 80px);
    max-width: var(--col-w-7, 80px);
}

.m-col-8 {
    flex: 0 0 var(--col-w-8, 45px);
    max-width: var(--col-w-8, 45px);
}

.m-col-9 {
    flex: 0 0 var(--col-w-9, 24px);
    max-width: var(--col-w-9, 24px);
}

.m-col-10 {
    flex: 0 0 var(--col-w-10, 24px);
    max-width: var(--col-w-10, 24px);
}

.m-col-11 {
    flex: 0 0 var(--col-w-11, 24px);
    max-width: var(--col-w-11, 24px);
}

/* ===== 列表 ===== */
.m-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* ===== 每行项 ===== */
.m-item {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2px;
    font-size: var(--m-fs);
    color: #1D1D1F;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: background 0.15s;
    box-sizing: border-box;
}

.m-item:first-child {
    border-left: none;
}

.m-item:active {
    background: #F5F5F7;
}

.m-item.active {
    background: #0071E3 !important;
    color: #FFFFFF !important;
    font-weight: 600;
}
.price-row {
    height: 28px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding: 0;
    cursor: pointer;
    transition: background 0.15s;
    box-sizing: border-box;
}

.price-row:active {
    background: #F5F5F7;
}

.price-row.active {
    background: #0071E3 !important;
    color: #FFFFFF !important;
}

.price-row .p-cell {
    flex: 1 1 0;
    min-width: 0;
    font-size: var(--m-fs);
    color: #1D1D1F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* 价格格（第一个）固定 35px */
.price-row .p-cell:nth-child(1) {
    flex: 0 0 35px;
    max-width: 35px;
}

/* 单位格（第二个）固定 25px */
.price-row .p-cell:nth-child(2) {
    flex: 0 0 25px;
    max-width: 25px;
}

/* 品牌格（第三个）弹性占满剩余 */
.price-row .p-cell:nth-child(3) {
    flex: 1 1 0;
    min-width: 0;
}

.price-row .p-cell:first-child {
    color: #0071E3;
    font-weight: 600;
}

.price-row.active .p-cell {
    color: #FFFFFF;
}

.price-row.active .p-cell:first-child {
    color: #FFFFFF;
}

/* ===== 规格列 ===== */
.spec-item {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2px;
    font-size: var(--m-fs);
    color: #1D1D1F;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.15s;
}

.spec-item:active {
    background: #F5F5F7;
}

.spec-item.active {
    background: #0071E3 !important;
    color: #FFFFFF !important;
    font-weight: 600;
}

/* ===== 空状态 ===== */
.m-empty {
    padding: 32px 12px;
    text-align: center;
    color: #86868B;
    font-size: 12px;
}

/* ===== 全局功能按钮（第8/9列） ===== */
.m-action-btn {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2px;
    font-size: var(--m-fs);
    color: #FFFFFF;
    background: #FF9500;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-sizing: border-box;
    transition: background 0.15s;
    text-decoration: none;
    font-family: inherit;
    border-radius: 0;
    border: none;
}

/* 第9列（询价）- 字号略小 */
.m-col-9 .m-action-btn {
    font-size: 5px;
    padding: 0 1px;
}

.m-action-btn:first-child {
    margin-top: 0;
}

.m-action-btn:active {
    background: #C77500;
}

.m-action-btn--inquiry {
    background: #34C759;
}

.m-action-btn--inquiry:active {
    background: #248A3D;
}

/* ===== 询价弹窗 ===== */
.inquiry-modal {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inquiry-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.inquiry-card {
    position: relative;
    width: 300px;
    max-width: 90%;
    background: #FFFFFF;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    z-index: 1;
}

.inquiry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.inquiry-title {
    font-size: 16px;
    font-weight: 600;
    color: #1D1D1F;
}

.inquiry-close {
    font-size: 24px;
    line-height: 1;
    color: #86868B;
    cursor: pointer;
    padding: 0 4px;
    user-select: none;
}

.inquiry-body {
    padding: 8px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inquiry-option {
    padding: 12px;
    background: #F5F5F7;
    border-radius: 10px;
    border: 1px solid transparent;
}

.inquiry-option-title {
    font-size: 14px;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 4px;
}

.inquiry-option-desc {
    font-size: 12px;
    color: #6E6E73;
    line-height: 1.5;
}

.inquiry-option-desc strong {
    color: #0071E3;
}

/* ===== 计算价格弹窗（复用 .inquiry-modal 样式） ===== */
.calc-modal {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.calc-card {
    position: relative;
    width: 300px;
    max-width: 90%;
    background: #FFFFFF;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    z-index: 1;
}

.calc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.calc-title {
    font-size: 16px;
    font-weight: 600;
    color: #1D1D1F;
}

.calc-close {
    font-size: 24px;
    line-height: 1;
    color: #86868B;
    cursor: pointer;
    padding: 0 4px;
    user-select: none;
}

.calc-body {
    padding: 8px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-option {
    padding: 12px;
    background: #F5F5F7;
    border-radius: 10px;
    border: 1px solid transparent;
}

.calc-option-title {
    font-size: 14px;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 4px;
}

.calc-option-desc {
    font-size: 12px;
    color: #6E6E73;
    line-height: 1.5;
}

/* ===== 已知铺贴面积 - 输入弹窗 ===== */
.area-modal {
    position: absolute;
    inset: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
}

.area-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.area-card {
    position: relative;
    width: 320px;
    max-width: 90%;
    background: #FFFFFF;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    z-index: 1;
}

.area-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.area-back {
    font-size: 24px;
    line-height: 1;
    color: #0071E3;
    cursor: pointer;
    padding: 0 4px;
    user-select: none;
    margin-left: -8px;
}

.area-title {
    font-size: 16px;
    font-weight: 600;
    color: #1D1D1F;
    flex: 1;
    text-align: center;
}

.area-close {
    font-size: 24px;
    line-height: 1;
    color: #86868B;
    cursor: pointer;
    padding: 0 4px;
    user-select: none;
}

.area-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.area-spec {
    font-size: 13px;
    color: #1D1D1F;
    font-weight: 600;
    text-align: center;
    background: #F5F5F7;
    padding: 8px 12px;
    border-radius: 8px;
}

.area-input-row {
    display: flex;
    align-items: center;
    background: #F5F5F7;
    border-radius: 10px;
    padding: 0 14px;
    height: 50px;
    position: relative;
}

.area-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #1D1D1F;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    text-align: left;
    padding-right: 36px;
    min-width: 0;
}

.area-input::placeholder {
    color: #86868B;
    font-weight: 400;
    font-size: 16px;
}

/* 去掉 input[type=number] 原生上下箭头 */
.area-input::-webkit-outer-spin-button,
.area-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.area-input[type=number] {
    -moz-appearance: textfield;
}

.area-unit {
    font-size: 14px;
    color: #6E6E73;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.area-result {
    text-align: center;
    font-size: 14px;
    color: #1D1D1F;
    min-height: 22px;
    line-height: 1.5;
}

.area-result strong {
    color: #FF9500;
    font-size: 16px;
    font-weight: 700;
    margin: 0 2px;
}

/* 纯主材价格（蓝色加粗） */
.area-result .main {
    color: #0071E3;
    font-size: 16px;
    font-weight: 700;
    margin: 0 2px;
}

/* 灰色小字提示（已知预算弹窗底部） */
.area-result .hint {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    color: #86868B;
    line-height: 1.5;
}

.area-formula {
    background: #F5F5F7;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 10px;
    color: #6E6E73;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
}

.area-formula strong {
    color: #1D1D1F;
    font-weight: 600;
}
