/* 响应式布局样式 - 个人投资理财网站 v20241126v3 */

/* 移动端优先的响应式设计 */

/* 平板和以下设备 (max-width: 1300px) */
@media screen and (max-width: 1300px) {
    .width1004,
    .indexcontent {
        min-width: 100%;
        width: 100%;
        max-width: 1300px;
        padding: 0 20px;
        box-sizing: border-box;
    }
    
    .width1200,
    .indexcontent2 {
        min-width: 100%;
        width: 100%;
        max-width: 1200px;
        padding: 0 20px;
        box-sizing: border-box;
    }
}

/* 平板设备 (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    /* 头部优化 */
    .site-header {
        position: relative;
    }
    
    .header-container {
        flex-direction: column;
        padding: 10px 20px;
    }
    
    .main-nav {
        width: 100%;
        margin-top: 10px;
    }
    
    .nav-list {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-item {
        margin: 5px 10px;
    }
    
    /* 搜索框优化 */
    .search-container {
        width: 100%;
        margin-top: 10px;
    }
    
    .search-form {
        width: 100%;
    }
    
    /* 轮播图优化 */
    #banner {
        height: auto;
    }
    
    .fullSlide {
        height: 300px;
    }
    
    .fullSlide .bd ul li {
        height: 300px;
    }
    
    /* 金融数据展示优化 */
    .finance-data-widget {
        padding: 20px;
    }
    
    .finance-stat {
        flex: 0 0 48%;
        margin: 5px 1%;
    }
}

