/* ============================================================
 * 阳光招采 — Production stylesheet
 * 1:1 reproduction of ygzc.pen
 * ============================================================ */

/* ---------- Design tokens ---------- */
:root {
    --color-bg-page: #ffffff;
    --color-tab-bar: #eef3fc;
    --color-card-default: #f7f7f7;
    --color-card-active: #ffffff;

    --color-primary: #1f6de8;
    --color-primary-soft: #438bfc;
    --color-primary-light: #73a9ff;

    --color-text-title: #333333;
    --color-text-card: #2e3033;
    --color-text-muted: #666666;
    --color-text-meta: #999999;
    --color-divider: rgba(153, 153, 153, 0.2);

    --shadow-panel: 0 2px 12.25px rgba(4, 44, 101, 0.10);

    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-pill: 48px;

    --font-family-base: "Source Han Sans CN", "PingFang SC",
        "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;

    --container-max: 1200px;
    --page-pad-x: 360px;
    --page-pad-y: 40px;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-base);
    background: var(--color-bg-page);
    color: var(--color-text-title);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    min-width: 320px;
}

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h3 {
    margin: 0;
    font-weight: inherit;
}

/* ---------- Page shell ---------- */
.ygzc-page {
    width: 100%;
    min-height: 880px;
    display: flex;
    justify-content: center;
}

.ygzc-container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--page-pad-y) 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   Title Section
   ======================================== */
.ygzc-container .title-section {
    width: 1200px;
    margin: 0 auto;
}

.title-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    height: 43px;
}

.title-decoration {
    position: relative;
    width: 309px;
    height: 11px;
    display: flex;
    align-items: flex-end;
}

.deco-line {
    width: 306px;
    height: 1px;
    background: linear-gradient(90deg, rgba(31, 109, 232, 0) 0%, #1f6de8 100%);
    position: absolute;
    bottom: 0;
    left: 0;
}

.deco-chevron {
    position: absolute;
    width: 19px;
    height: 7px;
    background-color: #1f6de8;
    clip-path: polygon(21% 0%, 100% 0%, 79% 100%, 0% 100%);
}

.title-decoration-left .chevron-1 {
    right: 4px;
    bottom: 2px;
    opacity: 0.36;
}

.title-decoration-left .chevron-2 {
    right: -1px;
}

.title-decoration-right {
    transform: scaleX(-1);
}

.title-decoration-right .chevron-1 {
    right: 4px;
    bottom: 2px;
    opacity: 0.36;
}

.title-decoration-right .chevron-2 {
    right: -1px;
}

.title-text {
    font-size: 30px;
    font-weight: 700;
    color: #333333;
    line-height: 1;
    text-align: center;
    letter-spacing: 0;
}

/* ---------- Primary tab navigation ---------- */
.ygzc-container .primary-tabs {
    width: 1200px;
    margin: 0 auto;
}

.primary-tabs {
    background: var(--color-tab-bar);
    border-radius: var(--radius-md);
    padding: 6px;
    display: flex;
    gap: 0;
    align-items: stretch;
    overflow: hidden;
}

.primary-tab {
    flex: 1 1 0;
    min-width: 0;
    height: 42px;
    padding: 10px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 400;
    color: var(--color-text-title);
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border: 1px solid transparent;
    background-clip: padding-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease, background 0.25s ease,
        box-shadow 0.25s ease, transform 0.15s ease;
}

.primary-tab + .primary-tab {
    margin-left: 0;
}

.primary-tab:hover {
    color: var(--color-primary);
    background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
    box-shadow: 0 4px 7px rgba(31, 109, 232, 0.06);
}

.primary-tab.is-active {
    color: #ffffff;
    font-weight: 700;
    background: linear-gradient(180deg,
            #73A9FF 0%,
            #438BFC 100%);
    box-shadow: 0 4px 8px rgba(31, 109, 232, 0.18);
}

.primary-tab:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ---------- Notice panel ---------- */
.ygzc-container .notice-panel {
    width: 1200px;
    margin: 0 auto;
}

.notice-panel {
    background: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------- Filter bar (pills + more link) ---------- */
.filter-bar {
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-pills {
    flex: 1 1 auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    flex: 0 0 auto;
    width: 76px;
    height: 30px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--color-card-default);
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    line-height: 22px;
    transition: background 0.2s ease, color 0.2s ease,
        box-shadow 0.2s ease;
}

.filter-pill:hover {
    background: #e9efff;
    color: var(--color-primary);
}

.filter-pill.is-active {
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(31, 109, 232, 0.25);
}

.filter-pill:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* "更多" link */
.more-link {
    flex: 0 0 auto;
    height: 21px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-muted);
    font-size: 14px;
    line-height: 22px;
    transition: color 0.2s ease;
}

.more-link:hover {
    color: var(--color-primary);
}

.more-icon {
    width: 12px;
    height: 12px;
    display: block;
}

/* ---------- Notice card grid ---------- */
.notice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

/* `display: grid` 会覆盖 UA 对 [hidden] 的默认隐藏,需精准恢复 */
.notice-tab-content[hidden],
.notice-grid[hidden],
.notice-card[hidden] {
    display: none;
}

.filter-bar + .filter-bar {
    margin-top: -12px;
}

.filter-pills--method .filter-pill {
    width: auto;
    min-width: 76px;
    padding: 4px 14px;
    white-space: nowrap;
}

.notice-grid__loading,
.notice-grid__empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--color-text-meta);
    padding: 40px 0;
    font-size: 14px;
}

