/* =============================================================================
 * 求购需求大厅 /wantBuyData
 * 参考：market_demand_dashboard.html（材料求购筛选大厅）
 *
 * 全部使用 wbd- 前缀，且只在本页 <link> 引入：
 * 站内 .container / .day-item / .process-ranking-* 等类被多页共用，不能改它们的公共定义
 * ========================================================================== */

/* ---- 外层卡片 ---- */
.wbd-row {
    padding-bottom: 50px;
}

.wbd-page {
    box-sizing: border-box;
    margin-top: 20px;
    padding: 24px 28px 18px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 4px 16px rgba(15, 23, 42, 0.02);
}

/* ---- 筛选区 ---- */
.wbd-filter {
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.wbd-filter-row {
    display: flex;
    align-items: center;
}

.wbd-period-row {
    gap: 12px;
    margin-bottom: 16px;
}

.wbd-period-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

.wbd-period-ico {
    width: 16px;
    height: 16px;
    color: var(--color-primary-strong);
}

/* 周期选择：整组分段控件 */
.wbd-seg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(241, 245, 249, 0.9);
    border-radius: 12px;
}

.wbd-seg-item {
    height: 30px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    line-height: 30px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.wbd-seg-item:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #0f172a;
}

.wbd-seg-item.is-active {
    background: var(--color-primary-strong);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(37, 119, 227, 0.25);
}

/* 下拉 + 操作按钮：四等分栅格 */
.wbd-form-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: center;
}

.wbd-field {
    min-width: 0;
}

.wbd-field .el-input,
.wbd-field .el-select,
.wbd-field .el-cascader {
    width: 100%;
}

.wbd-field .el-input__inner {
    height: 40px;
    line-height: 40px;
    padding: 0 30px 0 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #334155;
    font-size: 14px;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.wbd-field .el-input__inner::placeholder {
    color: var(--color-text-label);
}

.wbd-field .el-input__inner:hover {
    border-color: #cbd5e1;
}

.wbd-field .el-input__inner:focus {
    background: #ffffff;
    border-color: #2577e3;
    box-shadow: 0 0 0 3px rgba(37, 119, 227, 0.1);
}

.wbd-field .el-input__icon {
    line-height: 40px;
    color: var(--color-text-label);
}

.wbd-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.wbd-btn {
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 38px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.wbd-btn-primary {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 8px;
    background: var(--color-primary-strong);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(37, 119, 227, 0.25);
}

.wbd-btn-primary:hover {
    background: #1d5fbf;
}

.wbd-btn-ghost {
    flex: 0 0 auto;
    background: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
}

.wbd-btn-ghost:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

/* ---- 表格 ---- */
.wbd-page .el-table {
    font-size: 14px;
    color: #334155;
}

/* Element 默认在表格底部画一条绝对定位的横线，与设计稿的「圆角表头 + 无外框」冲突 */
.wbd-page .el-table::before {
    display: none;
}

.wbd-page .el-table th {
    padding: 12px 16px;
    background: #f8fafc !important;
    border-bottom: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.wbd-page .el-table th:first-child {
    border-radius: 12px 0 0 12px;
}

.wbd-page .el-table th:last-child {
    border-radius: 0 12px 12px 0;
}

.wbd-page .el-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.wbd-page .el-table .cell {
    padding: 0;
    line-height: 20px;
    color: #334155;
    font-size: 14px;
}

.wbd-page .el-table__body tr:last-child td {
    border-bottom: 0;
}

.wbd-page .el-table__body tr:hover > td {
    background: #f6faff !important;
}

.wbd-page .el-table__empty-block {
    min-height: 200px;
}

.wbd-page .el-table__empty-text {
    color: var(--color-text-label);
    font-size: 14px;
}

/* 单元格内容 */
.wbd-name {
    overflow: hidden;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
}

.wbd-spec {
    margin-top: 2px;
    overflow: hidden;
    color: var(--color-text-label);
    font-size: 14px;
    line-height: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
}

.wbd-num {
    color: #0f172a;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.wbd-area {
    overflow: hidden;
    color: #64748b;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wbd-day {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.wbd-day.is-urgent {
    background: #fff1f2;
    color: var(--color-danger);
}

.wbd-day.is-soon {
    background: #fff7ed;
    color: #ea580c;
}

.wbd-day.is-normal {
    background: #f1f5f9;
    color: #64748b;
}

.wbd-op-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 16px;
    border: 1px solid #2577e3;
    border-radius: 8px;
    background: #ffffff;
    color: var(--color-primary-strong);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.wbd-op-btn:hover {
    background: #eff6ff;
    color: #1d5fbf;
}

/* ---- 下拉面板（popper 挂在 body 上，靠本页独有的 css 文件限定作用范围）
   Element 的样式是运行时注入到 <head> 末尾的，同特异性下会盖掉本文件，
   所以这里统一加 .el-popper 前缀提高一级特异性 ---- */
.el-popper.el-cascader__dropdown,
.el-popper.el-select-dropdown {
    min-width: 256px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.el-popper .el-cascader-menu__item.is-active {
    color: var(--color-primary-strong);
}

.el-popper .el-select-dropdown__item.selected {
    color: var(--color-primary-strong);
    font-weight: 600;
}

/* ---- 底部：条数 + 分页 ---- */
.wbd-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.wbd-total {
    color: #64748b;
    font-size: 14px;
    line-height: 20px;
}

.wbd-total strong {
    color: #0f172a;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.wbd-page .el-pagination {
    padding: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}

.wbd-page .el-pagination .btn-prev,
.wbd-page .el-pagination .btn-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--color-text-label);
}

.wbd-page .el-pagination .btn-prev:not(:disabled):hover,
.wbd-page .el-pagination .btn-next:not(:disabled):hover {
    border-color: #2577e3;
    color: var(--color-primary-strong);
}

.wbd-page .el-pagination .btn-prev:disabled,
.wbd-page .el-pagination .btn-next:disabled {
    background: #ffffff;
    color: #cbd5e1;
}

.wbd-page .el-pager li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    margin: 0 4px;
    padding: 0 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
}

.wbd-page .el-pager li:hover {
    border-color: #2577e3;
    color: var(--color-primary-strong);
}

.wbd-page .el-pager li.active {
    background: var(--color-primary-strong);
    border-color: #2577e3;
    color: #ffffff;
    font-weight: 600;
}

.wbd-page .el-pagination__jump {
    margin-left: 8px;
    color: #64748b;
    font-size: 14px;
}

.wbd-page .el-pagination__editor.el-input {
    width: 48px;
    margin: 0 6px;
}

.wbd-page .el-pagination__editor .el-input__inner {
    height: 32px;
    padding: 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    line-height: 32px;
    text-align: center;
}

/* 站内 .container 固定 1118px，视口低于这个宽度才需要收缩；
   断点跟着容器走，不要用 1200（1280 笔记本会误触发成两列） */
@media (max-width: 1140px) {
    .wbd-page {
        padding: 18px 16px;
        border-radius: 12px;
    }

    .el-popper.el-cascader__dropdown,
    .el-popper.el-select-dropdown {
        min-width: 220px;
    }
}

@media (max-width: 900px) {
    .wbd-form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .wbd-form-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .wbd-period-row {
        flex-wrap: wrap;
    }

    .wbd-foot {
        flex-direction: column;
        align-items: flex-start;
    }
}
