﻿/* ============================================================
   pricefilede.css — 文件详情页样式
   设计语言与 home.css 统一，继承 :root 变量体系
   ============================================================ */

/* ---------- Hero 区（复用 pricefile.css 的 .page-hero） ---------- */
/* .page-hero 已在 pricefile.css 定义，此处无需重复 */
/* 如 pricefile.css 未加载，则补充定义 */
.page-hero {
    background: linear-gradient(135deg, var(--brand) 0%, #2a56b5 100%);
    padding: 48px 0 44px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::after {
    content: '';
    position: absolute;
    right: -80px;
    top: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}
.page-hero::before {
    content: '';
    position: absolute;
    left: -60px;
    bottom: -70px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}
.page-hero .container {
    position: relative;
    z-index: 1;
}
.page-hero h1 {
    font-size: 32px;
    color: #fff;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 2px;
    line-height: 1.3;
}
.page-hero p {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 350;
}

/* ---------- 内容卡片 ---------- */
.detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 20px;
    font-weight: 650;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
    letter-spacing: 0.5px;
}
.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--brand);
    border-radius: 2px;
    flex-shrink: 0;
}

.card-body {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-2);
}

/* ---------- 本期说明文本 ---------- */
.infoContent {
    line-height: 1.9;
    color: var(--text-2);
    font-size: 15px;
}
.infoContent p {
    margin-bottom: 8px;
}

.infodate {
    line-height: 30px;
    height: 30px;
    color: var(--text-4);
    text-align: center;
}

/* ---------- 材料表格 ---------- */
.flexTable {
    margin: 0 auto;
    border-radius: 6px;
    background: var(--surface);
}

