/* ========================================
   恒好考 - 中级经济师免费刷题库
   清爽简洁设计风格
   ======================================== */

/* 基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2c5aa0;
    --primary-dark: #1e3d6e;
    --primary-light: #e8f0fe;
    --secondary: #ff6b35;
    --success: #52c41a;
    --error: #f5222d;
    --warning: #faad14;
    --text: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg: #f5f7fa;
    --bg-white: #fff;
    --border: #e8e8e8;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.1);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 导航栏 */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand::before {
    content: "📚";
    font-size: 22px;
}

.nav-welcome {
    font-size: 14px;
    color: var(--text-light);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.nav-btn-primary {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(255,107,53,0.3);
}

.nav-btn-primary:hover {
    background: #e55a2b;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,107,53,0.4);
}

.nav-btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.nav-btn-outline:hover {
    background: var(--primary-light);
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 首页科目区域 */
.subjects-section {
    padding: 40px 0 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    text-align: center;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 30px;
}

/* 科目卡片网格 */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    .nav-welcome {
        display: none;
    }
    .navbar-inner {
        padding: 0 12px;
    }
}

/* 科目卡片 */
.subject-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    transition: opacity 0.3s;
}

.subject-card:hover::before {
    opacity: 1;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* 公共科目样式 */
.subject-public {
    background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
    border: 1px solid #c2d8f8;
}

.subject-public .subject-name {
    color: var(--primary-dark);
}

.subject-public .subject-count {
    background: var(--primary);
    color: #fff;
}

/* 专业科目样式 */
.subject-professional {
    background: linear-gradient(135deg, #f0f7f0 0%, #e0f0e0 100%);
    border: 1px solid #c8e0c8;
}

.subject-professional .subject-name {
    color: #2d6a2d;
}

.subject-professional .subject-count {
    background: #3d8b3d;
    color: #fff;
}

.subject-info {
    flex: 1;
    min-width: 0;
}

.subject-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.subject-source {
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.5;
    max-width: 200px;
}

.subject-count {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Banner区域 */
.banners-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 30px 0;
}

.banner-item {
    aspect-ratio: 3/1;
    background: linear-gradient(135deg, var(--primary-light) 0%, #d2e3fc 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .banners-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 底部 */
.footer {
    background: #1a2744;
    color: #a0aec0;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-brand h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 10px;
}

.footer-brand p {
    font-size: 13px;
    line-height: 1.8;
    max-width: 400px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 20px;
}

.footer-links a {
    color: #8899aa;
    font-size: 13px;
}

.footer-links a:hover {
    color: #fff;
}

.footer-qr {
    text-align: center;
}

.footer-qr img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    margin-bottom: 6px;
}

.footer-qr span {
    font-size: 12px;
}

.footer-bottom {
    border-top: 1px solid #2a3a55;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #667799;
}

@media (max-width: 768px) {
    .footer-top {
        flex-direction: column;
    }
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   科目刷题页面
   ======================================== */
.subject-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 50px 0;
    text-align: center;
}

.subject-header h1 {
    font-size: 32px;
    margin-bottom: 12px;
}

.subject-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    font-size: 14px;
    opacity: 0.9;
}

.subject-desc {
    max-width: 600px;
    margin: 0 auto;
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.8;
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 50px;
    background: var(--secondary);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(255,107,53,0.35);
    margin-top: 30px;
}

.btn-start:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255,107,53,0.45);
}