/* ---------- Notice card ---------- */
.notice-card {
    position: relative;
    background: var(--color-card-default);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 12px;
    height: 123px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: space-between;
    overflow: hidden;
    cursor: pointer;
    outline: none;
    transition: background 0.22s ease, border-color 0.22s ease,
        transform 0.22s ease, box-shadow 0.22s ease;
}

.notice-card:hover {
    background: var(--color-card-active);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(31, 109, 232, 0.10);
}

.notice-card:focus-visible {
    outline: none;
}

.notice-card__tag {
    align-self: flex-start;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: #ffffff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    white-space: nowrap;
}

.notice-card__method {
    position: absolute;
    top: 12px;
    right: 12px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-sm);
    background: #f0f6ff;
    color: var(--color-primary);
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    white-space: nowrap;
}

.notice-card__method:empty {
    display: none;
}

.notice-card__title {
    flex: 1 1 auto;
    color: var(--color-text-card);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-all;
    margin: 0;
}

.notice-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-meta);
    font-size: 14px;
    line-height: 1;
}

.meta-date {
    flex: 0 0 auto;
}

.meta-divider {
    width: 1px;
    height: 10px;
    background: var(--color-divider);
    flex: 0 0 auto;
}

.meta-status {
    flex: 0 0 auto;
}

/* ============================================================
 * Responsive: tablet & mobile
 * ============================================================ */

/* ≤1440 — tighten container padding */
@media (max-width: 1440px) {
    .ygzc-container {
        padding: 32px 20px;
    }
}