.flexTableCenter {
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.flexTableCenter_boder {
    border: solid 1px var(--border) !important;
    border-radius: 8px;
    overflow: hidden;
}

/* 表头 */
.flexgrdTableTitle {
    width: 100%;
    height: 44px;
    line-height: 44px;
    background: var(--brand-50);
    font-size: 14px;
    color: var(--text-3);
    display: flex;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* 表行 */
.flexgrdTableCont {
    width: 100%;
    padding: 4px 0;
    font-size: 14px;
    border-bottom: solid 1px var(--divider);
    display: flex;
    color: var(--text-2);
    line-height: 38px;
    transition: background 0.15s ease;
}
.flexgrdTableCont:nth-child(odd) {
    background: #fafbfd;
}
.flexgrdTableCont:hover {
    background: var(--brand-50);
    color: var(--brand) !important;
}
.flexgrdTableCont:last-child {
    border-bottom: none;
}

/* 居中对齐辅助 */
.flexRowCenter {
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
}

/* 列宽定义 */
.flexmc {
    width: 300px;
    display: flex;
    justify-content: left;
    align-items: center;
    padding-left: 16px;
}

.flexgg {
    width: 280px;
    display: flex;
    justify-content: left;
    align-items: center;
}

.flexdw {
    width: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flexrow2 {
    width: 180px;
    align-items: center;
    justify-content: left;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    padding-left: 8px;
}

/* ---------- 查询按钮区 ---------- */
.detail-action {
    text-align: center;
    margin-bottom: 32px;
}

.btn-detail-query {
    display: inline-block;
    padding: 12px 48px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    letter-spacing: 1px;
}
.btn-detail-query:hover {
    background: var(--brand-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-detail-query:active {
    transform: translateY(0);
}

/* ---------- 文件链接列表（仿首页 .update-table 风格） ---------- */
.file-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.file-link-list li {
    position: relative;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    float: none !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    cursor: default;
    color: var(--text-2);
    font-family: inherit;
    list-style-type: none !important;
    border-bottom: 1px solid var(--divider);
    border-right: 1px solid var(--divider);
    transition: background 0.15s ease;
}
/* 偶数列移除右边框 */
.file-link-list li:nth-child(even) {
    border-right: none;
}
/* 最后两行移除底边框 */
.file-link-list li:nth-last-child(-n+2) {
    border-bottom: none;
}
/* 交替行背景 */
.file-link-list li:nth-child(4n+1),
.file-link-list li:nth-child(4n+2) {
    background: var(--surface);
}
.file-link-list li:nth-child(4n+3),
.file-link-list li:nth-child(4n+4) {
    background: #fafbfd;
}
/* 整行 hover */
.file-link-list li:hover {
    background: var(--brand-50) !important;
}
.file-link-list li::before {
    display: none;
}
.file-link-list li a {
    color: var(--brand);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s ease;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 12px 18px !important;
    height: auto !important;
    line-height: 1.6 !important;
    border-bottom: none !important;
    text-align: left !important;
}
.file-link-list li a:hover {
    opacity: 0.7;
    color: var(--brand);
}

/* ---------- 兼容旧式列表 ---------- */
.rel-cells .list-hd {
    display: none;
}
.rel-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.rel-body li {
    font-size: 14px;
    line-height: 1.8;
    padding: 4px 0;
}
.rel-body li a {
    color: var(--text-2);
    text-decoration: none;
    transition: color 0.2s ease;
}
.rel-body li a:hover {
    color: var(--brand);
}

/* 文本居中 */
.txtcenter {
    text-align: center;
}

/* ============================================================
   响应式
   ============================================================ */

/* Tablet: <= 1024px */
@media (max-width: 1024px) {
    .page-hero {
        padding: 36px 0 32px;
    }
    .page-hero h1 {
        font-size: 26px;
        letter-spacing: 1px;
    }
    .page-hero p {
        font-size: 14px;
    }
    .detail-card {
        padding: 22px 20px;
        margin-bottom: 20px;
    }
    .card-title {
        font-size: 18px;
    }
    .file-link-list {
        grid-template-columns: 1fr 1fr;
    }
    .file-link-list li a {
        padding: 10px 14px !important;
        font-size: 13px;
    }
    .flexmc { width: 200px; }
    .flexgg { width: 200px; }
    .flexdw { width: 80px; }
    .flexrow2 { width: 140px; }
}

/* Mobile: <= 768px — 列表卡片化 */
@media (max-width: 768px) {
    .page-hero {
        padding: 28px 0 24px;
    }
    .page-hero h1 {
        font-size: 22px;
    }
    .page-hero p {
        font-size: 13px;
    }
    .detail-card {
        padding: 18px 16px;
        margin-bottom: 16px;
    }
    .card-title {
        font-size: 17px;
        margin-bottom: 14px;
        padding-bottom: 12px;
    }
    .card-body {
        font-size: 14px;
    }
    .btn-detail-query {
        width: 100%;
        padding: 12px 24px;
        font-size: 15px;
    }
    .file-link-list {
        grid-template-columns: 1fr;
    }
    .file-link-list li {
        border-right: none;
    }
    .file-link-list li:nth-last-child(1) {
        border-bottom: none;
    }
    .file-link-list li a {
        padding: 10px 14px !important;
        font-size: 13px;
    }

    /* ===== 材料明细：表格转卡片 ===== */
    /* 隐藏表头行 */
    .flexgrdTableTitle {
        display: none;
    }
    /* 外框改为纵向卡片堆叠，不再横向滑动 */
    .flexTable {
        overflow: visible;
    }
    .flexTableCenter {
        min-width: 0;
    }
    .flexTableCenter_boder {
        border: none;
        background: transparent;
        overflow: visible;
    }
    /* 每行作为一张卡片 */
    .flexgrdTableCont {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 16px;
        row-gap: 2px;
        width: 100%;
        padding: 12px 14px;
        margin-bottom: 10px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        line-height: 1.6;
        box-shadow: var(--shadow-sm);
    }
    .flexgrdTableCont:nth-child(odd),
    .flexgrdTableCont:nth-child(even) {
        background: var(--surface);
    }
    .flexgrdTableCont:hover {
        background: var(--brand-50);
    }
    /* 各字段：每行一组键值，标签来自 nth-child 位置（按表头顺序：名称/规格/单位/除税价/含税价/备注） */
    .flexgrdTableCont > span {
        display: flex;
        align-items: flex-start;
        width: 100%;
        padding: 4px 0;
        line-height: 1.6;
        min-height: 0;
        min-width: 0;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    /* grid 分组（2 列）：
       块1 材料名称 — 独占整行(span 2)
       块2 规格型号 — 独占整行(span 2，长规格可换行)
       块3 单位 — 独占整行(span 2，靠右)
       块4 除税价 | 块5 含税价
       块6 备注 — 独占整行(span 2) */
    .flexgrdTableCont > span:nth-child(1) { grid-column: 1 / span 2; }
    .flexgrdTableCont > span:nth-child(2) { grid-column: 1 / span 2; }
    .flexgrdTableCont > span:nth-child(3) { grid-column: 1 / span 2; justify-content: flex-end !important; text-align: right !important; }
    .flexgrdTableCont > span:nth-child(4) { grid-column: 1; }
    .flexgrdTableCont > span:nth-child(5) { grid-column: 2; }
    .flexgrdTableCont > span:nth-child(6) { grid-column: 1 / span 2; }
    /* 名称作为卡片标题加粗 */
    .flexgrdTableCont > span:nth-child(1) {
        font-weight: 600;
        color: var(--text-1);
        font-size: 15px;
    }
    /* 价格行高亮 */
    .flexgrdTableCont > span:nth-child(4),
    .flexgrdTableCont > span:nth-child(5) {
        color: var(--brand);
        font-weight: 600;
    }
    .flexgrdTableCont > span::before {
        content: attr(data-label);
        flex-shrink: 0;
        width: 56px;
        max-width: 24%;
        color: var(--text-4);
        font-size: 11px;
        font-weight: normal;
        margin-right: 8px;
    }
    .flexgrdTableCont > span:nth-child(1)::before { content: "材料名称"; }
    .flexgrdTableCont > span:nth-child(2)::before { content: "规格型号"; }
    .flexgrdTableCont > span:nth-child(3)::before { content: "单位"; }
    .flexgrdTableCont > span:nth-child(4)::before { content: "除税价"; }
    .flexgrdTableCont > span:nth-child(5)::before { content: "含税价"; }
    .flexgrdTableCont > span:nth-child(6)::before { content: "备注"; }
    /* 名称作为卡片标题加粗 */
    .flexgrdTableCont > span:nth-child(1) {
        font-weight: 600;
        color: var(--text-1);
        font-size: 15px;
    }
    /* 价格行高亮 */
    .flexgrdTableCont > span:nth-child(4),
    .flexgrdTableCont > span:nth-child(5) {
        color: var(--brand);
        font-weight: 600;
    }
}

/* Small mobile: <= 480px */
@media (max-width: 480px) {
    .page-hero h1 {
        font-size: 20px;
    }
    .detail-card {
        padding: 14px 12px;
        border-radius: 10px;
    }
    .card-title {
        font-size: 16px;
    }
    .flexgrdTableCont {
        padding: 10px 12px;
    }
}
