/* ============================================
   阳光商城 - 天津港集团招采平台
   设计稿: Figma 1920×1261
   品牌主色: #1F6DE8 → #18D5DF
============================================ */

/* ---------- 设计变量 ---------- */
:root {
    /* 颜色 */
    --color-primary: #1F6DE8;
    --color-primary-light: #18D5DF;
    --color-bg-page: #1F6DE8;
    --color-bg-tint: rgba(31, 109, 232, 0.4);
    --color-card: #FFFFFF;
    --color-text-title: #333333;
    --color-text-body: #4E5463;
    --color-text-secondary: #666666;
    --color-text-muted: #8A8F99;
    --color-divider: rgba(153, 153, 153, 0.2);
    --color-border: #E8E8E8;
    --color-border-active: #1F6DE8;
    --color-danger: #E1251B;
    --color-arrow-bg: #D7E2F2;
    --color-trend-soft: #EAF0FF;

    /* 阴影 */
    --shadow-module: 0 2px 14px 0 rgba(4, 44, 101, 0.1);
    --shadow-card-hover: 0 6px 20px 0 rgba(31, 109, 232, 0.18);
    --shadow-arrow-hover: 0 4px 12px 0 rgba(14, 94, 187, 0.25);

    /* 圆角 */
    --radius-card: 4px;
    --radius-arrow: 2px;

    /* 间距 */
    --gap-module: 24px;
    --gap-cards: 16px;
    --pad-module: 8px 24px 24px;

    /* 容器 */
    --content-max-width: 1200px;
    --container-pad-x: clamp(16px, 5vw, 360px);

    /* 字体 */
    --font-family: "Source Han Sans CN", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    color: var(--color-text-title);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #F5F8FF;
}

h1, h2, h3, h4, h5, h6, p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

img {
    max-width: 100%;
    display: block;
}

/* ---------- 页面整体 ---------- */
.ygsc-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
}

/* 背景图 */
.ygsc-bg {
    position: absolute;
    inset: 0;
    background-image: url("../images/bg.png");
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: -2;
}

/* 蓝色叠层 */
.ygsc-bg-overlay {
    position: absolute;
    inset: 0;
    /* background-color: var(--color-bg-tint); */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: -1;
}

/* ---------- 主容器 ---------- */
.ygsc-container {
    width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    gap: var(--gap-module);
    align-items: center;
}

/* ---------- 大标题 ---------- */
.ygsc-title {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 8px 0;
}

.ygsc-title__text {
    font-size: 30px;
    font-weight: 700;
    color: var(--color-text-title);
    text-align: center;
    letter-spacing: 2px;
    white-space: nowrap;
}

.ygsc-title__deco {
    display: block;
    width: 309px;
    max-width: 28vw;
    height: 11px;
    flex-shrink: 1;
    min-width: 80px;
}

/* ---------- 主内容区 ---------- */
.ygsc-main {
    width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 894px 282px;
    gap: var(--gap-module);
    align-items: stretch;
}

.ygsc-main__left {
    display: flex;
    flex-direction: column;
    gap: var(--gap-module);
    min-width: 0;
    width: 894px;
    height: 734px;
}

/* ---------- 卡片模块通用 ---------- */
.ygsc-module {
    position: relative;
    background-color: var(--color-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-module);
    padding: var(--pad-module);
    display: flex;
    flex-direction: column;
    gap: var(--gap-module);
}

.ygsc-module--full {
    width: 100%;
}

.ygsc-trend {
    background-color: var(--color-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-module);
    padding: var(--pad-module);
    display: flex;
    flex-direction: column;
    gap: var(--gap-module);
    width: 282px;
    height: 734px;
}

/* 模块头部:图标+标题+更多 */
.ygsc-module__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    height: 51px;
    padding-top: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-divider);
    flex-shrink: 0;
}

.ygsc-module__title {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ygsc-module__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ygsc-module__icon::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    border: 5px solid var(--color-primary);
    box-sizing: border-box;
}

.ygsc-module__icon::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212, 234, 255, 0.7) 0%, rgba(255, 255, 255, 0.5) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
}

.ygsc-module__title-text {
    font-size: 18px;
    font-weight: 700;
    line-height: 28px;
    color: var(--color-text-title);
}

.ygsc-module__more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 350;
    line-height: 22px;
    color: var(--color-text-secondary);
    height: 21px;
    padding: 0 4px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.ygsc-module__more:hover {
    color: var(--color-primary);
}

