/**
 * 粤语学习平台首页样式
 */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.home-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 顶部导航栏 */
.top-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 设置按钮特殊样式 */
.nav-link[href*="settings"] {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.nav-link[href*="settings"]:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-link[href*="settings"]:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 设置按钮的闪烁提示效果 */
.nav-link[href*="settings"]::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ffd700, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 400% 400%;
    border-radius: 14px;
    z-index: -1;
    animation: settingsGlow 3s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes settingsGlow {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.7;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.9;
    }
}

/* 其他导航链接的默认样式 */
.nav-link:not([href*="settings"]) {
    color: #64748b;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link:not([href*="settings"]):hover {
    color: #2d3748;
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-icon {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

.nav-text {
    font-weight: 500;
    white-space: nowrap;
}

.app-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.app-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

/* 主容器 */
.main-container {
    width: 90%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 欢迎区域 */
.hero-section {
    text-align: center;
    padding: 4rem 0;
    color: white;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    opacity: 0.9;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fbbf24;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
}

/* 区域标题 */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.section-header h3 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* 学习模块区域 */
.modules-section {
    padding: 3rem 0;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.module-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.module-card[data-module="tones"]:hover::before {
    background: linear-gradient(135deg, #e74c3c, #f39c12);
}

.module-card[data-module="pronunciation"]:hover::before {
    background: linear-gradient(135deg, #3498db, #9b59b6);
}

.module-card[data-module="jyutping"]:hover::before {
    background: linear-gradient(135deg, #27ae60, #f1c40f);
}

.module-card[data-module="chat"]:hover::before {
    background: linear-gradient(135deg, #e67e22, #f39c12);
}

.module-card[data-module="follow-reading"]:hover::before {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.module-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    display: block;
}

.module-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.4rem;
}

.module-description {
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.module-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.feature-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}


.module-action {
    margin-top: 0.8rem;
}

.module-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.module-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.module-btn:hover .btn-icon {
    transform: translateX(3px);
}

/* 学习建议区域 */
.suggestions-section {
    padding: 4rem 0;
}

.learning-path {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.path-step {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    min-width: 200px;
    transition: all 0.3s ease;
}

.path-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-content h4 {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: #64748b;
    font-size: 0.9rem;
}

.path-arrow {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: bold;
}

/* 特色功能区域 */
.features-section {
    padding: 4rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-item h4 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: #64748b;
    line-height: 1.6;
}

/* 页脚 */
.footer {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .navbar-content {
        padding: 0 1rem;
    }
    
    .navbar-right {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-icon {
        font-size: 1.2rem;
    }
    
    /* 设置按钮在移动端的调整 */
    .nav-link[href*="settings"] {
        padding: 0.7rem;
        border-radius: 50%;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
    
    .nav-link[href*="settings"]::before {
        border-radius: 50%;
    }
    
    .main-container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .module-card {
        padding: 1.5rem;
    }
    
    .learning-path {
        flex-direction: column;
        gap: 1rem;
    }
    
    .path-arrow {
        transform: rotate(90deg);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .section-header h3 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modules-section,
    .suggestions-section,
    .features-section {
        padding: 2rem 0;
    }
}

/* 特色模块样式 */
.module-card.featured {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.module-card.featured::before {
    content: '🌟 推荐';
    position: absolute;
    top: 10px;
    right: -25px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #333;
    padding: 4px 30px;
    font-size: 0.75rem;
    font-weight: 600;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.module-card.featured:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.2);
}

.module-btn.primary {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
    font-weight: 600;
}

.module-btn.primary:hover {
    background: linear-gradient(135deg, #FFA500, #FF8C00);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 165, 0, 0.4);
}

.module-card.featured .module-title {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.module-card.featured .module-description {
    color: #f0f9ff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .module-card.featured::before {
        font-size: 0.7rem;
        padding: 3px 25px;
        right: -20px;
    }
}


/* 登录按钮样式 */
.login-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-name {
    color: #2d3748;
    font-weight: 500;
    padding: 0.5rem;
}

.logout-btn {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

.logout-btn:hover {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

/* 登录弹窗样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: #2d3748;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: #2d3748;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .form-group.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-text {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: normal;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #475569;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.form-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    min-height: 1.25rem;
}

.submit-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .login-btn {
        padding: 0.7rem;
        border-radius: 50%;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }
    
    .user-name {
        display: none;
    }
}


/* 粤调通APP下载卡片样式 */
.module-card.app-download {
    background: aliceblue;
    border: 2px solid rgba(102, 126, 234, 0.3);
}

.module-card.app-download:hover {
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
}

.module-card.app-download::before {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.module-card.app-download .module-title {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.module-btn.app-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.module-btn.app-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}
