/* 术语字典样式文件 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 术语字典主页样式 */
.terms-dictionary-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 页面头部 */
.terms-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* 搜索区域 */
.search-section {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: white;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    color: white;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.search-icon {
    font-size: 1.2rem;
}

/* 搜索建议 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    transition: background-color 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item .suggestion-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.suggestion-item .suggestion-category {
    font-size: 0.875rem;
    color: #666;
}

/* 分类导航 */
.category-nav {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.category-btn:hover {
    border-color: #667eea;
    transform: translateY(-1px);
}

.category-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 主要内容区 */
.main-content {
    flex: 1;
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1rem;
    gap: 2rem;
}

/* 左侧边栏 */
.terms-sidebar {
    width: 350px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    position: sticky;
    top: 2rem;
}

/* 筛选区域 */
.filter-section {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.filter-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.difficulty-filter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.25rem 0;
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* 术语列表 */
.terms-list-container {
    padding: 1.5rem;
}

.list-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
}

.list-header h3 {
    color: #333;
    font-size: 1.1rem;
}

.term-count {
    font-size: 0.9rem;
    color: #666;
}

.terms-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.term-item {
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.term-item:hover {
    background: #f8f9fa;
    border-color: #e0e0e0;
}

.term-item.active {
    background: #e7f3ff;
    border-color: #667eea;
}

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

.term-item .term-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
}

.meta-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.category-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.difficulty-badge {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* 右侧详情区 */
.terms-detail {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 600px;
}

.detail-container {
    padding: 2rem;
}

/* 欢迎消息 */
.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.welcome-message h2 {
    margin-bottom: 1rem;
    color: #333;
}

.welcome-message p {
    color: #666;
    margin-bottom: 2rem;
}

/* 快速链接 */
.quick-links {
    text-align: left;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.quick-links h3 {
    margin-bottom: 1rem;
    color: #333;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.quick-link:hover {
    background: #e7f3ff;
    transform: translateY(-1px);
}

.link-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.link-text {
    font-weight: 500;
}

/* 随机术语 */
.random-terms {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.random-terms h3 {
    margin-bottom: 1rem;
    color: #333;
}

.random-terms-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.random-term-item {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    text-decoration: none;
    color: #333;
}

.random-term-item:hover {
    background: #e7f3ff;
}

/* 页脚 */
.terms-footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 1.5rem;
    text-align: center;
    margin-top: 2rem;
}

.footer-content p {
    color: #666;
    margin-bottom: 0.5rem;
}

.last-updated {
    font-size: 0.875rem;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #666;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .terms-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }

    .quick-links-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2rem;
    }

    .category-nav {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .category-btn {
        flex-shrink: 0;
    }

    .detail-container {
        padding: 1.5rem;
    }

    .welcome-message {
        padding: 2rem 1rem;
    }

    .welcome-icon {
        font-size: 3rem;
    }
}

/* 术语详情页面样式 */
.term-detail-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.detail-nav {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 0;
}

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

.back-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #667eea;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #5a6fd8;
}

.back-icon {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.nav-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    text-decoration: none;
}

.action-btn:hover {
    background: #e7f3ff;
    border-color: #667eea;
}

.btn-icon {
    margin-right: 0.5rem;
}

.detail-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1rem;
}

.term-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.term-title-section {
    margin-bottom: 1rem;
}

.term-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.75rem;
}

.term-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.term-brief {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.7;
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.term-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.content-section {
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.content-section h2 {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.content-text {
    padding: 1.5rem;
    line-height: 1.7;
    color: #555;
}

.calculation-formula {
    padding: 1.5rem;
    background: #f8f9fa;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
}

.factor-list,
.tips-list,
.see-also-list {
    padding: 1.5rem;
    margin: 0;
}

.factor-list li,
.tips-list li,
.see-also-list li {
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 1.5rem;
}

.factor-list li::before,
.tips-list li::before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.see-also-list li::before {
    content: "→";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.examples-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.example-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #28a745;
}

.example-title {
    font-weight: 600;
    color: #28a745;
    margin-bottom: 0.5rem;
}

.example-description {
    color: #555;
    line-height: 1.6;
}

.example-data {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #333;
}

.related-terms-grid {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.related-term-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
    border: 1px solid transparent;
}

.related-term-card:hover {
    background: #e7f3ff;
    border-color: #667eea;
    transform: translateY(-1px);
}

.related-term-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.related-term-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.related-term-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

.detail-footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #5a6fd8;
}

.copyright {
    color: #666;
    font-size: 0.9rem;
}

/* 难度等级颜色 */
.difficulty-初级 {
    background: #e8f5e8;
    color: #2e7d32;
}

.difficulty-中级 {
    background: #fff3e0;
    color: #ef6c00;
}

.difficulty-高级 {
    background: #ffebee;
    color: #c62828;
}

/* 悬浮提示 */
.tooltip-container {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
}

/* 响应式设计 - 详情页面 */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }

    .term-title {
        font-size: 1.5rem;
    }

    .term-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .related-terms-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-link {
        margin: 0;
    }
}