/* ============================================================
   蓉易采产业协同数字平台 - 前台响应式适配样式
   作用范围：仅前台页面（Areas/Web）
   原则：不修改任何业务逻辑（C# / JS / 表单 / 接口均不动），
        只通过媒体查询覆盖布局与外观。
   引入位置：_Layout.cshtml 中 @RenderSection("head") 之后，
        以保证对页面内联样式具备同优先级覆盖能力。
   断点：≤1200px（容器全宽）
         ≤992px（图文行堆叠 / 两列卡片）
         ≤768px（汉堡菜单 / 单列卡片 / 表单纵向 / 表格转卡片）
         ≤480px（小屏细节）
============================================================ */

/* ---------- 通用：顶部导航容器（PC 端与汉堡菜单共用） ---------- */
.nav-wrap {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* 汉堡按钮：默认隐藏，仅手机端显示 */
.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    font-size: 22px;
    line-height: 1;
    color: #0F4C81;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.nav-toggle:hover {
    background: #f0f5fa;
}

/* ============================================================
   ≤1200px：容器全宽
============================================================ */
@media (max-width: 1200px) {
    .container {
        width: 100%;
        padding: 0 20px;
    }
}

/* ============================================================
   ≤992px：图文行堆叠、两列卡片
============================================================ */
@media (max-width: 992px) {
    .row {
        flex-direction: column;
        gap: 30px;
    }

    .row-reverse {
        flex-direction: column;
    }

    .row-img {
        width: 100%;
    }

    .row-img img {
        width: 100%;
        height: auto;
        max-height: 360px;
        object-fit: cover;
    }

    .case-item {
        width: calc((100% - 30px) / 2);
    }

    .info-block {
        flex-direction: column;
    }

    .search-wrap {
        max-width: 100%;
    }

    .search-wrap input {
        width: 100%;
    }
}

