/* 俄语学习笔记 - 自定义样式 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 导航链接悬停效果 */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #0039A6;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* 功能卡片样式 */
.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #0039A6;
}

/* 单词卡片样式 */
.word-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid #0039A6;
}

.word-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.word-card .word-russian {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0039A6;
    margin-bottom: 0.5rem;
}

.word-card .word-phonetic {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.word-card .word-chinese {
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.word-card .word-example {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.75rem;
}

/* 主题标签样式 */
.theme-tag {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.theme-tag:hover {
    background: #0039A6;
    color: white;
    border-color: #0039A6;
    transform: scale(1.05);
}

.theme-tag.active {
    background: #0039A6;
    color: white;
    border-color: #0039A6;
}

/* AI助手标签按钮 */
.assistant-tab-btn {
    background: white;
    color: #666;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    font-weight: 500;
}

.assistant-tab-btn:hover {
    background: #f3f4f6;
    color: #0039A6;
}

.assistant-tab-btn.active {
    background: #0039A6;
    color: white;
    border-color: #0039A6;
}

/* 结果卡片样式 */
.result-card {
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    border-left: 4px solid #0039A6;
}

/* 对话气泡样式 */
.message-bubble {
    max-width: 80%;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

.message-ai {
    background: #e8f0fe;
    color: #1a1a1a;
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

.message-user {
    background: #0039A6;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
    margin-left: auto;
}

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

/* 录音按钮动画 */
#record-btn.recording {
    animation: pulse 1.5s infinite;
    background: #DC2626;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

/* 材料列表项样式 */
.material-item {
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.material-item:hover {
    background: #f9fafb;
    border-color: #0039A6;
}

.material-item.active {
    background: #e8f0fe;
    border-color: #0039A6;
}

.material-item .material-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.material-item .material-meta {
    font-size: 0.875rem;
    color: #666;
}

/* 场景按钮样式 */
.scenario-btn {
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.scenario-btn:hover {
    background: #f9fafb;
    border-color: #D52B1E;
}

.scenario-btn.active {
    background: #fee2e2;
    border-color: #D52B1E;
}

.scenario-btn .scenario-icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: #0039A6;
    color: white;
    border-radius: 0.5rem;
    text-align: center;
    line-height: 40px;
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.scenario-btn.active .scenario-icon {
    background: #D52B1E;
}

/* 进度条动画 */
.progress-bar {
    animation: progressAnimation 1s ease-out;
}

@keyframes progressAnimation {
    from {
        width: 0;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 57, 166, 0.3);
    border-radius: 50%;
    border-top-color: #0039A6;
    animation: spin 1s linear infinite;
}

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

/* 提示框样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-primary {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .word-card .word-russian {
        font-size: 1.25rem;
    }
    
    .message-bubble {
        max-width: 90%;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 选中文本样式 */
::selection {
    background: #0039A6;
    color: white;
}

::-moz-selection {
    background: #0039A6;
    color: white;
}

/* 焦点样式优化 */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 57, 166, 0.1);
}

/* 按钮禁用状态 */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

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

/* 级联延迟动画 */
.stagger-animation {
    animation: staggerFadeIn 0.5s ease backwards;
}

.stagger-animation:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation:nth-child(6) { animation-delay: 0.6s; }

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

/* 打印样式 */
@media print {
    nav, footer, button {
        display: none;
    }
    
    body {
        background: white;
    }
}