/* 手机设备 (max-width: 768px) */
@media screen and (max-width: 768px) {
    /* 顶部导航栏改为汉堡菜单 */
    .header-top {
        padding: 10px 0;
    }
    
    .header-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
    }
    
    .logo-area {
        flex-shrink: 0;
    }
    
    .logo-area img,
    .site-logo {
        max-height: 40px;
        height: auto;
        width: auto;
    }
    
    /* 修复圆圈样式问题 */
    .logo-area a {
        display: block;
        line-height: 1;
    }
    
    /* 确保logo不被压缩成圆形 */
    .site-logo {
        object-fit: contain;
        border-radius: 0 !important;
    }
    
    /* 主导航菜单移动端样式 */
    .main-nav {
        position: relative;
    }
    
    /* 添加汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 15px;
        width: 30px;
        height: 30px;
        cursor: pointer;
        z-index: 1001;
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: #1a365d;
        margin: 6px 0;
        transition: 0.3s;
    }
    
    /* 导航菜单默认隐藏 */
    .nav-list {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 20px;
        z-index: 1000;
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .nav-item {
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
    
    .nav-dropdown {
        position: relative;
        top: 0;
        width: 100%;
        box-shadow: none;
        background-color: #f8f9fa;
        margin-top: 10px;
    }
    
    /* 轮播图进一步优化 */
    .fullSlide {
        height: 200px;
    }
    
    .fullSlide .bd ul li {
        height: 200px;
    }
    
    .fullSlide .prev,
    .fullSlide .next {
        width: 30px;
    }
    
    .fullSlide .prev img,
    .fullSlide .next img {
        width: 20px;
    }
    
    /* 金融数据卡片 */
    .finance-stat {
        flex: 0 0 100%;
        margin: 10px 0;
        padding: 15px;
    }
    
    .finance-stat-number {
        font-size: 24px;
    }
    
    /* 产品导航 */
    .i_p_nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
    }
    
    .i_p_nav li {
        flex: 0 0 48%;
        margin: 5px 1%;
    }
    
    /* 金融专题卡片 */
    .topics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
    }
    
    .topic-card {
        padding: 20px;
    }
    
    /* 服务列表 */
    .i_p2_list1 li,
    .i_p2_list2 li {
        width: 100%;
        margin: 10px 0;
    }
    
    /* 新闻列表 */
    .i_news_list li {
        width: 100%;
        margin: 10px 0;
    }
    
    .i_news_list li .fd {
        width: 100%;
        height: 180px;
    }
    
    .i_news_list li .fd img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* 底部优化 */
    .footer-navigation {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .footer-contact {
        flex-direction: column;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .qr-code {
        margin-top: 20px;
    }
    
    /* 登录注册模态框 */
    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
    
    /* 用户区域 */
    .user-area {
        margin-top: 10px;
    }
    
    .header-btn {
        padding: 5px 10px;
        font-size: 14px;
    }
    
    /* 首页轮播图移动端优化 */
    #banner {
        margin: 0;
        padding: 0 15px;
    }
    
    .width1004 {
        width: 100%;
        min-width: auto;
        padding: 0;
    }
    
    /* 首页内容区域 */
    .indexcontent {
        width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }
    
    /* 金融数据展示移动端 */
    .finance-data-widget {
        margin: 20px 0;
        padding: 15px;
        border-radius: 8px;
    }
    
    .finance-data-widget h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    /* 产品导航移动端 */
    .i_p_nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin: 20px 0;
    }
    
    .i_p_nav li {
        width: 100%;
        margin: 0;
    }
    
    .i_p_nav li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 15px 10px;
        text-align: center;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        text-decoration: none;
        color: inherit;
        transition: all 0.3s ease;
    }
    
    .i_p_nav li a:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .i_p_nav .ico {
        margin-bottom: 8px;
    }
    
    .i_p_nav .txt {
        font-size: 14px;
        line-height: 1.3;
    }
    
    /* 金融专题区域移动端 */
    .finance-topics-section {
        margin: 30px 0;
        padding: 0;
    }
    
    .section-header {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .section-subtitle {
        font-size: 12px;
        color: #666;
    }
    
    .topics-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .topic-card {
        padding: 20px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        text-align: center;
    }
    
    .topic-icon {
        font-size: 32px;
        margin-bottom: 12px;
    }
    
    .topic-card h4 {
        font-size: 16px;
        margin-bottom: 8px;
        color: #1a365d;
    }
    
    .topic-card p {
        font-size: 13px;
        line-height: 1.4;
        color: #666;
        margin-bottom: 15px;
    }
    
    .topic-stats {
        display: flex;
        justify-content: center;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .topic-stats span {
        font-size: 11px;
        color: #999;
    }
    
    .topic-button {
        display: inline-block;
        padding: 8px 20px;
        background: linear-gradient(135deg, #1a365d, #2d5a87);
        color: white;
        text-decoration: none;
        border-radius: 20px;
        font-size: 13px;
        transition: all 0.3s ease;
    }
    
    .topic-button:hover {
        background: linear-gradient(135deg, #2d5a87, #1a365d);
        transform: translateY(-1px);
    }
    
    /* 服务介绍区域移动端 */
    .i_fw {
        margin: 30px 0;
        padding: 20px 0;
        background: #f8f9fa;
        border-radius: 12px;
    }
    
    .i_fw .title1 {
        font-size: 20px;
        text-align: center;
        margin-bottom: 10px;
        color: #1a365d;
    }
    
    .i_fw .title2 {
        text-align: center;
        padding: 0 20px;
        margin-bottom: 25px;
    }
    
    .i_fw .title2 p {
        font-size: 14px;
        line-height: 1.5;
        color: #666;
    }
    
    .i_fw_list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px;
    }
    
    .i_fw_list li {
        display: flex;
        align-items: center;
        padding: 15px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .i_fw_list .ico_c {
        margin-right: 15px;
        margin-bottom: 0;
    }
    
    .i_fw_list .txt {
        font-size: 14px;
        color: #333;
    }
    
    /* 新闻资讯区域移动端 */
    .i_news_c {
        margin: 20px 0;
    }
    
    .i_news_list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .i_news_list li {
        background: white;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .i_news_list li .fd {
        width: 100%;
        height: 180px;
        overflow: hidden;
    }
    
    .i_news_list li .fd img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .i_news_list li .txt1,
    .i_news_list li .txt2,
    .i_news_list li .txt3 {
        padding: 0 15px;
    }
    
    .i_news_list li .txt1 {
        padding-top: 15px;
        font-size: 14px;
        font-weight: bold;
        line-height: 1.4;
    }
    
    .i_news_list li .txt2 {
        font-size: 12px;
        color: #999;
        margin: 5px 0;
    }
    
    .i_news_list li .txt3 {
        font-size: 13px;
        color: #666;
        line-height: 1.4;
        padding-bottom: 15px;
    }
    
    .i_news_more {
        display: block;
        width: 200px;
        margin: 20px auto;
        padding: 12px 24px;
        text-align: center;
        background: linear-gradient(135deg, #1a365d, #2d5a87);
        color: white;
        text-decoration: none;
        border-radius: 25px;
        font-size: 14px;
        transition: all 0.3s ease;
    }
    
    .i_news_more:hover {
        background: linear-gradient(135deg, #2d5a87, #1a365d);
        transform: translateY(-2px);
    }
}

/* 小屏幕手机 (max-width: 480px) */
@media screen and (max-width: 480px) {
    /* 标题文字大小调整 */
    h1, .title1 {
        font-size: 24px;
    }
    
    h2, .title2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    /* 导航优化 */
    .i_p_nav li {
        flex: 0 0 100%;
        margin: 5px 0;
    }
    
    /* 服务图标 */
    .i_fw_list li {
        width: 100%;
        margin: 10px 0;
        text-align: center;
    }
    
    /* 按钮优化 */
    .i_news_more,
    .topic-button,
    .auth-submit-btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }
    
    /* 表单优化 */
    .form-group input {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    /* 底部版权信息 */
    .footer-copyright {
        text-align: center;
        padding: 20px 10px;
    }
    
    .friend-links {
        text-align: center;
    }
    
    .friend-links a {
        display: inline-block;
        margin: 5px;
    }
}

/* 横屏优化 */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .fullSlide {
        height: 150px;
    }
    
    .fullSlide .bd ul li {
        height: 150px;
    }
    
    .clear[style*="height:80px"] {
        height: 40px !important;
    }
    
    .clear[style*="height:60px"] {
        height: 30px !important;
    }
    
    .clear[style*="height:45px"] {
        height: 25px !important;
    }
}

/* 打印样式 */
@media print {
    .site-header,
    .finance-footer,
    .user-area,
    .search-container,
    .modal {
        display: none;
    }
    
    .indexcontent {
        width: 100%;
        padding: 0;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大可点击区域 */
    .nav-link,
    .topic-button,
    .auth-submit-btn {
        padding: 12px 20px;
        min-height: 44px;
    }
    
    /* 移除hover效果 */
    .nav-item:hover .nav-dropdown {
        display: none;
    }
    
    /* 点击显示下拉菜单 */
    .nav-item.active .nav-dropdown {
        display: block;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* 优化图标显示 */
    .ico {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* 基金知识页面移动端优化 */
@media screen and (max-width: 768px) {
    /* 基金页面头部优化 */
    .fund-company-header {
        padding: 20px 0;
        min-height: auto;
    }
    
    .fund-header-content {
        text-align: center;
        padding: 0 15px;
    }
    
    .fund-credentials {
        flex-direction: column;
        gap: 15px;
    }
    
    .credential-item {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 15px;
        background: rgba(255,255,255,0.9);
        border-radius: 8px;
        margin: 0 10px;
    }
    
    .credential-icon {
        margin-right: 15px;
        margin-bottom: 0;
        font-size: 24px;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }
    
    .cta-btn {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* 知识布局移动端 */
    .knowledge-layout {
        flex-direction: column;
        gap: 0;
    }
    
    .fund-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 20px;
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .sidebar-brand h3 {
        font-size: 18px;
    }
    
    .course-search {
        margin-top: 10px;
    }
    
    .search-field {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 学习进度移动端 */
    .learning-overview {
        padding: 15px;
    }
    
    .progress-summary {
        flex-direction: row;
        align-items: center;
        gap: 20px;
    }
    
    .progress-circle {
        flex-shrink: 0;
        width: 60px;
        height: 60px;
    }
    
    .circle-progress {
        width: 60px;
        height: 60px;
    }
    
    .progress-percentage {
        font-size: 12px;
    }
    
    .progress-details {
        flex: 1;
        display: flex;
        justify-content: space-around;
    }
    
    /* 章节导航移动端 */
    .nav-chapters {
        max-height: 400px;
        overflow-y: auto;
    }
    
    .catalog-chapter {
        margin-bottom: 15px;
    }
    
    .chapter-header {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .chapter-contents {
        padding: 0;
    }
    
    .chapter-contents li {
        border-bottom: 1px solid #f3f4f6;
    }
    
    .content-link {
        display: block;
        padding: 12px 20px;
        font-size: 14px;
        line-height: 1.4;
    }
    
    /* 内容区域移动端 */
    .fund-content-area {
        width: 100%;
        padding: 15px;
    }
    
    .fund-welcome {
        padding: 20px 0;
    }
    
    .value-proposition h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .core-advantages {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }
    
    .advantage-item {
        padding: 15px;
        text-align: center;
    }
    
    .advantage-icon {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    /* 风险提示移动端 */
    .risk-disclaimer {
        margin: 20px 0;
        padding: 15px;
        border-radius: 8px;
    }
    
    .disclaimer-header {
        flex-direction: row;
        align-items: center;
        margin-bottom: 10px;
    }
    
    .warning-icon {
        margin-right: 10px;
        font-size: 20px;
    }
    
    .disclaimer-header h4 {
        font-size: 16px;
        margin: 0;
    }
    
    /* 学习建议移动端 */
    .learning-suggestions {
        margin: 20px 0;
    }
    
    .suggestion-list {
        gap: 15px;
    }
    
    .suggestion-item {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
    }
    
    .suggestion-number {
        flex-shrink: 0;
        margin-right: 15px;
        margin-bottom: 0;
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 14px;
    }
    
    .suggestion-content h5 {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .suggestion-content p {
        font-size: 13px;
        line-height: 1.4;
        margin: 0;
    }
    
    /* 课程内容页面移动端 */
    .lesson-header {
        padding: 15px 0;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 20px;
    }
    
    .back-btn {
        margin-bottom: 10px;
        padding: 8px 15px;
        font-size: 14px;
    }
    
    #lessonTitle {
        font-size: 18px;
        margin: 10px 0;
    }
    
    .lesson-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .lesson-meta span {
        font-size: 12px;
    }
    
    .lesson-body {
        padding: 0;
    }
    
    .lesson-navigation {
        flex-direction: column;
        gap: 10px;
        margin-top: 30px;
        padding: 20px 0;
        border-top: 1px solid #e5e7eb;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* 统计区域移动端 */
    .sidebar-stats {
        padding: 15px;
        border-top: 1px solid #e5e7eb;
        margin-top: 20px;
    }
    
    .mini-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .mini-stat {
        text-align: center;
        padding: 10px;
    }
    
    .mini-stat .number {
        font-size: 16px;
    }
    
    .mini-stat .label {
        font-size: 11px;
    }
}

@media screen and (max-width: 480px) {
    .fund-title {
        font-size: 20px;
        line-height: 1.3;
    }
    
    .fund-subtitle {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .credential-item {
        margin: 0 5px;
        padding: 12px;
    }
    
    .credential-text strong {
        font-size: 14px;
    }
    
    .credential-text p {
        font-size: 12px;
        margin: 2px 0 0 0;
    }
    
    .content-link {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .chapter-header h4 {
        font-size: 14px;
    }
    
    .chapter-number {
        font-size: 11px;
    }
    
    .chapter-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    /* 可选：为支持深色模式的设备提供深色主题 */
    body {
        /* 深色模式样式可根据需要添加 */
    }
}