/* ============================================================
   ≤768px：手机端主断点
============================================================ */
@media (max-width: 768px) {
    /* ---------- 头部导航：汉堡菜单 ---------- */
    .header {
        height: 60px;
        line-height: 60px;
    }

    .header-inner {
        position: relative;
    }

    .logo {
        font-size: 18px;
        white-space: nowrap;
    }

    .nav-toggle {
        display: block;
    }

    .nav-wrap {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        z-index: 998;
    }

    .nav-wrap.open {
        display: flex;
    }

    .nav-list {
        display: flex; /* 覆盖 css.css 中手机端 display:none 的旧规则 */
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-item {
        width: 100%;
    }

    .nav-item > a {
        display: block;
        padding: 13px 20px;
        border-radius: 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 15px;
        background: #fff;
    }

    .nav-dropdown {
        position: static;
        display: block;
        border: none;
        box-shadow: none;
        background: #f7f9fc;
        padding: 4px 0;
    }

    .dropdown-item {
        padding: 11px 20px 11px 40px;
        white-space: normal;
    }

    .header-btn {
        display: flex;
        flex-direction: row;
        gap: 10px;
        padding: 12px 20px;
        border-top: 1px solid #f0f0f0;
        line-height: 1.4;
    }

    .header-btn a {
        flex: 1;
        text-align: center;
        padding: 9px 10px;
        font-size: 14px;
    }

    /* ---------- 首页全屏 Banner ---------- */
    .banner {
        height: auto;
        padding: 70px 0;
    }

    .banner-text {
        max-width: 100%;
    }

    .banner-text h1 {
        font-size: 26px;
        margin-bottom: 16px;
    }

    .banner-text p {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .banner-btn {
        padding: 12px 28px;
        font-size: 15px;
    }

    /* ---------- 页面 Banner ---------- */
    .page-banner {
        height: 220px;
    }

    .page-banner .banner-text h1 {
        font-size: 26px;
        margin-bottom: 12px;
    }

    .page-banner .banner-text p {
        font-size: 14px;
    }

    /* ---------- 通用区块 ---------- */
    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .single-block {
        padding: 20px 16px;
    }

    .row {
        margin-bottom: 40px;
    }

    .row-text h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .row-text p {
        font-size: 14px;
        margin-bottom: 14px;
        line-height: 1.7;
    }

    .normal-btn {
        padding: 10px 22px;
        font-size: 14px;
    }

    /* ---------- 卡片列表：单列 ---------- */
    .card-list {
        gap: 16px;
    }

    .service-card {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
        padding: 24px 18px;
    }

    .service-card img {
        height: auto;
    }

    .service-card h4 {
        font-size: 17px;
    }

    .service-card p {
        font-size: 14px;
    }

    .tech-card {
        flex: 1 1 100%;
        min-width: 0;
        padding: 24px 18px;
    }

    .tech-card img {
        height: auto;
    }

    .tech-card h3 {
        font-size: 18px;
    }

    .tech-card p {
        font-size: 14px;
    }

    .info-card {
        width: 100% !important;
    }

    .case-item {
        width: 100%;
    }

    .case-item img {
        height: auto;
    }

    .case-content {
        padding: 16px;
    }

    .case-content h3 {
        font-size: 17px;
    }

    .case-content p {
        font-size: 14px;
    }

    /* ---------- 搜索区域：纵向全宽 ---------- */
    .search-wrap {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 30px;
    }

    .search-wrap input {
        width: 100%;
        height: 46px;
        font-size: 15px;
    }

    .search-wrap button {
        width: 100%;
        height: 46px;
        font-size: 15px;
    }

    /* ---------- 标签栏 / 页面切换：可横向滚动 ---------- */
    .tab-nav {
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .tab-item {
        white-space: nowrap;
        padding: 12px 18px;
        font-size: 15px;
    }

    .page-nav {
        flex-wrap: wrap;
        gap: 10px;
        margin: 16px 0 0;
    }

    .page-nav a {
        padding: 10px 22px;
        font-size: 14px;
    }

    /* ---------- 新闻 / 交易列表 ---------- */
    .news-item,
    .info-item {
        padding: 20px 16px;
        margin-bottom: 16px;
    }

    .news-title,
    .info-title {
        font-size: 17px;
    }

    .news-meta,
    .info-meta {
        font-size: 13px;
    }

    .info-desc {
        font-size: 14px;
    }

    .empty-tip {
        padding: 40px 0;
        font-size: 14px;
    }

    /* ---------- 分页 ---------- */
    .pagination {
        margin-top: 30px;
    }

    .pagination a {
        padding: 8px 13px;
        font-size: 14px;
        margin: 4px 3px;
    }

    /* ---------- 新闻详情 ---------- */
    .breadcrumb {
        margin-top: 16px;
    }

    .article-main {
        max-width: 100%;
        margin: 10px 0 40px;
        padding: 22px 16px;
    }

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

    .article-info {
        font-size: 13px;
    }

    .article-content {
        font-size: 15px;
    }

    .back-btn {
        padding: 10px 22px;
        font-size: 15px;
    }

    /* ---------- 登录 / 注册 ---------- */
    .login-form,
    .register-form {
        width: 92%;
        padding: 36px 22px;
    }

    .login-form h2,
    .register-form h2 {
        font-size: 24px;
        margin-bottom: 28px;
    }

    .form-item input {
        height: 46px;
        font-size: 15px;
    }

    .code-btn {
        width: 110px;
        height: 46px;
        font-size: 14px;
    }

    .login-btn,
    .register-btn {
        height: 48px;
        font-size: 16px;
    }

    /* 验证码弹窗 */
    .verify-box {
        width: 92%;
        max-width: 380px;
        padding: 24px 18px;
    }

    .word-wrap {
        gap: 10px;
    }

    .word-item {
        width: 54px;
        height: 54px;
        line-height: 54px;
        font-size: 22px;
    }

    .btns {
        flex-wrap: wrap;
    }

    .btns button {
        padding: 7px 14px;
    }

    /* ---------- 帮助中心 ---------- */
    .help-item {
        padding: 18px 20px;
    }

    .help-item h3 {
        font-size: 16px;
    }

    .help-item p {
        font-size: 14px;
    }

    /* ---------- 发布需求 ---------- */
    .trade-hall {
        margin: 30px 0;
        padding: 16px;
    }

    .hall-main-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .news-list {
        gap: 14px;
    }

    /* ---------- 个人中心 ---------- */
    .main-wrap {
        flex-direction: column;
        gap: 16px;
        margin-top: 20px;
        padding-bottom: 40px;
    }

    .left-sidebar {
        width: 100%;
    }

    .sidebar-title {
        padding: 14px;
        font-size: 16px;
    }

    .side-nav {
        display: flex;
        flex-wrap: wrap;
    }

    .side-nav li {
        border-bottom: none;
    }

    .side-nav li a {
        padding: 12px 14px;
        font-size: 14px;
        border-left: none !important;
    }

    .side-nav li a.active,
    .side-nav li a:hover {
        border-left: none;
        border-bottom: 3px solid #0F4C81;
        background: #f0f5fa;
    }

    .right-content {
        flex: 1 1 auto;
        min-height: 0;
        padding: 20px 16px;
    }

    /* 表单：标签在上、输入框全宽 */
    .form-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .form-label {
        width: auto;
    }

    .form-input,
    .form-textarea,
    .form-select {
        width: 100%;
    }

    .tip-text,
    .err-tip {
        margin-left: 0;
    }

    /* 信息表格：表头隐藏，行转卡片式 */
    .list-head {
        display: none;
    }

    .list-row {
        flex-wrap: wrap;
        padding: 12px 10px;
        gap: 4px 0;
    }

    .list-row .col-1 {
        display: none;
    }

    .list-row .col-2 {
        width: 100%;
        font-size: 15px;
        font-weight: 600;
        color: #0F4C81;
    }

    .list-row .col-3,
    .list-row .col-4,
    .list-row .col-5,
    .list-row .col-6 {
        width: 50%;
        font-size: 13px;
    }

    /* 我的交易：列表转卡片 */
    #myTrade .info-list .list-head {
        display: none;
    }

    #myTrade .info-list .list-item {
        flex-wrap: wrap;
        padding: 10px 8px;
    }

    #myTrade .info-list .list-item > div {
        flex: 1 1 50%;
        text-align: left;
        font-size: 13px;
        padding: 3px 6px;
        white-space: normal;
    }

    #myTrade .info-list .list-item > div:last-child {
        flex: 1 1 100%;
    }

    /* 我的交易：表单纵向 */
    #myTrade .form-row {
        flex-direction: column;
        gap: 10px;
    }

    #myTrade .form-row .form-group {
        flex: 1 1 100% !important;
        min-width: 0;
        width: 100%;
    }

    #myTrade .form-row .form-group label {
        width: auto;
    }

    /* ---------- 页脚 ---------- */
    .footer {
        padding: 30px 0;
        margin-top: 30px;
    }

    .footer-content {
        flex-direction: column;
        gap: 24px;
    }

    .footer-col h4 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .footer-col p,
    .footer-col a {
        font-size: 14px;
    }

    .footer-bottom {
        font-size: 12px;
    }
}

/* ============================================================
   ≤480px：小屏细节
============================================================ */
@media (max-width: 480px) {
    .logo {
        font-size: 16px;
    }

    .banner {
        padding: 50px 0;
    }

    .banner-text h1 {
        font-size: 22px;
    }

    .page-banner .banner-text h1 {
        font-size: 22px;
    }

    .section-title {
        font-size: 21px;
    }

    .row-text h3 {
        font-size: 18px;
    }

    .code-btn {
        width: 96px;
        font-size: 13px;
    }

    .word-item {
        width: 48px;
        height: 48px;
        line-height: 48px;
        font-size: 20px;
    }

    .side-nav li a {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn {
        padding: 8px 20px;
        font-size: 14px;
    }
}
