/**
 * 移动端深度优化样式 V3
 * 
 * 设计原则：
 * 1. 内容精简 - 移动端删减冗余区块，减少屏数
 * 2. 首屏重设计 - 严格把关首屏视觉，重新排版
 * 3. 触摸友好 - 按钮最小44px，间距合理
 * 4. 视觉统一 - 橙红渐变品牌色贯穿
 */

/* ============================================
   全局移动端基础
   ============================================ */

/* 桌面端隐藏移动端工具入口 */
.nav-tools-mobile {
    display: none;
}

@media (max-width: 768px) {
    
    .container {
        padding-left: 16px;
        padding-right: 16px;
        max-width: 100%;
    }
    
    body {
        font-size: 15px;
        line-height: 1.6;
        -webkit-font-smoothing: antialiased;
        overscroll-behavior-y: contain;
    }
    
    a {
        -webkit-tap-highlight-color: rgba(243, 162, 51, 0.1);
        touch-action: manipulation;
    }
    
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    /* ============================================
       导航栏
       ============================================ */
    
    .navbar {
        height: 56px;
        padding: 0 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    }
    
    .navbar .container {
        height: 100%;
        padding: 0;
        max-width: 100%;
    }
    
    .logo {
        gap: 8px;
        padding: 6px 0;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        border-radius: 7px;
    }
    
    .logo-text {
        font-size: 15px;
        letter-spacing: 0.3px;
    }
    
    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 4px;
        border-radius: 8px;
    }
    
    .mobile-menu-toggle span {
        width: 18px;
        height: 2px;
        margin: 2px 0;
    }
    
    /* 移动菜单面板 */
    .nav-links.active {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        background: white;
        padding: 12px 16px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        animation: slideDown 0.25s ease;
        z-index: 1000;
    }
    
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    .nav-links li { margin: 0; }
    
    .nav-links a {
        display: flex;
        align-items: center;
        padding: 14px 16px;
        font-size: 16px;
        color: #1a1a2e;
        border-radius: 12px;
        min-height: 48px;
    }
    
    .nav-links a:active {
        background: linear-gradient(135deg, #f3a233 0%, #e63946 100%);
        color: white;
    }
    
    .nav-links a.active {
        background: rgba(243, 162, 51, 0.1);
        color: #f3a233;
        font-weight: 600;
    }
    
    /* 导航按钮 - 移动端已移至 nav-links，整个 nav-actions 隐藏 */
    .nav-actions,
    .nav-actions.active {
        display: none;
    }

    /* 移动端：显示导航菜单中的工具入口 */
    .nav-tools-mobile {
        display: list-item;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }

    /* 登录/注册 与 工具按钮并排 */
    .nav-mobile-actions {
        display: flex;
        gap: 12px;
        align-items: flex-start;
    }

    .nav-mobile-actions .btn {
        flex: 1;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-mobile-actions .dropdown {
        flex: 1;
    }

    .nav-mobile-actions .dropdown-menu {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 12px;
        padding: 8px 0;
        margin-top: 8px;
        background: #f8f9fa;
        min-width: auto;
        width: 100%;
    }

    .nav-mobile-actions .dropdown.active .dropdown-menu {
        display: block;
    }

    .nav-mobile-actions .dropdown-item {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 48px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    }

    .nav-mobile-actions .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .nav-actions .btn {
        flex: 1;
        min-height: 48px;
        padding: 12px 20px;
        font-size: 16px;
        border-radius: 12px;
    }
    
    /* 工具下拉菜单 - 向上弹出，确保在可视可点击范围内 */
    .nav-actions .dropdown {
        position: static;
    }
    
    .nav-actions .dropdown-menu {
        position: absolute;
        bottom: calc(100% + 8px);
        left: 16px;
        right: 16px;
        min-width: auto;
        width: auto;
        background: white;
        border-radius: 12px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        border: 1px solid var(--border, #e0e0e0);
        padding: 8px 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1100;
    }
    
    .nav-actions .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-actions .dropdown-item {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 48px;
        border-bottom: 1px solid var(--border, #e0e0e0);
    }
    
    .nav-actions .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .nav-actions .dropdown-item:active {
        background: linear-gradient(135deg, #f3a233 0%, #e63946 100%);
        color: white;
    }
    
    .nav-overlay.active {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        z-index: 999;
        animation: fadeIn 0.25s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* ============================================
       Hero首屏 - 深度重设计
       ============================================ */
    
    .hero {
        min-height: calc(100vh - 56px);
        max-height: none;
        padding: 40px 16px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        position: relative;
        overflow: hidden;
    }
    
    .hero::before {
        background-size: cover;
        background-position: center;
        opacity: 0.06;
    }
    
    .hero .container {
        padding: 0;
        max-width: 100%;
        height: auto;
    }
    
    .hero-content {
        text-align: left;
        max-width: 100%;
        padding: 0;
    }
    
    /* 徽章 - 与桌面端统一：半透明白色 */
    .hero-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 16px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 50px;
        font-size: 13px;
        color: rgba(255, 255, 255, 0.9);
        margin-bottom: 24px;
        backdrop-filter: blur(10px);
    }
    
    .hero-badge .dot {
        width: 6px;
        height: 6px;
        background: #4ade80;
        border-radius: 50%;
        animation: pulse 2s infinite;
    }
    
    @keyframes pulse {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.5; transform: scale(1.3); }
    }
    
    /* 主标题 - 与桌面端统一：白色 */
    .hero h1 {
        font-size: 34px;
        line-height: 1.22;
        margin-bottom: 16px;
        letter-spacing: -0.5px;
        color: #ffffff;
        font-weight: 800;
    }
    
    .hero h1 span {
        display: inline;
        background: linear-gradient(135deg, #f3a233 0%, #e63946 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    /* 德语slogan - 与桌面端统一：半透明白色 */
    .hero-subtitle {
        font-size: 15px;
        line-height: 1.5;
        color: rgba(255, 255, 255, 0.7);
        margin-bottom: 24px;
        font-style: italic;
        letter-spacing: 0.5px;
    }
    
    /* 描述 - 与桌面端统一：半透明白色 */
    .hero-description {
        display: block;
        font-size: 15px;
        line-height: 1.6;
        color: rgba(255, 255, 255, 0.6);
        margin-bottom: 28px;
        padding: 0;
        max-width: 320px;
    }
    
    /* 按钮组 - 横向排列，更紧凑 */
    .hero-buttons {
        display: flex;
        flex-direction: row;
        gap: 10px;
        margin-bottom: 0;
        padding: 0;
    }
    
    /* 联系方式锚点偏移，避开固定导航栏 */
    #contact {
        scroll-margin-top: 70px;
    }
    
    .hero-buttons .btn {
        flex: 1;
        min-height: 46px;
        padding: 12px 16px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 12px;
    }
    
    .hero-buttons .btn-primary {
        background: linear-gradient(135deg, #f3a233 0%, #e63946 100%);
        box-shadow: 0 4px 16px rgba(243, 162, 51, 0.25);
    }
    
    .hero-buttons .btn-outline-light {
        background: white;
        color: #1a1a2e;
        border: 1.5px solid #e0e0e0;
    }
    
    .hero-buttons .btn:active {
        transform: scale(0.97);
    }
    
    /* 统计数据 - 紧凑横排，与桌面端统一：白色文字 */
    .hero-stats {
        display: flex;
        justify-content: flex-start;
        gap: 28px;
        padding: 20px 24px;
        margin-top: 36px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(20px);
        border-radius: 16px;
    }
    
    .hero-stats .stat-item {
        text-align: left;
    }
    
    .hero-stats .stat-number {
        display: block;
        font-size: 22px;
        font-weight: 700;
        color: #ffffff;
        margin-bottom: 3px;
    }
    
    .hero-stats .stat-label {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.6);
    }
    
    /* 隐藏右侧卡片 */
    .hero-image {
        display: none;
    }
    
    /* ============================================
       首页内容区精简 - 移动端隐藏次要区块
       ============================================ */
    
    /* 课程体系 - 紧凑磁贴 */
    .course-system {
        padding: 36px 0;
    }
    
    .course-system-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .course-system-card {
        padding: 14px 12px;
        border-radius: 14px;
    }
    
    .course-system-header {
        margin-bottom: 6px;
        gap: 10px;
    }
    
    .course-system-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
        border-radius: 10px;
    }
    
    .course-system-card h3 {
        font-size: 14px;
        margin-bottom: 0;
    }
    
    /* 副标题精简为单行 */
    .card-subtitle {
        font-size: 11px;
        line-height: 1.35;
        margin-bottom: 0;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* 标签列表在移动端改为点击触发（隐藏） */
    .course-tags {
        display: none;
    }
    
    /* 了解详情更紧凑 */
    .course-system-link {
        font-size: 11px;
        margin-top: 6px;
        display: inline-flex;
        align-items: center;
    }
    
    /* 学习路径 - 精简为 2×3 磁贴网格 */
    .learning-path {
        padding: 36px 0;
    }
    
    .path-steps {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0;
        overflow: visible;
    }
    
    .path-step {
        padding: 14px 12px;
        border-radius: 14px;
        text-align: left;
        min-height: 92px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    .path-badge {
        width: 36px;
        height: 36px;
        font-size: 13px;
        margin: 0 0 8px 0;
    }
    
    .path-step .step-content h4 {
        font-size: 13px;
        margin-bottom: 2px;
    }
    
    .path-step .step-content p {
        font-size: 11px;
        line-height: 1.3;
    }
    
    /* 全部课程磁贴 - 白灰底黑字，与阶段磁贴尺寸一致 */
    .path-step-all-courses {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        text-decoration: none;
        color: #1a1a2e;
        vertical-align: top;
        background: #f5f5f5;
        border: 1px solid #e0e0e0;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    }
    
    .path-step-all-courses:active {
        transform: scale(0.97);
    }
    
    /* 禁用顶部色条 */
    .path-step-all-courses::before {
        display: none;
    }
    
    .path-step-all-courses .path-badge {
        background: #1a1a2e;
        backdrop-filter: none;
        color: #ffffff;
    }
    
    .path-step-all-courses .step-content h4 {
        color: #1a1a2e;
    }
    
    .path-step-all-courses .step-content p {
        color: #636e72;
    }
    
    /* 弹出详情隐藏 */
    .level-detail-popup {
        display: none !important;
    }
    
    /* CTA区域 - 精简 */
    .cta-section {
        padding: 28px 16px;
        text-align: center;
    }
    
    .cta-content h2 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .cta-content p {
        font-size: 13px;
        margin-bottom: 16px;
    }
    
    .cta-content .btn-large {
        min-height: 44px;
        padding: 12px 28px;
        font-size: 15px;
    }
    
    /* 德国概况 - 精简为2列 */
    .germany-info {
        padding: 36px 0;
    }
    
    .info-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .info-card {
        padding: 16px 12px;
        border-radius: 14px;
        text-align: center;
    }
    
    .info-icon {
        font-size: 28px;
        margin-bottom: 6px;
    }
    
    .info-card h3 {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .info-card p {
        font-size: 12px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .link-arrow {
        font-size: 12px;
        margin-top: 8px;
    }
    
    /* 特色功能 - 移动端隐藏（内容重复，课程体系已覆盖） */
    .features {
        display: none;
    }
    
    /* 德国概况 - 移动端隐藏（减少屏数，内容在题库阅读中已有） */
    .germany-info {
        display: none;
    }
    
    /* 品牌展示 - 压缩高度 */
    .brand-showcase {
        padding: 16px;
        text-align: center;
    }
    
    .brand-horizontal-logo {
        max-width: 200px;
        margin: 0 auto;
    }
    
    /* ============================================
       通用按钮和卡片
       ============================================ */
    
    .btn {
        min-height: 44px;
        padding: 10px 18px;
        font-size: 15px;
        border-radius: 10px;
        touch-action: manipulation;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .btn-large {
        padding: 12px 24px;
        font-size: 16px;
        min-height: 46px;
    }
    
    .btn:active {
        transform: scale(0.97);
    }
    
    .card {
        border-radius: 14px;
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .course-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* ============================================
       登录/注册页
       ============================================ */
    
    .auth-container {
        min-height: calc(100vh - 56px);
        padding: 72px 16px 24px;
    }
    
    .auth-box {
        max-width: 100%;
        padding: 24px 20px;
        border-radius: 20px;
    }
    
    .auth-header .logo {
        width: 120px;
        height: 52px;
        margin-bottom: 16px;
    }
    
    .auth-header h2 {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .auth-header p {
        font-size: 13px;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-group input {
        height: 46px;
        padding: 10px 12px;
        font-size: 16px;
        border-radius: 10px;
        border: 1.5px solid #e0e0e0;
    }
    
    .form-group input:focus {
        border-color: #f3a233;
        box-shadow: 0 0 0 3px rgba(243, 162, 51, 0.1);
    }
    
    .slider-captcha-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 10px auto;
        border-radius: 10px;
    }
    
    .slider-thumb {
        width: 30px;
        height: 30px;
        border-radius: 6px;
        font-size: 16px;
        touch-action: none;
    }
    
    .slider-bar {
        height: 42px;
        font-size: 13px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .btn-block {
        width: 100%;
        height: 46px;
        font-size: 16px;
    }
    
    .auth-footer {
        margin-top: 16px;
        font-size: 13px;
    }
    
    /* ============================================
       区块标题
       ============================================ */
    
    /* 移动端隐藏标签，只留 h2 标题 */
    .section-label {
        display: none;
    }
    
    .section-title-wrapper {
        margin-bottom: 4px;
    }
    
    .section-title {
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .section-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .section-label {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    /* ============================================
       语法页面
       ============================================ */
    
    .grammar-hero {
        padding: 72px 16px 40px !important;
    }
    
    .grammar-hero h1 {
        font-size: 28px !important;
    }
    
    .grammar-hero p {
        font-size: 14px !important;
    }
    
    .grammar-hero .hero-stats {
        gap: 20px !important;
    }
    
    .grammar-hero .hero-stat strong {
        font-size: 20px !important;
    }
    
    .grammar-hero .hero-stat span {
        font-size: 12px !important;
    }
    
    /* 语法主题网格 - 2列 */
    .grammar-topics-grid,
    .topics-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        padding: 0 4px !important;
    }
    
    .topic-card,
    .grammar-card {
        padding: 14px 12px !important;
        border-radius: 12px !important;
    }
    
    .topic-card h3,
    .grammar-card h3 {
        font-size: 13px !important;
    }
    
    .topic-card p,
    .grammar-card p {
        font-size: 11px !important;
    }
    
    /* 语法专题详情页 */
    .grammar-article {
        padding: 20px 0 40px;
    }
    
    .article-header {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .article-header h1 {
        font-size: 24px !important;
    }
    
    .article-content {
        padding: 16px;
        font-size: 14px;
        line-height: 1.7;
    }
    
    .article-content h2 {
        font-size: 18px;
        margin-top: 20px;
        margin-bottom: 10px;
    }
    
    .article-content h3 {
        font-size: 16px;
    }
    
    .article-content table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .article-content pre,
    .article-content code {
        font-size: 13px;
    }
    
    .example-box,
    .grammar-example {
        padding: 12px;
        margin: 12px 0;
        border-radius: 10px;
        font-size: 13px;
    }
    
    /* ============================================
       题库页面
       ============================================ */
    
    .quiz-hero,
    .quiz-header {
        padding: 72px 16px 32px !important;
    }
    
    .quiz-hero h1,
    .quiz-header h1 {
        font-size: 26px !important;
    }
    
    /* 题库选择网格 */
    .quiz-grid,
    .level-cards {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    
    /* 答题区域 */
    .quiz-question,
    .question-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }
    
    .quiz-options,
    .options-list {
        gap: 8px !important;
    }
    
    .quiz-option,
    .option-btn {
        padding: 12px 14px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
        min-height: 44px;
    }
    
    /* ============================================
       听力页面
       ============================================ */
    
    .listening-hero {
        padding: 72px 16px 32px !important;
    }
    
    .listening-hero h1 {
        font-size: 26px !important;
    }
    
    .listening-grid,
    .audio-cards {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .audio-card,
    .listening-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }
    
    /* ============================================
       阅读页面
       ============================================ */
    
    .reading-content,
    .article-body {
        padding: 16px;
        font-size: 14px;
        line-height: 1.8;
    }
    
    .reading-content h1,
    .article-body h1 {
        font-size: 22px;
    }
    
    .reading-content h2,
    .article-body h2 {
        font-size: 18px;
    }
    
    /* ============================================
       课程页面
       ============================================ */
    
    .course-hero,
    .courses-hero {
        padding: 72px 16px 32px !important;
    }
    
    .course-hero h1,
    .courses-hero h1 {
        font-size: 26px !important;
    }
    
    /* ============================================
       页脚 - 融合为单一板块
       ============================================ */
    
    .footer {
        padding: 28px 16px 20px;
    }
    
    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    
    /* 移动端隐藏：品牌区、学习内容、学习资源、关于我们 */
    .footer-brand,
    .footer-section {
        display: none;
    }
    
    /* 联系方式 - 唯一板块 */
    .footer-contact {
        width: 100%;
        padding: 24px 20px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 16px;
        margin: 0;
        text-align: left;
    }
    
    .footer-contact h4 {
        font-size: 16px;
        margin-bottom: 18px;
        color: #ffffff;
        font-weight: 600;
        letter-spacing: 0.5px;
        text-align: center;
        padding-bottom: 14px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .contact-list {
        gap: 14px;
        align-items: flex-start;
    }
    
    .contact-row {
        justify-content: flex-start;
        font-size: 14px;
        width: 100%;
    }
    
    .contact-row-address {
        align-items: flex-start;
    }
    
    .contact-row-address .contact-value {
        line-height: 1.5;
        white-space: normal;
    }
    
    .contact-icon {
        font-size: 15px;
        width: 22px;
        flex-shrink: 0;
    }
    
    .contact-icon.wechat-icon {
        width: 18px;
        height: 18px;
    }
    
    .contact-label {
        font-size: 13px;
        min-width: 48px;
        color: rgba(255, 255, 255, 0.5);
    }
    
    .contact-value {
        font-size: 14px;
        flex: 1;
    }
    
    /* 网站logo行 */
    /* 移动端显示小程序和网站行（覆盖桌面端的 display: none） */
    .footer-contact .contact-extra {
        display: flex;
    }
    
    .contact-extra .brand-site-link {
        gap: 8px;
    }
    
    .contact-extra .brand-site-link .logo-icon {
        width: 24px;
        height: 24px;
        border-radius: 6px;
    }
    
    .contact-extra .brand-site-link .logo-text {
        font-size: 14px;
        color: rgba(255, 255, 255, 0.85);
    }
    
    .qr-hint {
        font-size: 10px;
        padding: 1px 5px;
    }
    
    /* 微信/小程序二维码 - 移动端点击居中弹出 */
    .wechat-trigger .qr-popup,
    .miniprogram-trigger .qr-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 16px;
        border-radius: 12px;
        z-index: 1100;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease;
        white-space: nowrap;
    }
    
    .wechat-trigger.active .qr-popup,
    .miniprogram-trigger.active .qr-popup {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    .wechat-trigger .qr-popup img,
    .miniprogram-trigger .qr-popup img {
        width: 180px;
        height: 180px;
    }
    
    .footer-bottom {
        padding-top: 20px;
        font-size: 12px;
        text-align: center;
    }
    
    /* ============================================
       滚动和触摸
       ============================================ */
    
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    ::-webkit-scrollbar {
        width: 3px;
        height: 3px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #dfe6e9;
        border-radius: 2px;
    }
    
    /* 动画性能 */
    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    .card, .btn, .nav-links a, .hero-badge {
        will-change: transform;
        transform: translateZ(0);
    }
}

/* ============================================
   超小屏幕（≤375px）
   ============================================ */

@media (max-width: 375px) {
    .hero h1 {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 13px;
    }
    
    .hero-description {
        font-size: 13px;
    }
    
    .hero-buttons .btn {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .hero-stats .stat-number {
        font-size: 18px;
    }
    
    /* 超小屏幕仍保持 2 列磁贴，保证信息密度 */
    .course-system-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .course-system-card {
        padding: 12px 10px;
    }
    
    .course-system-icon {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .course-system-card h3 {
        font-size: 13px;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
    
    .grammar-topics-grid,
    .topics-grid {
        grid-template-columns: 1fr !important;
    }
    
    .quiz-grid,
    .level-cards {
        grid-template-columns: 1fr !important;
    }
    
    .btn {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .auth-box {
        padding: 20px 16px;
    }
    
    /* 超小屏幕页脚：品牌logo 缩小 */
    .brand-main-logo {
        width: 140px;
    }
    
    .brand-mp-qr {
        width: 48px;
    }
    
    .contact-row {
        font-size: 12px;
    }
}

/* ============================================
   横屏优化
   ============================================ */

@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 40px 24px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero-buttons {
        flex-direction: row;
        max-width: 460px;
    }
    
    .hero-buttons .btn {
        flex: 1;
    }
}

/* ============================================
   平板优化（769px - 1024px）
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .hero h1 {
        font-size: 38px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .course-system-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .path-steps {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grammar-topics-grid,
    .topics-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .info-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}