/* 能源电力人才培养平台 - 自定义样式 */

/* 全局样式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border: none;
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #146c43);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #e0a800);
    border: none;
    color: #000;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #b02a37);
    border: none;
}

/* 表单样式 */
.form-control {
    border-radius: 6px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
}

/* 统计卡片 */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.stats-card.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stats-card.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stats-card.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stats-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 文档列表样式 */
.document-item {
    border-left: 4px solid var(--primary-color);
    background: #f8f9fa;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 6px 6px 0;
    transition: all 0.3s ease;
}

.document-item:hover {
    background: #e9ecef;
    border-left-color: var(--success-color);
}

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

.document-title:hover {
    color: var(--success-color);
}

.document-meta {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* 词汇卡片样式 */
.vocabulary-card {
    border-left: 4px solid var(--info-color);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
}

.vocabulary-chinese {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.vocabulary-english {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.vocabulary-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 测验样式 */
.quiz-card {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.quiz-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.1);
}

.question-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.question-options {
    margin-top: 1rem;
}

.question-options .form-check {
    margin-bottom: 0.8rem;
    padding-left: 2rem;
}

.question-options .form-check-input {
    margin-top: 0.3rem;
}

.question-options .form-check-label {
    font-size: 1rem;
    line-height: 1.5;
}

/* 分页样式 */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: none;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 徽章样式 */
.badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}

/* 进度条样式 */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 基础布局 */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* 导航栏 */
    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    /* 统计卡片 */
    .stats-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .stats-number {
        font-size: 2rem;
    }

    /* 内容卡片 */
    .document-item,
    .vocabulary-card,
    .quiz-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }

    /* 表格响应式 */
    .table-responsive {
        font-size: 0.875rem;
    }

    .action-buttons .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    /* 表单优化 */
    .form-control,
    .form-select {
        font-size: 16px; /* 防止iOS缩放 */
    }

    /* 模态框 */
    .modal-dialog {
        margin: 0.5rem;
    }

    /* 按钮组 */
    .btn-group {
        flex-wrap: wrap;
    }

    .btn-group .btn {
        margin-bottom: 0.25rem;
    }

    /* 分页 */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .pagination .page-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    /* 头部区域 */
    .hero-section,
    .dashboard-header,
    .document-header,
    .vocabulary-header,
    .category-header,
    .results-header {
        padding: 1.5rem;
        text-align: center;
    }

    .hero-section h1,
    .dashboard-header h1 {
        font-size: 1.75rem;
    }

    .hero-section .lead,
    .dashboard-header .lead {
        font-size: 1rem;
    }

    /* 网格布局 */
    .vocabulary-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* 筛选区域 */
    .filter-card,
    .sort-options {
        padding: 1rem;
    }

    .filter-card .row > div {
        margin-bottom: 1rem;
    }

    /* 字母导航 */
    .alphabet-nav {
        gap: 0.25rem;
    }

    .alphabet-nav .btn {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }

    /* 时间线 */
    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item {
        padding-left: 1.5rem;
    }

    /* 团队成员 */
    .team-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    /* 图表容器 */
    .chart-container {
        padding: 1rem;
    }

    /* 上传区域 */
    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-area h5 {
        font-size: 1.1rem;
    }

    /* 问题卡片 */
    .question-card {
        padding: 1rem;
    }

    .question-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }

    /* 进度条 */
    .progress-ring {
        width: 60px;
        height: 60px;
    }

    .progress-ring svg {
        width: 60px;
        height: 60px;
    }

    /* 隐藏不必要的元素 */
    .d-md-block {
        display: none !important;
    }

    /* 文本大小调整 */
    .small-text-mobile {
        font-size: 0.75rem;
    }

    /* 间距调整 */
    .mb-mobile-2 {
        margin-bottom: 0.5rem !important;
    }

    .mt-mobile-2 {
        margin-top: 0.5rem !important;
    }

    /* 页脚优化 */
    footer .row > div {
        margin-bottom: 2rem;
    }

    footer h5,
    footer h6 {
        font-size: 1rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .display-4 {
        font-size: 1.75rem;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .alphabet-nav .btn {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .table-responsive {
        font-size: 0.75rem;
    }

    .action-buttons .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.7rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* 确保触摸目标足够大 */
    }

    .form-control,
    .form-select {
        min-height: 44px;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .card:hover {
        transform: none; /* 禁用悬停效果 */
    }

    .btn:hover {
        transform: none;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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