.ygsc-module__more-icon {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.ygsc-module__more:hover .ygsc-module__more-icon {
    transform: translateX(2px);
}

/* ---------- 卡片轮播容器 ---------- */
.ygsc-cards {
    display: flex;
    gap: var(--gap-cards);
    min-width: 0;
    overflow: hidden;
}


/* 模块包装器 */
.ygsc-module-wrapper {
    position: relative;
    width: 894px;
    height: 355px;
}

[data-module-wrapper="group"] {
    width: 1200px;
    margin: 0 auto;
}

/* 轮播样式 */
.ygsc-module .swiper {
    position: relative;
    padding: 0;
    width: 100%;
    overflow: hidden;
}

.ygsc-module .swiper-wrapper {
    display: flex;
    gap: 16px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    width: max-content;
}

.ygsc-module .swiper-slide {
    flex-shrink: 0;
    width: 199.25px !important;
}

[data-module="group"] .swiper-slide {
    width: 217px !important;
}

/* 按钮样式 - 模块内部 */
.ygsc-module-wrapper .carousel-arrow {
    position: absolute;
    top: calc(50% + 15px);
    transform: translateY(-50%);
    width: 16px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #d7e2f2;
    border-radius: 2px;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    z-index: 10;
    border: none;
    padding: 0;
}

.ygsc-module-wrapper .carousel-arrow:hover {
    background-color: #c2d3ec;
}

.ygsc-module-wrapper .carousel-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.ygsc-module-wrapper .carousel-prev {
    left: 5px;
}

.ygsc-module-wrapper .carousel-next {
    right: 5px;
}

.ygsc-module-wrapper .carousel-arrow svg {
    display: block;
}

.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* 单个卡片 */
.ygsc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    padding: 12px;
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    cursor: pointer;
    transition: border-color 0.25s ease,
                transform 0.25s ease,
                box-shadow 0.25s ease;
    min-width: 0;
}

.ygsc-card:hover,
.ygsc-card:focus-visible {
    border-color: var(--color-border-active);
    box-shadow: var(--shadow-card-hover);
    outline: none;
    position: relative;
    z-index: 1;
}

/* 强调态(图层中的某些卡片有蓝色边框) */
.ygsc-card.is-highlight {
    border-color: var(--color-border-active);
}

.ygsc-card__image-wrap {
    position: relative;
    width: 100%;
    height: 133px;
    background-color: #FFFFFF;
    border-radius: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.ygsc-card__image {
    width: 100%;
    height: 100%;
    max-width: 165px;
    max-height: 116px;
    object-fit: contain;
    transition: transform 0.4s ease;
    display: block;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.ygsc-card:hover .ygsc-card__image {
    transform: scale(1.05);
}

.ygsc-card__title {
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    color: var(--color-text-title);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
    min-height: 44px;
    transition: color 0.2s ease;
}

.ygsc-card:hover .ygsc-card__title {
    color: var(--color-primary);
}

.ygsc-card__price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--color-danger);
}

.ygsc-card__price-symbol {
    font-size: 18px;
    font-weight: 400;
    line-height: 20px;
}

.ygsc-card__price-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 20px;
}

/* ---------- 物资价格趋势 ---------- */
.ygsc-trend__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.ygsc-trend-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background-color: #FFFFFF;
    border: 1px solid #E8EFFF;
    border-radius: 4px;
    flex: 1 1 0;
    min-height: 92px;
    transition: transform 0.25s ease,
                box-shadow 0.25s ease,
                border-color 0.25s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ygsc-trend-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(234, 240, 255, 1) 0%, rgba(234, 240, 255, 0) 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.ygsc-trend-item:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px 0 rgba(31, 109, 232, 0.12);
}

.ygsc-trend-item:hover::before {
    opacity: 1;
}

.ygsc-trend-item__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-body);
    line-height: 20px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

.ygsc-trend-item__meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1;
    position: relative;
    z-index: 1;
}

.ygsc-trend-item__chart {
    width: 100%;
    height: 28px;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.ygsc-trend-item__chart svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ---------- 旧箭头样式已移除，使用 Swiper 按钮样式 */

/* ---------- 响应式 ---------- */

/* 中等屏幕 */
@media (max-width: 1440px) {
    .ygsc-container {
        padding: 32px clamp(16px, 4vw, 80px);
    }

    .ygsc-main {
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    .ygsc-trend {
        width: 280px;
    }
}

/* 小屏幕 */
@media (max-width: 1024px) {
    .ygsc-main {
        grid-template-columns: 1fr;
    }

    .ygsc-trend {
        width: 100%;
    }

}

@media (max-width: 768px) {
    :root {
        --pad-module: 8px 16px 16px;
        --gap-module: 16px;
        --gap-cards: 12px;
    }

    .ygsc-container {
        padding: 24px 16px;
    }

    .ygsc-title__text {
        font-size: 22px;
        letter-spacing: 1px;
    }

    .ygsc-title__deco {
        max-width: 80px;
    }

    .ygsc-card__image-wrap {
        height: 110px;
    }

    .ygsc-arrow {
        display: none;
    }
}

@media (max-width: 480px) {

    .ygsc-module__title-text {
        font-size: 16px;
    }

    .ygsc-module__header {
        height: auto;
        padding: 8px 0 12px;
    }

    .ygsc-card__title {
        font-size: 14px;
        line-height: 20px;
        min-height: 40px;
    }

    .ygsc-card__price-symbol {
        font-size: 16px;
    }

    .ygsc-card__price-value {
        font-size: 18px;
    }
}

/* 焦点可见样式 */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   Title Section
   ======================================== */
.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;
}
