* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: #050520;
    color: #f0f0f0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

#starCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* 导航栏 */
.navbar {
    background: rgba(5, 8, 30, 0.9);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 180, 255, 0.4);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, #00d4ff, #0099ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #e8f4ff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    padding: 5px 0;
}

.nav-link:hover {
    color: #00d4ff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #00d4ff;
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-btn {
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.login-btn {
    background: transparent;
    border: 1px solid #00d4ff;
    color: #00d4ff;
}

.login-btn:hover {
    background: rgba(0, 212, 255, 0.1);
}

.register-btn {
    background: linear-gradient(45deg, #0099ff, #00d4ff);
    color: white;
    border: none;
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #00d4ff;
    transition: all 0.3s;
    border-radius: 2px;
}

/* 移动端菜单 */
.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: rgba(5, 8, 30, 0.95);
    backdrop-filter: blur(20px);
    z-index: 99;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 180, 255, 0.4);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-nav {
    list-style: none;
    text-align: center;
}

.mobile-nav li {
    margin: 1rem 0;
}

.mobile-nav a {
    color: #e8f4ff;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 10px 0;
    display: block;
    transition: color 0.3s;
}

.mobile-nav a:hover {
    color: #00d4ff;
}

.mobile-auth {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 2rem;
    margin-top: 1rem;
}

.mobile-auth .auth-btn {
    width: 100%;
    text-align: center;
    padding: 12px;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* 英雄区域 */
.hero {
    padding: 50px 0 0px;
    text-align: center;
    position: relative;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #00d4ff, #0099ff, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 0px;
    color: #cceeff;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(45deg, #0099ff, #00d4ff);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 2px solid #00d4ff;
    color: #00d4ff;
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
}


/* 功能卡片 */
.features {
    padding: 50px 0;
}
 
.section-title {
    text-align: center;
    margin-bottom: 60px;
    font-size: 2.5rem;
    color: #00d4ff;
    text-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.card {
    background: rgba(16, 20, 60, 0.6);
    backdrop-filter: blur(12px);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.4s;
    border: 1px solid rgba(0, 180, 255, 0.3);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #0099ff, #00d4ff);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 153, 255, 0.25);
    border-color: rgba(0, 212, 255, 0.6);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #00d4ff;
}

.card p {
    color: #ddeeff;
    line-height: 1.6;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #0099ff;
}

/* 英语学习页面样式 */
.learning-container {
    max-width: 800px;
    width: 100%;
    background-color: #111;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: 40px auto;
}

.learning-container .header {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #333;
}

.learning-container .header h1 {
    font-size: 24px;
    margin-bottom: 5px;
    color: #4a9eff;
}

.learning-container .header p {
    color: #aaa;
    font-size: 14px;
}

.learning-container .content {
    padding: 30px;
}

.sentence-section {
    margin-bottom: 30px;
    text-align: center;
}

.english-sentence {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: 1px;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    color: #fff;
}

.phonetic {
    font-size: 18px;
    color: #4a9eff;
    margin-bottom: 15px;
    font-style: italic;
}

.chinese-translation {
    font-size: 20px;
    color: #ccc;
    margin-bottom: 25px;
}

.analysis-section {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-title {
    color: #4a9eff;
    font-size: 18px;
    margin-bottom: 15px;
    border-left: 4px solid #4a9eff;
    padding-left: 10px;
}

.section-title2 {
    color: #4a9eff;
    font-size: 40px;
    margin-bottom: 15px;
    border-left: 4px solid #4a9eff;
    padding-left: 10px;
}


.sentence-analysis {
    line-height: 1.6;
    color: #ddd;
}

.word-explanation {
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
}

.word-title {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.word-spelling {
    font-size: 20px;
    font-weight: bold;
    margin-right: 10px;
    color: #fff;
}

.word-phonetic {
    color: #4a9eff;
    font-style: italic;
}

.word-meanings {
    line-height: 1.6;
}

.meaning-item {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
    color: #ddd;
}

.meaning-item:before {
    content: "•";
    color: #4a9eff;
    position: absolute;
    left: 0;
}

.status {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #4a9eff;
    min-height: 20px;
}

.learning-container .controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #151515;
    border-top: 1px solid #333;
    padding: 20px;
}

.progress {
    display: flex;
    align-items: center;
    color: #aaa;
}

/* 页脚 */
.footer {
    background: rgba(10, 15, 50, 0.8);
    padding: 40px 0;
    text-align: center;
    margin-top: 80px;
    border-top: 1px solid rgba(0, 180, 255, 0.4);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer p {
    color: #cceeff;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    color: #cceeff;
    font-size: 1.2rem;
    transition: color 0.3s;
    text-decoration: none;
}

.social-link:hover {
    color: #00d4ff;
    transform: translateY(-2px);
}

/* 用户菜单样式 */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #0099ff, #00d4ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s;
}

.user-avatar:hover {
    transform: scale(1.1);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(16, 20, 60, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 180, 255, 0.3);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #e8f4ff;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
}

.dropdown-item.logout {
    color: #ff6b6b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-item.logout:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* 消息提示样式 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    z-index: 1000;
    max-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}


/* 响应式设计 */
/* 响应式调整 */
/*@media (max-width: 768px) {
    .user-menu .user-dropdown {
        position: fixed;
        top: 70px;
        right: 20px;
        left: 20px;
        min-width: auto;
    }
    
    .message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}*/
@media (max-width: 768px) {
    .user-menu .user-dropdown {
        position: fixed;
        top: 70px;
        right: 20px;
        left: 20px;
        min-width: auto;
    }
    
    .message {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .nav-menu {
        display: none;
    }
    
    .auth-buttons {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .english-sentence {
        font-size: 24px;
    }
    
    .learning-container .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .learning-container .controls .btn {
        width: 100%;
    }


    /* 基础调整 */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* 按钮优化 */
    .btn {
        padding: 12px 20px;
        font-size: 16px;
        min-width: 120px;
        min-height: 44px; /* 满足触摸目标最小尺寸 */
    }
    
    /* 表单元素优化 */
    input, select, textarea {
        font-size: 16px !important; /* 防止移动端自动缩小 */
        min-height: 44px;
    }
    
    /* 布局调整 */
    .container {
        padding: 0 15px;
    }
    
    /* 卡片阴影优化 */
    .auth-card, .profile-card {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    /* 动画优化 */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            transition-duration: 0.01ms !important;
        }
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .learning-container .content {
        padding: 20px;
    }
}