/* ≤1200 — 3 columns */
@media (max-width: 1200px) {
    .notice-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ≤1024 — slimmer tabs */
@media (max-width: 1024px) {
    .ygzc-container {
        padding: 28px 16px;
        gap: 16px;
    }

    .primary-tab {
        font-size: 14px;
        padding: 8px;
    }

    .notice-panel {
        padding: 20px;
    }
}

/* ≤900 — 2 columns + scrollable primary tabs */
@media (max-width: 900px) {
    .notice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .primary-tabs {
        padding: 4px;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .primary-tabs::-webkit-scrollbar {
        display: none;
    }

    .primary-tab {
        flex: 0 0 auto;
        min-width: 96px;
        padding: 8px 12px;
    }
}

/* ≤640 — mobile compact */
@media (max-width: 640px) {
    :root {
        --page-pad-y: 20px;
    }

    .page-title {
        gap: 12px;
    }

    .title-deco {
        max-width: 90px;
    }

    .title-text {
        font-size: 22px;
    }

    .ygzc-container {
        padding: 20px 12px;
        gap: 12px;
    }

    .notice-panel {
        padding: 16px;
        gap: 16px;
    }

    .primary-tab {
        font-size: 13px;
        height: 38px;
        min-width: 84px;
    }

    .filter-pill {
        width: auto;
        min-width: 60px;
        font-size: 13px;
    }

    .notice-card {
        height: auto;
        min-height: 110px;
    }

    .notice-card__title {
        font-size: 13px;
    }

    .notice-card__meta {
        font-size: 12px;
    }
}

/* ≤480 — single column */
@media (max-width: 480px) {
    .notice-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ============================================================
   阳光招采 · v2 公共资源卡片（自 ygzc-variants.css 方案二合并）
   依赖容器类: .ygzc-variant--v2
   ============================================================ */
/* ==================== 方案二 · 公共资源卡片 ==================== */
.ygzc-variant--v2 .card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

/* display:grid 会覆盖 UA 对 [hidden] 的默认隐藏，需精准恢复 */
.ygzc-variant--v2 .card-grid[hidden],
.ygzc-variant--v2 .card[hidden] {
    display: none;
}

.ygzc-variant--v2 .card {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e8e8e8;
    cursor: pointer;
    overflow: hidden;
    outline: none;
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

/* 顶部蓝色 accent 条，hover 时出现 */
.ygzc-variant--v2 .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #1890ff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ygzc-variant--v2 .card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
    border-color: #bfdbfe;
}

.ygzc-variant--v2 .card:hover::before {
    opacity: 1;
}

/* NEW 角标：右上角斜切绶带，JS 加 is-new 才显示 */
.ygzc-variant--v2 .card-new-badge {
    display: none;
    position: absolute;
    top: 12px;
    right: -32px;
    width: 100px;
    background: #d4380d;
    box-shadow: 0 2px 6px rgba(212, 56, 13, 0.4);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    padding: 3px 0;
    transform: rotate(45deg);
    z-index: 2;
    letter-spacing: 1px;
}

.ygzc-variant--v2 .card.is-new .card-new-badge {
    display: block;
}

/* 分类标签 */
.ygzc-variant--v2 .card-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.ygzc-variant--v2 .category-engineering {
    background: #e6f7ff;
    color: #096dd9;
    border: 1px solid #bae7ff;
}

.ygzc-variant--v2 .category-procurement {
    background: #fff7e6;
    color: #9e6200;
    border: 1px solid #ffe7ba;
}

/* 服务/信息化/设备 三个分类的配色（源对比文件未含，为动态模板补齐） */
.ygzc-variant--v2 .category-service {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

.ygzc-variant--v2 .category-it {
    background: #f9f0ff;
    color: #531dab;
    border: 1px solid #d3adf7;
}

.ygzc-variant--v2 .category-equipment {
    background: #fff0f6;
    color: #c41d7e;
    border: 1px solid #ffadd2;
}

/* 时间行：位于标题下方；右侧靠右显示采购方式 */
.ygzc-variant--v2 .card-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #999999;
    margin-top: 12px;
}

.ygzc-variant--v2 .card-time svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* 采购方式小胶囊：靠右，值为空时隐藏 */
.ygzc-variant--v2 .card-method {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 4px;
    border: 1px solid #bae7ff;
    background: #e6f7ff;
    color: #096dd9;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
}

.ygzc-variant--v2 .card-method:empty { display: none; }

/* 标题 */
.ygzc-variant--v2 .card-title {
    font-size: 16px;
    color: #262626;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 51px;
    transition: color 0.3s ease;
}

.ygzc-variant--v2 .card:hover .card-title {
    color: #1890ff;
}

@media (max-width: 1200px) {
    .ygzc-variant--v2 .card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ygzc-variant--v2 .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .ygzc-variant--v2 .card-grid {
        grid-template-columns: 1fr;
    }
}