/* 答题区域 */
.quiz-area {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.quiz-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.quiz-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.quiz-progress-bar {
    flex: 1;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    margin: 0 15px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.quiz-type-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.quiz-type-single { background: var(--primary-light); color: var(--primary); border: 2px solid var(--primary); }
.quiz-type-multiple { background: #fff7e6; color: var(--warning); border: 2px solid var(--warning); }
.quiz-type-judge { background: #f6ffed; color: var(--success); border: 2px solid var(--success); }

.quiz-question {
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 30px;
    color: var(--text);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-white);
}

.quiz-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.quiz-option.correct {
    border-color: var(--success);
    background: #f6ffed;
}

.quiz-option.wrong {
    border-color: var(--error);
    background: #fff1f0;
}

.option-label {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    transition: var(--transition);
}

.quiz-option:hover .option-label,
.quiz-option.selected .option-label {
    background: var(--primary);
    color: #fff;
}

.quiz-option.correct .option-label {
    background: var(--success);
    color: #fff;
}

.quiz-option.wrong .option-label {
    background: var(--error);
    color: #fff;
}

.option-text {
    font-size: 15px;
    line-height: 1.6;
}

.quiz-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-submit, .btn-next {
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-submit {
    background: var(--primary);
    color: #fff;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

.btn-next {
    background: var(--success);
    color: #fff;
}

.btn-next:hover {
    background: #389e0d;
}

/* 答案解析 */
.quiz-result {
    margin-top: 25px;
    padding: 25px;
    border-radius: 10px;
    display: none;
}

.quiz-result.show {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 10px;
}

.result-text {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.result-correct { color: var(--success); }
.result-wrong { color: var(--error); }

.quiz-result.correct-result {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
}

.quiz-result.wrong-result {
    background: #fff1f0;
    border: 1px solid #ffa39e;
}

.analysis-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
}

.analysis-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-light);
}

/* 随机题目预览 */
.random-questions {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.random-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.random-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.random-item {
    background: var(--bg-white);
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.random-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

.random-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.random-item-type {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
}

.random-item-time {
    font-size: 12px;
    color: var(--text-lighter);
}

.random-item-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ========================================
   题目详情页
   ======================================== */
.question-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.question-main {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 35px;
    box-shadow: var(--shadow);
}

.question-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-banner {
    aspect-ratio: 3/2;
    background: linear-gradient(135deg, var(--primary-light) 0%, #d2e3fc 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
}

.sidebar-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .question-layout {
        grid-template-columns: 1fr;
    }
    .question-sidebar {
        flex-direction: row;
        overflow-x: auto;
    }
    .sidebar-banner {
        min-width: 200px;
        flex-shrink: 0;
    }
}

.question-breadcrumb {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.question-breadcrumb a {
    color: var(--primary);
}

.question-detail-type {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.question-detail-title {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 25px;
    color: var(--text);
}

.question-detail-answer {
    background: var(--primary-light);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.question-detail-answer strong {
    color: var(--primary-dark);
}

.question-detail-analysis {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.question-detail-analysis h4 {
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.question-detail-analysis p {
    line-height: 1.8;
    color: var(--text-light);
}

/* ========================================
   广告专题页
   ======================================== */
.ad-page {
    background: var(--bg-white);
    min-height: calc(100vh - 64px);
}

.ad-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.ad-image-placeholder {
    width: 100%;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, var(--primary-light) 0%, #e0e8f5 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 30px;
}

/* ========================================
   后台管理样式
   ======================================== */
.admin-body {
    background: #f0f2f5;
}

.admin-login-box {
    max-width: 420px;
    margin: 100px auto;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.admin-login-box h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 30px;
}

.admin-sidebar {
    width: 220px;
    background: #001529;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    color: #fff;
}

.admin-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #1890ff;
    font-size: 16px;
    font-weight: 600;
}

.admin-menu {
    list-style: none;
    padding: 10px 0;
}

.admin-menu li a {
    display: block;
    padding: 14px 24px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: all 0.3s;
}

.admin-menu li a:hover,
.admin-menu li a.active {
    background: #1890ff;
    color: #fff;
}

.admin-main {
    margin-left: 220px;
    padding: 24px;
}

.admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.admin-table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
}

.admin-table tr:hover {
    background: #fafafa;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-delete {
    background: #fff1f0;
    color: var(--error);
    margin-left: 6px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
}

.pagination a {
    background: #fff;
    border: 1px solid #e8e8e8;
    color: var(--text);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    color: #fff;
}

/* 题目类型标签 */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tag-single { background: #e6f7ff; color: #096dd9; }
.tag-multiple { background: #fffbe6; color: #d48806; }
.tag-judge { background: #f6ffed; color: #389e0d; }

/* 富文本编辑器容器 */
.editor-container {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    overflow: hidden;
}

.editor-toolbar {
    background: #fafafa;
    padding: 10px 14px;
    border-bottom: 1px solid #d9d9d9;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.editor-toolbar button {
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.editor-toolbar button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.editor-content {
    min-height: 200px;
    padding: 14px;
    outline: none;
}

/* 导入区域 */
.import-area {
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #fafafa;
    margin-bottom: 20px;
}

.import-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* 响应式通用 */
@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }
    .admin-main {
        margin-left: 0;
    }
}

/* 动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.loading {
    animation: pulse 1.5s infinite;
}
