/* Token钱包APP - 响应式样式文件 */

/* ===== 基础响应式设置 ===== */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    /* 头部导航响应式 */
    .main-nav {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: white;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        display: none;
        flex-direction: column;
        z-index: 999;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 15px;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    /* 英雄区域响应式 */
    .hero-section .container {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-cta {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .app-stats {
        justify-content: center;
        gap: 30px;
    }
    
    /* 下载区域响应式 */
    .download-options {
        flex-direction: column;
        gap: 40px;
    }
    
    /* 页脚响应式 */
    .footer-content {
        flex-direction: column;
        gap: 40px;
    }
    
    .footer-links {
        width: 100%;
        justify-content: space-between;
    }
    
    /* 关于我们页面响应式 */
    .mission-content {
        flex-direction: column;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .milestone {
        flex-direction: row !important;
    }
    
    .milestone-year {
        width: 100px;
        height: 100px;
        font-size: 1.5rem;
    }
    
    .milestone-content {
        margin-left: 80px;
        margin-right: 0;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* 新闻详情页响应式 */
    .article-header,
    .article-content {
        padding: 40px;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .article-image {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
        padding: 0 15px;
    }
    
    /* 通用样式调整 */
    .section-header h2,
    .download-content h2,
    .cta-section h2 {
        font-size: 2rem;
    }
    
    /* 特性网格响应式 */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* 统计数字响应式 */
    .hero-stats {
        flex-direction: column;
        gap: 30px;
    }
    
    .hero-stats .number {
        font-size: 2.2rem;
    }
    
    /* 页脚链接响应式 */
    .footer-links {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-column {
        width: 100%;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    /* 下载页面响应式 */
    .download-platforms {
        grid-template-columns: 1fr;
    }
    
    .guide-steps {
        grid-template-columns: 1fr;
    }
    
    /* 去中心化页面响应式 */
    .dapp-categories {
        grid-template-columns: 1fr;
    }
    
    .security-features {
        grid-template-columns: 1fr;
    }
    
    /* 新闻中心页面响应式 */
    .news-grid,
    .industry-articles {
        grid-template-columns: 1fr;
    }
    
    .tutorial-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        width: 100%;
    }
    
    .news-categories {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* 关于我们页面响应式 */
    .mission-stats {
        grid-template-columns: 1fr;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .milestone {
        flex-direction: column !important;
        text-align: center;
    }
    
    .milestone-year {
        margin-bottom: 20px;
    }
    
    .milestone-content {
        margin: 0;
    }
    
    .timeline::before {
        display: none;
    }
    
    /* 新闻详情页响应式 */
    .news-detail-page {
        padding: 40px 0 60px;
    }
    
    .article-header,
    .article-content,
    .article-footer {
        padding: 30px 25px;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-excerpt {
        font-size: 1.1rem;
    }
    
    .article-image {
        height: 250px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .article-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-box {
        padding: 30px 20px;
    }
    
    .cta-box h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 12px;
    }
    
    /* 按钮响应式 */
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .btn-large {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    /* 英雄区域响应式 */
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-cta .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* 特性卡片响应式 */
    .feature-card {
        padding: 25px 20px;
    }
    
    /* 页头响应式 */
    .main-header {
        padding: 12px 0;
    }
    
    .logo-container img {
        height: 40px;
    }
    
    /* 下载按钮响应式 */
    .download-buttons {
        width: 100%;
    }
    
    .btn-appstore,
    .btn-googleplay {
        width: 100%;
        justify-content: center;
    }
    
    /* 新闻卡片响应式 */
    .news-card,
    .article-card,
    .tutorial-card,
    .value-card,
    .team-member {
        padding: 25px 20px;
    }
    
    /* 公告响应式 */
    .announcement-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .announcement-header .date {
        margin-left: 0;
    }
    
    /* 订阅框响应式 */
    .newsletter-box {
        padding: 40px 20px;
    }
    
    /* 关于我们页响应式 */
    .contact-form {
        padding: 30px 20px;
    }
    
    .mission-stats .stat {
        padding: 20px;
    }
    
    .mission-stats .number {
        font-size: 2rem;
    }
    
    /* 新闻详情页响应式 */
    .article-header,
    .article-content {
        padding: 25px 20px;
    }
    
    .article-title {
        font-size: 1.6rem;
    }
    
    .article-image {
        height: 200px;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.2rem;
    }
    
    .feature-highlight,
    .update-tips,
    .cta-box {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕设备优化 */
    .hero-section {
        padding: 60px 0;
    }
    
    .features-section,
    .download-cta-section {
        padding: 60px 0;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    /* 统计数字优化 */
    .stat-item {
        min-width: 120px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* 二维码优化 */
    .qr-code img {
        width: 120px;
        height: 120px;
    }
    
    .qr-code-small img {
        width: 100px;
        height: 100px;
    }
    
    /* 面包屑导航优化 */
    .breadcrumb ol {
        font-size: 0.9rem;
    }
    
    /* 表单元素优化 */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 0.95rem;
    }
}

/* ===== 触摸设备优化 ===== */
@media (hover: none) and (pointer: coarse) {
    /* 移除悬停效果，优化触摸体验 */
    .btn:hover,
    .feature-card:hover,
    .news-card:hover,
    .tutorial-card:hover,
    .value-card:hover,
    .team-member:hover,
    .related-card:hover,
    .platform-card:hover {
        transform: none;
    }
    
    /* 增加点击区域 */
    .btn,
    .category-btn,
    .read-more,
    .tutorial-link,
    .tag,
    .share-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 链接触摸优化 */
    a,
    button {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* 输入框优化 */
    input,
    select,
    textarea {
        font-size: 16px !important; /* 防止iOS缩放 */
    }
}

/* ===== 打印样式 ===== */
@media print {
    .main-header,
    .main-footer,
    .news-categories,
    .category-btn,
    .newsletter-section,
    .share-buttons,
    .mobile-menu-btn {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000 !important;
        background: #fff !important;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    .article-content {
        padding: 0 !important;
    }
    
    .news-article {
        box-shadow: none !important;
        border: none !important;
    }
}

/* ===== 高对比度模式支持 ===== */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0056b3;
        --primary-dark: #003d82;
        --text-primary: #000000;
        --text-secondary: #333333;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .feature-card,
    .news-card,
    .article-card,
    .tutorial-card {
        border: 1px solid var(--text-primary);
    }
}

/* ===== 减少动画偏好 ===== */
@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;
    }
    
    .feature-card,
    .news-card,
    .tutorial-card,
    .value-card,
    .team-member,
    .related-card,
    .platform-card {
        transition: none !important;
    }
}

/* ===== 暗色模式支持 ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --text-light: #999999;
        --bg-white: #1a1a1a;
        --bg-light: #2d2d2d;
        --border-color: #404040;
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    }
    
    body {
        background-color: var(--bg-white);
        color: var(--text-primary);
    }
    
    .main-header {
        background-color: rgba(26, 26, 26, 0.95);
    }
    
    .hero-section {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .feature-card,
    .news-card,
    .article-card,
    .tutorial-card,
    .value-card,
    .team-member,
    .platform-card,
    .announcement-item,
    .related-card,
    .news-article {
        background: var(--bg-light);
    }
    
    .main-nav a {
        color: var(--text-primary);
    }
    
    .btn-secondary {
        border-color: var(--primary-color);
        color: var(--primary-color);
    }
    
    .btn-secondary:hover {
        background-color: var(--primary-color);
        color: white;
    }
    
    .qr-code {
        background: white;
    }
    
    .main-footer {
        background-color: #0a0a0a;
    }
    
    .footer-column a {
        color: var(--text-secondary);
    }
    
    .footer-column a:hover {
        color: white;
    }
    
    .footer-social a {
        background: #404040;
    }
    
    .newsletter-box {
        background: var(--bg-light);
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: var(--bg-white);
        color: var(--text-primary);
        border-color: var(--border-color);
    }
    
    .feature-highlight {
        background: linear-gradient(135deg, #2d1a2d, #1a2d2d);
    }
    
    .update-tips {
        background: linear-gradient(135deg, #1a2d3a, #2d1a2d);
    }
}

/* ===== 方向特定样式 ===== */
@media (orientation: portrait) {
    /* 竖屏优化 */
    .hero-section .container {
        flex-direction: column;
    }
    
    .hero-image {
        order: -1;
        margin-bottom: 30px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    /* 横屏且高度较小设备优化 */
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .hero-cta {
        margin-bottom: 20px;
    }
    
    .app-stats {
        margin-top: 20px;
    }
}

/* ===== 超大屏幕优化 ===== */
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tutorial-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== 性能优化 ===== */
/* 为滚动容器添加硬件加速 */
.scroll-container {
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
}

/* 优化图片加载 */
img {
    max-width: 100%;
    height: auto;
    content-visibility: auto;
}

/* 优化字体渲染 */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== 实用类 ===== */
/* 隐藏元素类 */
.hidden-mobile {
    display: none;
}

.hidden-desktop {
    display: block;
}

@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }
    
    .hidden-desktop {
        display: none;
    }
}

/* 文本截断 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 多行文本截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 加载动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s ease forwards;
}

/* 延迟动画类 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* 新闻中心页面新增样式 */
.read-more-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
    padding: 0;
    transition: var(--transition);
}

.read-more-btn:hover {
    text-decoration: underline;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px 20px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 新闻卡片链接样式 */
.news-content h3 a,
.article-content h3 a,
.tutorial-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.news-content h3 a:hover,
.article-content h3 a:hover,
.tutorial-card h3 a:hover {
    color: var(--primary-color);
}

.tutorial-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.tutorial-link:hover {
    gap: 8px;
    color: var(--primary-dark);
}

/* 触摸设备新闻卡片优化 */
@media (hover: none) and (pointer: coarse) {
    .news-card,
    .article-card,
    .tutorial-card,
    .related-card {
        min-height: 120px;
    }
    
    .read-more,
    .tutorial-link {
        padding: 12px 20px;
        margin-top: 15px;
        display: inline-block;
    }
}

/* 性能优化：降低低性能设备动画复杂度 */
@media (prefers-reduced-motion: reduce) {
    .hero-image img,
    .article-image img,
    .related-image img {
        animation: none;
    }
    
    .feature-card,
    .news-card,
    .article-card,
    .tutorial-card {
        transition: none;
    }
}

/* 针对折叠屏设备的特殊优化 */
@media (max-width: 540px) and (max-height: 720px) {
    .hero-section {
        padding: 40px 0;
    }
    
    .features-section,
    .download-cta-section {
        padding: 50px 0;
    }
    
    .news-detail-page {
        padding: 30px 0 50px;
    }
}

/* 优化iOS Safari的滚动效果 */
@supports (-webkit-touch-callout: none) {
    .main-header {
        position: -webkit-sticky;
    }
    
    .main-footer {
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
    }
}

/* 边缘到边缘显示优化（iPhone X及更新设备） */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .main-footer {
        padding-bottom: max(30px, env(safe-area-inset-bottom));
    }
}

/* 优化Windows高DPI屏幕 */
@media (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* IE兼容性优化 */
    .features-grid {
        display: flex;
        flex-wrap: wrap;
    }
    
    .feature-card {
        flex: 1 1 250px;
        margin: 15px;
    }
}

/* 强制Webkit浏览器使用硬件加速 */
.force-gpu {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 优化字体在不同设备上的显示 */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 优化图片加载性能 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* 优化长列表性能 */
.news-grid,
.tutorial-grid,
.related-grid {
    will-change: transform;
}

/* 优化动画性能 */
.animate {
    will-change: transform, opacity;
}

/* 优化滚动条样式 */
@media (min-width: 768px) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
    
    ::-webkit-scrollbar-track {
        background: var(--bg-light);
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 5px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary-dark);
    }
}

/* 优化焦点状态（无障碍访问） */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* 优化触摸反馈 */
.touch-feedback:active {
    opacity: 0.7;
    transform: scale(0.98);
}

/* 优化可点击元素的触摸反馈 */
a,
button,
input[type="submit"],
input[type="button"] {
    -webkit-tap-highlight-color: transparent;
}

/* 优化长按菜单 */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

input,
textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* 优化Safari上的100vh问题 */
.min-h-screen-safari {
    min-height: -webkit-fill-available;
}

/* 优化Android上的点击延迟 */
a,
button,
input,
textarea {
    touch-action: manipulation;
}

/* 优化文本选择样式 */
::selection {
    background-color: var(--primary-color);
    color: white;
}

/* 优化打印链接 */
@media print {
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
        font-weight: normal;
    }
    
    .no-print {
        display: none;
    }
}

/* 优化夜间模式阅读体验 */
@media (prefers-color-scheme: dark) {
    ::selection {
        background-color: var(--primary-color);
        color: var(--text-primary);
    }
}