/* 全局样式 */
:root {
    --primary-color: #1890ff;
    --text-color: #333;
    --border-color: #e8e8e8;
    --background-color: #f5f5f5;
    --card-background: #fff;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* 导航栏样式 */
.navbar {
    background: var(--card-background);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
}

.nav-right {
    display: flex;
    align-items: center;
}

.nav-links {
    /*position: fixed;*/
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.nav-link {
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.page-info {
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

.auth-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
}

.auth-btn.login {
    background-color: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.auth-btn.register {
    background-color: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
}

/* 用户菜单样式 */
.user-menu {
    position: relative;
}

.avatar-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #14171A;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

.avatar-circle i {
    font-size: 16px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 8px 0;
    min-width: 160px;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--background-color);
}

.dropdown-item i {
    font-size: 16px;
    color: #666;
}

/* 首页样式 */
.index-page {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.index-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.index-card {
    background: var(--card-background);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.index-vocabulary-categories {
    padding: 20px;
}

.index-vocabulary-categories h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--text-color);
}

.index-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.index-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    padding: 20px;
    border-radius: 8px;
    background: var(--background-color);
    transition: transform 0.2s;
    text-align: center;
}

.index-category-card:hover {
    transform: translateY(-2px);
}

.index-category-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #14171A;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: #fff;
    font-size: 24px;
}

.index-category-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: normal;
}

.index-daily-practice {
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    color: #fff;
    padding: 30px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.index-practice-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.index-practice-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.index-practice-text h3 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: normal;
}

.index-practice-text p {
    margin: 0;
    opacity: 0.8;
    font-size: 14px;
}

.index-stats-section {
    padding: 30px;
}

.index-stats-content {
    text-align: center;
}

.index-stats-content h2 {
    font-size: 36px;
    margin: 0;
    color: var(--text-color);
}

.index-stats-content p {
    margin: 5px 0 20px;
    color: #666;
    font-size: 14px;
}

.index-progress-bar {
    height: 6px;
    background: var(--background-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 30px;
}

.index-progress {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
}

.index-stats-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.index-weekly-chart {
    margin-top: 20px;
    height: 60px;
}

.index-chart-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100%;
}

.index-chart-bar {
    width: 8px;
    background: var(--primary-color);
    border-radius: 4px;
}

.index-study-abroad {
    position: relative;
    overflow: hidden;
    padding: 0;
    height: 100%;
    cursor: pointer;
}

.index-study-content {
    position: relative;
    height: 100%;
}

.index-study-content h3 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: 1;
    width: 100%;
    text-align: center;
    padding: 0 20px;
    font-size: 18px;
    font-weight: normal;
}

.index-world-map {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 词书分类页面样式 */
.category-header {
    text-align: center;
    padding: 2rem 0;
    background: #fff;
    margin-bottom: 2rem;
}

.category-header h1 {
    font-size: 2rem;
    color: #333;
    margin: 0 0 1rem 0;
}

.category-header p {
    color: #666;
    margin: 0;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.tab-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    color: #666;
    font-size: 1rem;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #f0f0f0;
}

.tab-btn.active {
    background: #1890ff;
    color: #fff;
}

.wordbook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
    margin-bottom: 3rem;
}

.wordbook-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.wordbook-card:hover {
    transform: translateY(-5px);
}

.wordbook-cover {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.wordbook-icon {
    height: 160px;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #1890ff;
}

.wordbook-info {
    padding: 1.5rem;
}

.wordbook-info h3 {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    color: #333;
}

.wordbook-stats {
    color: #666;
    margin: 0 0 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.difficulty {
    color: #ffc107;
}

.start-btn {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background: #1890ff;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.start-btn:hover {
    background: #40a9ff;
}

.sub-category {
    grid-column: 1 / -1;
    margin-top: 2rem;
}

.sub-category h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* 深色模式 */
[data-theme="dark"] {
    --text-color: #fff;
    --background-color: #1f1f1f;
    --border-color: #333;
    --card-background: #2c3e50;
}

.settings-btn {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #1890ff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s;
    z-index: 100;
}

.settings-btn:hover {
    background: #40a9ff;
    transform: rotate(30deg);
}

.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.settings-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.settings-content h2 {
    margin: 0 0 20px;
    color: #333;
    text-align: center;
}

.settings-item {
    margin: 15px 0;
}

.settings-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.settings-item input[type="checkbox"] {
    margin-right: 10px;
}

.settings-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.settings-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.settings-buttons button:first-child {
    background: #1890ff;
    color: white;
}

.settings-buttons button:last-child {
    background: #f5f5f5;
    color: #333;
}

.settings-buttons button:hover {
    opacity: 0.8;
}

.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4d4f;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
}

.dictation-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.word-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin: 20px auto;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
}

.word-chinese {
    font-size: 32px;
    color: #333;
    margin-bottom: 30px;
    font-weight: bold;
}

.word-input {
    width: 100%;
    max-width: 400px;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 6px;
    font-size: 24px;
    text-align: center;
    margin: 0 auto 20px;
    transition: all 0.3s;
}

.tip-text {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #1890ff;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.progress-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: #1890ff;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: #666;
}

.score-panel {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
}

.score-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    font-size: 24px;
    color: #999;
    transition: all 0.3s;
}

.score-close:hover {
    color: #666;
}

.score-title {
    font-size: 24px;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

.score-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 40px;
    width: 100%;
    max-width: 400px;
}

.stats-item {
    text-align: center;
}

.stats-label {
    color: #666;
    margin-bottom: 10px;
}

.stats-value {
    font-size: 24px;
    color: #333;
    font-weight: bold;
}

.accuracy-circle {
    width: 120px;
    height: 120px;
    border: 6px solid #1890ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #1890ff;
    font-weight: bold;
}

.score-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.score-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: #1890ff;
    color: white;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.score-btn.secondary {
    background: #f5f5f5;
    color: #333;
}

.score-btn:hover {
    opacity: 0.8;
}

.score-btn i {
    font-size: 16px;
}

.bottom-buttons {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 100;
}

.bottom-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.bottom-btn:hover {
    background: #e6e6e6;
}

.bottom-btn i {
    font-size: 16px;
}

.result-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    animation: fadeIn 0.3s ease;
    z-index: 10;
}

.result-message.correct {
    background: rgba(82, 196, 26, 0.9);
    color: white;
}

.result-message.incorrect {
    background: rgba(255, 77, 79, 0.9);
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 全局响应式样式 */
html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器自适应 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* 图片自适应 */
img {
    max-width: 100%;
    height: auto;
}

/* 表格自适应 */
table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
}

/* 响应式布局断点 */
@media (max-width: 1200px) {
    html, body {
        font-size: 15px;
    }
}

@media (max-width: 992px) {
    html, body {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    html, body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px;
    }
}

@media (max-width: 576px) {
    html, body {
        font-size: 13px;
    }
    
    .container {
        padding: 0 8px;
    }
}

/* 自适应表单元素 */
input, select, textarea, button {
    max-width: 100%;
    box-sizing: border-box;
}

/* 自适应弹性盒子 */
.flex-container {
    display: flex;
    flex-wrap: wrap;
}

/* 自适应网格系统 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

/* 自适应文本溢出处理 */
.text-overflow {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 自适应视频容器 */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
} 