/**
 * MARKETS Page Styles
 * 深色主题，蓝色强调，卡片式布局
 * 
 * @package Milestrong
 * @since 2.0.0
 */

/* ========================================
   顶部视觉区（MARKETS TOP VISUAL）
   ======================================== */

/* Pad/手机端模板头 - 默认隐藏，仅在Pad/Mobile端显示 */
.markets-mobile-header {
    display: none;
    background: #0a0e1a;
    padding: 80px 0 60px;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.markets-mobile-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 26, 0.85);
    z-index: 1;
}

.markets-mobile-header-container {
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-align: center;
}

.markets-mobile-header-title {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 20px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.markets-mobile-header-subtitle {
    font-size: 18px;
    line-height: 1.6;
    color: #a0aec0;
    margin: 0;
}

/* PC端顶部视觉区 - 默认显示 */
.markets-top-visual {
    position: relative;
    width: 100vw;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    height: 800px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background-size: 100% auto !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-color: #0a0e1a;
    padding: 0 0 100px;
    overflow: hidden;
}

.markets-top-visual-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.markets-top-visual-container {
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-align: center;
}

/* 标题 */
.markets-top-visual-title {
    font-size: 40px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 60px;
    letter-spacing: 4px;
    text-transform: uppercase;
    position: relative;
    top: 80px;
    margin-bottom: -20px;
}

/* 副标题/描述 */
.markets-top-visual-description {
    font-size: 18px;
    line-height: 1.6;
    color: #a0aec0;
    margin: 0;
    max-width: 800px;
    margin: 0 auto;
}


/* ========================================
   市场列表区（MARKETS LIST）
   ======================================== */

.markets-list-section {
    background: #0a0e1a;
    padding: 100px 0;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.markets-list-container {
    max-width: 1440px;
    margin: 0 auto;
}

/* 标题和描述 */
.markets-list-header {
    text-align: center;
    margin-bottom: 60px;
}

.markets-list-title {
    font-size: 72px;
    font-weight: 700;
    color: #017fff;
    margin: 0 0 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.markets-list-description {
    font-size: 16px;
    line-height: 1.6;
    color: #ffffff;
    margin: 0;
    max-width: 800px;
    margin: 0 auto;
}

/* 市场卡片网格 */
.markets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

.market-card {
    background: #16161e;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.market-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(1, 127, 255, 0.3);
    border-color: rgba(1, 127, 255, 0.5);
}

.market-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* 卡片图片 */
.market-card-image {
    width: calc(100% - 30px);
    height: 0;
    padding-bottom: 60%;
    overflow: hidden;
    background: #0f1419;
    position: relative;
    margin: 15px 15px 0 15px;
    border-radius: 12px;
}

.market-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.market-card:hover .market-card-image img {
    transform: scale(1.1);
}

/* 卡片内容 - 左右布局 */
.market-card-content {
    padding: 20px 15px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.market-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.4;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 按钮 */
.market-card-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(45deg, #017fff, #0066cc);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.market-card-button:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(1, 127, 255, 0.4);
}

.market-card-button svg {
    transition: transform 0.3s ease;
}

.market-card-button:hover svg {
    transform: translateX(3px);
}

/* 无市场提示 */
.no-markets-found {
    text-align: center;
    padding: 80px 20px;
    color: #718096;
    font-size: 18px;
}

/* 分页导航 */
.markets-pagination {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 60px;
}

.markets-pagination::-webkit-scrollbar {
    display: none;
}

.markets-pagination ul {
    display: flex;
    align-items: center;
    gap: 50px;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    width: max-content;
    min-width: 100%;
    justify-content: center;
}

.markets-pagination li {
    margin: 0;
    flex-shrink: 0;
}

/* 所有页码按钮：圆形、白底、深色文字 */
.markets-pagination a,
.markets-pagination span.current {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: #ffffff;
    color: #1a1a2e;
    border: none;
    border-radius: 50%;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    line-height: 1;
}

.markets-pagination a:hover {
    background: #017fff;
    color: #ffffff;
}

/* 当前页：蓝色 */
.markets-pagination span.current {
    background: #017fff;
    color: #ffffff;
}

/* 省略号永不显示 */
.markets-pagination .dots {
    display: none !important;
}

/* 禁用状态（prev/next 无链接时） */
.markets-pagination .prev span,
.markets-pagination .next span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #ffffff;
    color: #1a1a2e;
    border-radius: 50%;
    opacity: 0.4;
    cursor: not-allowed;
}


/* ========================================
   联系我们区（Contact Us）
   ======================================== */

.markets-contact-section {
    background: #0a0e1a;
    padding: 100px 0;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.markets-contact-container {
    max-width: 1440px;
    margin: 0 auto;
}

/* 标题和副标题 */
.markets-contact-header {
    text-align: center;
    margin-bottom: 60px;
}

.markets-contact-title {
    font-size: 48px;
    font-weight: 700;
    color: #017fff;
    margin: 0 0 20px;
    letter-spacing: 2px;
}

.markets-contact-subtitle {
    font-size: 16px;
    line-height: 1.6;
    color: #fff;
    margin: 0;
    font-weight: 400;
}

/* 联系表单 - 双栏布局 */
.markets-contact-form {
    max-width: 1000px;
    margin: 0 auto;
}

.markets-contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.markets-contact-form .form-column {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.markets-contact-form .form-column-right {
    justify-content: space-between;
}

/* 表单字段 */
.markets-contact-form .form-field {
    position: relative;
}

.markets-contact-form input[type="text"],
.markets-contact-form input[type="email"],
.markets-contact-form textarea {
    width: 100%;
    padding: 16px 24px;
    background: #16161e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 14px;
    color: #ffffff;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.markets-contact-form input[type="text"]::placeholder,
.markets-contact-form input[type="email"]::placeholder,
.markets-contact-form textarea::placeholder {
    color: #6b7280;
}

.markets-contact-form input[type="text"]:focus,
.markets-contact-form input[type="email"]:focus,
.markets-contact-form textarea:focus {
    background: #1f1f2a;
    border-color: rgba(1, 127, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(1, 127, 255, 0.1);
}

/* Message 文本域 */
.markets-contact-form textarea {
    border-radius: 20px;
    min-height: 140px;
    resize: vertical;
    padding: 16px 24px;
}

.markets-contact-form .form-field-message {
    flex: 1;
}

/* 验证码字段 - 嵌入式半圆形设计 */
.markets-contact-form .form-field-captcha {
    position: relative;
}

.markets-contact-form .form-field-captcha input {
    padding-right: 140px;
}

.markets-contact-form .captcha-wrapper {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 120px;
    border-radius: 0 50px 50px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 提交按钮 */
.markets-contact-form .form-submit {
    text-align: center;
    margin-bottom: 20px;
}

.markets-contact-form .submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 10px;
    padding: 16px 60px;
    background: linear-gradient(90deg, #017fff 0%, #0066cc 100%);
    border: none;
    border-radius: 50px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(1, 127, 255, 0.3);
    min-width: 600px;
    border: 2px solid #ffffff;
}

.markets-contact-form .submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 127, 255, 0.4);
}

.markets-contact-form .submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.markets-contact-form .submit-button svg {
    transition: transform 0.3s ease;
}

.markets-contact-form .submit-button:hover svg {
    transform: translateX(3px);
}

/* 提交按钮箭头图标 */
.markets-contact-form .submit-arrow {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: absolute;
    right: 30px;
    transform: rotate(-45deg);
}

.markets-contact-form .submit-arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-top: 2px solid #ffffff;
    border-right: 2px solid #ffffff;
    transform: translate(-30%, -40%) rotate(45deg);
}

.markets-contact-form .submit-arrow::after {
    content: '';
    position: absolute;
    top: 54%;
    left: 0;
    width: 28px;
    height: 2px;
    background-color: #ffffff;
    transform: translateY(50%);
}

/* 隐私声明 */
.markets-contact-form .form-privacy {
    text-align: center;
    font-size: 12px;
    color: #718096;
    margin: 0;
    line-height: 1.6;
}

/* 表单消息提示 */
.form-message {
    max-width: 600px;
    margin: 30px auto 0;
    padding: 16px 24px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

.form-message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.form-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Markets页面的消息容器 */
#markets-form-messages {
    max-width: 600px;
    margin: 16px auto 0;
    min-height: 24px;
}

#markets-success-message,
#markets-error-message {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

#markets-success-message {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
}

#markets-error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
}


/* ========================================
   响应式设计 - PC / Pad / Mobile 三端适配
   ======================================== */

/* ==================== Pad 端（768px - 1199px）==================== */
@media (max-width: 1199px) and (min-width: 768px) {
    
    /* 显示Pad端模板头 */
    .markets-mobile-header {
        display: block;
    }
    
    .markets-mobile-header-container {
        padding: 0 30px;
    }
    
    .markets-mobile-header-title {
        font-size: 40px;
    }
    
    .markets-mobile-header-subtitle {
        font-size: 16px;
    }
    
    /* 隐藏PC端顶部视觉区 */
    .markets-top-visual {
        display: none;
    }
    
    /* 顶部视觉区 */
    .markets-top-visual {
        padding: 80px 0 60px;
    }
    
    .markets-top-visual-container {
        padding: 0 30px;
    }
    
    .markets-top-visual-title {
        font-size: 52px;
        margin-bottom: 50px;
        top: 60px;
        margin-bottom: -10px;
    }
    
    
    .markets-top-visual-description {
        font-size: 16px;
    }
    
    /* 市场列表区 */
    .markets-list-section {
        padding: 80px 0;
    }
    
    .markets-list-container {
        padding: 0 30px;
    }
    
    .markets-list-title {
        font-size: 40px;
    }
    
    .markets-list-description {
        font-size: 15px;
    }
    
    /* 2列网格布局 */
    .markets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .market-card-image {
        width: calc(100% - 24px);
        margin: 12px 12px 0 12px;
    }
    
    .market-card-content {
        padding: 15px 12px 12px;
    }
    
    .market-card-title {
        font-size: 16px;
    }
    
    .market-card-button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    /* 联系我们区 */
    .markets-contact-section {
        padding: 80px 0;
    }
    
    .markets-contact-container {
        padding: 0 30px;
    }
    
    .markets-contact-title {
        font-size: 40px;
    }
    
    /* 表单改为单栏 */
    .markets-contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .markets-contact-form .submit-button {
        width: 100%;
    }
}

/* ==================== Mobile 端（<768px）==================== */
@media (max-width: 767px) {
    
    /* 显示Mobile端模板头 */
    .markets-mobile-header {
        display: block;
        padding: 60px 0 40px;
    }
    
    .markets-mobile-header-container {
        padding: 0 20px;
    }
    
    .markets-mobile-header-title {
        font-size: 32px;
        letter-spacing: 2px;
    }
    
    .markets-mobile-header-subtitle {
        font-size: 14px;
    }
    
    /* 隐藏PC端顶部视觉区 */
    .markets-top-visual {
        display: none;
    }
    
    /* 顶部视觉区 */
    .markets-top-visual {
        padding: 60px 0 40px;
    }
    
    .markets-top-visual-container {
        padding: 0 20px;
    }
    
    .markets-top-visual-title {
        font-size: 36px;
        letter-spacing: 2px;
        top: 30px;
        margin-bottom: -10px;
    }
    
    
    .markets-top-visual-description {
        font-size: 14px;
    }
    
    /* 市场列表区 */
    .markets-list-section {
        padding: 60px 0;
    }
    
    .markets-list-container {
        padding: 0 20px;
    }
    
    .markets-list-header {
        margin-bottom: 40px;
    }
    
    .markets-list-title {
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .markets-list-description {
        font-size: 14px;
    }
    
    /* 单列流式布局 */
    .markets-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .market-card-image {
        width: calc(100% - 20px);
        margin: 10px 10px 0 10px;
    }
    
    .market-card-content {
        padding: 15px 10px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .market-card-title {
        font-size: 16px;
    }
    
    .market-card-button {
        padding: 8px 20px;
        font-size: 12px;
        align-self: flex-end;
    }
    
    /* 分页样式 */
    .markets-pagination ul {
        gap: 20px;
    }
    
    .markets-pagination a,
    .markets-pagination span.current,
    .markets-pagination .prev span,
    .markets-pagination .next span {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    
    /* 联系我们区 */
    .markets-contact-section {
        padding: 60px 0;
    }
    
    .markets-contact-container {
        padding: 0 20px;
    }
    
    .markets-contact-header {
        margin-bottom: 40px;
    }
    
    .markets-contact-title {
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .markets-contact-subtitle {
        font-size: 14px;
    }
    
    /* 表单单列布局 */
    .markets-contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 30px;
    }
    
    .markets-contact-form .form-column {
        gap: 16px;
    }
    
    .markets-contact-form input[type="text"],
    .markets-contact-form input[type="email"],
    .markets-contact-form textarea {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .markets-contact-form textarea {
        min-height: 120px;
    }
    
    /* 验证码区域缩小 */
    .markets-contact-form .form-field-captcha input {
        padding-right: 110px;
    }
    
    .markets-contact-form .captcha-wrapper {
        width: 100px;
    }
    
    .markets-contact-form .captcha-refresh {
        width: 28px;
        height: 28px;
    }
    
    /* 提交按钮全宽 */
    .markets-contact-form .submit-button {
        width: 100%;
        padding: 14px 30px;
        font-size: 16px;
    }
    
    .markets-contact-form .form-privacy {
        font-size: 11px;
    }
}

/* ==================== 超小屏幕 Mobile 端（<480px）==================== */
@media (max-width: 480px) {
    .markets-top-visual-title {
        font-size: 28px;
    }
    
    .markets-list-title,
    .markets-contact-title {
        font-size: 24px;
    }
    
    .markets-top-visual,
    .markets-list-section,
    .markets-contact-section {
        padding: 50px 0;
    }
}
