/* WordGround 样式表 - 清新学术风格 */

/* ==================== CSS 变量 ==================== */
:root {
    /* 主色 */
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-lighter: #818CF8;
    --primary-dark: #3730A3;
    --primary-alpha: rgba(79, 70, 229, 0.1);
    
    /* 辅助色 */
    --success: #10B981;
    --success-light: #34D399;
    --warning: #F59E0B;
    --warning-light: #FBBF24;
    --danger: #EF4444;
    --danger-light: #F87171;
    
    /* 背景色 */
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F5F9;
    --bg-elevated: #FFFFFF;
    
    /* 文字色 */
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-tertiary: #94A3B8;
    --text-inverse: #FFFFFF;
    
    /* 边框色 */
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 间距 */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* 动画 */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* 字体 */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;
}

/* 深色模式 */
[data-theme="dark"] {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-elevated: #1E293B;
    
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    
    --border: #334155;
    --border-light: #1E293B;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    
    --primary-alpha: rgba(99, 102, 241, 0.2);
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 布局 ==================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .app-header {
    background: rgba(30, 41, 59, 0.9);
}

.header-left, .header-right {
    flex: 0 0 auto;
}

.header-center {
    flex: 1;
    max-width: 400px;
    margin: 0 var(--space-md);
}

.app-main {
    padding-top: 60px;
    padding-bottom: 80px;
    min-height: 100vh;
}

.view-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md);
}

/* ==================== Logo ==================== */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== 搜索框 ==================== */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 40px;
    padding: 0 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.search-clear {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.search-clear:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.search-clear svg {
    width: 14px;
    height: 14px;
}

/* ==================== 图标按钮 ==================== */
.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    height: 40px;
    padding: 0 var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--text-tertiary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background: var(--danger-light);
}

.btn-lg {
    height: 48px;
    padding: 0 var(--space-lg);
    font-size: 1rem;
}

.btn-sm {
    height: 32px;
    padding: 0 var(--space-sm);
    font-size: 0.8125rem;
}

/* ==================== 底部导航 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .bottom-nav {
    background: rgba(30, 41, 59, 0.95);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-sm);
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    color: var(--primary-light);
}

/* ==================== 视图切换 ==================== */
.view {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 词汇库视图 ==================== */
.view-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.stat-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
    transition: var(--transition-fast);
}

.stat-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.view-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* 下拉菜单 */
.sort-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-xs);
    min-width: 160px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-fast);
}

.sort-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
}

.dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.dropdown-item:hover {
    background: var(--primary-alpha);
    color: var(--primary);
}

.dropdown-item.active {
    background: var(--primary-alpha);
    color: var(--primary);
    font-weight: 500;
}

/* 词汇列表 */
.vocab-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    opacity: 0.8;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* 词汇卡片 */
.vocab-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.vocab-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.vocab-main {
    min-width: 0;
}

.vocab-word {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.vocab-pos {
    display: inline-block;
    font-size: 0.6875rem;
    color: var(--primary);
    background: var(--primary-alpha);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: var(--space-sm);
}

.vocab-meaning {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vocab-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

.vocab-count {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--warning);
}

.vocab-count svg {
    width: 14px;
    height: 14px;
}

.vocab-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-xs);
}

.vocab-action {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.vocab-action:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.vocab-action.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.vocab-action svg {
    width: 16px;
    height: 16px;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.page-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ==================== OCR 视图 ==================== */
.ocr-container {
    max-width: 600px;
    margin: 0 auto;
}

.ocr-upload {
    text-align: center;
}

.upload-area {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    margin-bottom: var(--space-lg);
    transition: var(--transition-fast);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-alpha);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.upload-area h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.upload-hints {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.hint-tag {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.btn-upload {
    width: 100%;
    margin-bottom: var(--space-sm);
}

.btn-upload svg {
    width: 20px;
    height: 20px;
}

/* OCR 处理中 */
.ocr-processing {
    text-align: center;
    padding: var(--space-2xl);
}

.processing-animation {
    margin-bottom: var(--space-lg);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    margin: var(--space-md) auto 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
    width: 0%;
}

/* OCR 预览 */
.ocr-preview {
    animation: fadeIn var(--transition-normal);
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.preview-title {
    font-weight: 600;
    color: var(--text-primary);
}

.word-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.preview-image-container {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.preview-image-container img {
    width: 100%;
    display: block;
}

.detection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.detected-words {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    max-height: 300px;
    overflow-y: auto;
}

.detected-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    transition: var(--transition-fast);
}

.detected-card:hover {
    border-color: var(--primary);
}

.detected-card.selected {
    border-color: var(--primary);
    background: var(--primary-alpha);
}

.detected-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.detected-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.detected-checkbox svg {
    width: 14px;
    height: 14px;
    color: white;
    opacity: 0;
}

.detected-checkbox.checked svg {
    opacity: 1;
}

.detected-word {
    flex: 1;
    min-width: 0;
}

.detected-original {
    font-weight: 600;
    color: var(--text-primary);
}

.detected-lemmas {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.detected-form {
    flex-shrink: 0;
}

.ocr-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.source-input input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.source-input input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==================== 记忆卡片视图 ==================== */
.cards-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.cards-empty {
    padding: var(--space-2xl);
}

.cards-empty .empty-icon {
    font-size: 4rem;
}

.cards-empty h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.cards-empty p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.review-settings {
    margin-bottom: var(--space-xl);
}

.setting-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.quantity-selector {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.qty-btn {
    width: 48px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.qty-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.qty-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
}

/* 卡片复习 */
.card-review {
    padding: var(--space-lg);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.review-progress {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.review-progress span {
    font-weight: 600;
    color: var(--primary);
}

/* 翻转卡片 */
.flashcard {
    width: 100%;
    aspect-ratio: 3/2;
    perspective: 1000px;
    margin-bottom: var(--space-xl);
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
}

.flashcard-front {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-inverse);
}

.flashcard-back {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transform: rotateY(180deg);
}

.card-word {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.card-pos {
    font-size: 0.875rem;
    opacity: 0.8;
}

.card-meaning {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.card-variants {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.card-examples {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.rate-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.rate-btn {
    flex-direction: column;
    height: auto;
    padding: var(--space-md);
    gap: var(--space-xs);
}

.rate-icon {
    font-size: 1.25rem;
}

.rate-btn span:last-child {
    font-size: 0.75rem;
}

.rate-again {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.rate-again:hover {
    background: rgba(239, 68, 68, 0.2);
}

.rate-hard {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.rate-hard:hover {
    background: rgba(245, 158, 11, 0.2);
}

.rate-good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.rate-good:hover {
    background: rgba(16, 185, 129, 0.2);
}

.rate-easy {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.rate-easy:hover {
    background: rgba(79, 70, 229, 0.2);
}

/* 复习完成 */
.review-complete {
    padding: var(--space-2xl);
}

.complete-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.review-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

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

/* ==================== 设置视图 ==================== */
.settings-container {
    max-width: 600px;
    margin: 0 auto;
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
}

.settings-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.section-title svg {
    width: 18px;
    height: 18px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-item:first-of-type {
    padding-top: 0;
}

.setting-info {
    flex: 1;
}

.setting-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-desc {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* 开关 */
.toggle {
    position: relative;
    width: 48px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* API 选择下拉框 */
.api-select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    min-width: 160px;
}

.api-select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* 词典 API 配置区块 */
.dict-api-config {
    padding-top: var(--space-md);
}

.dict-api-config .input-group {
    margin-top: 0;
}

.api-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.api-hint.success {
    color: #22c55e;
}

.api-hint.error {
    color: var(--danger);
}

/* 同步配置 */
.sync-config {
    padding-top: var(--space-md);
}

.input-group {
    margin-bottom: var(--space-md);
}

.input-group label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.input-group input {
    width: 100%;
    height: 40px;
    padding: 0 var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.sync-status {
    font-size: 0.8125rem;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.sync-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.sync-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.sync-actions {
    display: flex;
    gap: var(--space-sm);
}

/* 导出选项 */
.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.export-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.export-btn:hover {
    border-color: var(--primary);
    background: var(--primary-alpha);
}

.export-icon {
    font-size: 1.5rem;
}

/* 危险操作 */
.setting-item.danger .setting-label {
    color: var(--danger);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: var(--text-inverse);
}

/* 设置页脚 */
.settings-footer {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.settings-footer p:first-child {
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

/* ==================== 模态框 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalSlideUp var(--transition-normal);
}

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

.modal-sm .modal-content {
    max-width: 360px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: var(--space-lg);
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-top: 1px solid var(--border);
}

/* 表单 */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-md);
}

/* 词汇输入行 + 查询按钮 */
.word-input-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.word-input-row input {
    flex: 1;
}

/* 查询按钮样式 */
#lookupBtn {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    white-space: nowrap;
    min-width: 64px;
    transition: var(--transition-fast);
}

#lookupBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 确认框 */
.confirm-body {
    text-align: center;
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.confirm-body h4 {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
}

/* ==================== Toast 通知 ==================== */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: toastSlideIn var(--transition-normal);
    pointer-events: auto;
}

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

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    font-size: 0.875rem;
}

/* ==================== 响应式 ==================== */
@media (min-width: 768px) {
    .app-header {
        padding: 0 var(--space-xl);
    }
    
    .view-container {
        padding: var(--space-xl);
    }
    
    .stats-bar {
        gap: var(--space-lg);
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .vocab-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .export-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .header-center {
        display: none;
    }
    
    .vocab-card {
        grid-template-columns: 1fr;
    }
    
    .vocab-actions {
        flex-direction: row;
        justify-content: flex-end;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .rate-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== 动画 ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity var(--transition-slow);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ==================== 词典查询状态 ==================== */
.lookup-status {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    padding: var(--space-xs) 0;
    transition: var(--transition-fast);
    animation: fadeIn var(--transition-fast);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== 深色模式下的查找状态 ==================== */
[data-theme="dark"] .lookup-status {
    color: var(--text-tertiary);
}

/* 英文释义样式 */
.vocab-en-meaning {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-top: var(--space-xs);
    line-height: 1.4;
}

/* 同近义词样式 */
.vocab-synonyms {
    font-size: 0.75rem;
    color: var(--success);
    margin-top: var(--space-xs);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vocab-synonyms .label {
    color: var(--text-tertiary);
    margin-right: 4px;
}

/* 反义词样式 */
.vocab-antonyms {
    font-size: 0.75rem;
    color: var(--warning);
    margin-top: 2px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vocab-antonyms .label {
    color: var(--text-tertiary);
    margin-right: 4px;
}

/* 例句样式 */
.vocab-example {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-top: var(--space-xs);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== 账号登录区块 ==================== */
.account-section {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.account-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.account-logged-out .input-group {
    margin-bottom: var(--space-md);
}

.account-logged-out .input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.account-logged-out .input-group input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--bg-secondary);
}

.account-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.account-actions .btn {
    flex: 1;
}

.account-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: var(--space-sm);
    min-height: 1.2em;
}

.account-logged-in {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.account-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.account-icon {
    font-size: 1.5rem;
}

.account-name {
    font-weight: 500;
    color: var(--text-primary);
}

.sync-actions {
    display: flex;
    gap: var(--space-xs);
}

.sync-actions .btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
}

/* 注册弹窗 */
.register-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.register-content {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 320px;
    box-shadow: var(--shadow-xl);
}

.register-content h4 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.register-content .input-group {
    margin-bottom: var(--space-md);
}

.register-content .input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.register-content .input-group input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.register-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-md);
}
