@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;700;900&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --royal-blue: #002147;
    --gold-accent: #C5A059;
    --paper-white: #FCFBF9;
    --text-dark: #1A1A1A;
    --text-grey: #555555;
    --border-light: rgba(0, 0, 0, 0.07);
    --font-heading: 'Merriweather', 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--paper-white);
    color: var(--text-dark);
    font-family: var(--font-body);
    line-height: 1.7;
}

/* ===== 全局布局：左侧栏 + 右侧内容 ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== 左侧边栏 ===== */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--royal-blue);
    color: #ffffff;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.3rem;
    color: var(--gold-accent);
    padding-bottom: 24px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.filter-item label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.filter-item select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
    cursor: pointer;
    appearance: none;
    /* 自定义下拉箭头 (白色) */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

.filter-item select:focus {
    border-color: var(--gold-accent);
    box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.25);
}

.filter-item select:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.filter-item select option {
    background: var(--royal-blue);
    color: #fff;
}

.btn-search {
    margin-top: 12px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: var(--gold-accent);
    color: var(--royal-blue);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 0.5px;
}

.btn-search:hover {
    background: #d4af6a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
}

/* ===== 右侧主内容区 ===== */
.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.main-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-light);
}

.main-header h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--royal-blue);
    margin-bottom: 4px;
}

.main-header .result-count {
    font-size: 0.9rem;
    color: var(--text-grey);
}

/* ===== 题目列表 (单列，像学术试卷排列) ===== */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.question-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.question-card:hover {
    border-color: rgba(197, 160, 89, 0.3);
    box-shadow: 0 8px 24px rgba(0, 33, 71, 0.06);
}

/* 卡片顶部信息栏：L4 标签 + 难度标签 */
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.l4-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.l4-tag {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--royal-blue);
    background: rgba(0, 33, 71, 0.06);
    padding: 4px 12px;
    border-radius: 999px;
    letter-spacing: 0.3px;
}

.dim-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.dim-tag {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.tag-d {
    color: #C5A059;
    background: rgba(197, 160, 89, 0.1);
}

.tag-c {
    color: #002147;
    background: rgba(0, 33, 71, 0.06);
}

.tag-k {
    color: #3f51b5;
    background: rgba(63, 81, 181, 0.08);
}

.tag-op {
    color: #009688;
    background: rgba(0, 150, 136, 0.08);
}

.tag-a {
    color: #A0522D;
    background: rgba(160, 82, 45, 0.08);
}

.tag-s {
    color: #666;
    background: rgba(0, 0, 0, 0.04);
}

/* 题干 */
.question-stem {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
    overflow-wrap: break-word;
    margin-bottom: 16px;
}

/* 选项 */
.options-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.options-list li {
    padding: 12px 16px;
    background: #fafaf8;
    border-radius: 10px;
    font-size: 0.95rem;
    overflow-wrap: break-word;
    transition: background 0.2s;
    display: flex;
    gap: 10px;
}

.options-list li:hover {
    background: #f0ede6;
}

.options-list li strong {
    color: var(--gold-accent);
    font-weight: 700;
    flex-shrink: 0;
}

/* ===== 加载与空状态 ===== */
.loading-state,
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-grey);
    font-size: 1.1rem;
}

/* ===== 响应式 ===== */
@media (max-width: 860px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-brand {
        width: 100%;
    }

    .filter-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .filter-item {
        min-width: 140px;
        flex: 1;
    }

    .main-content {
        padding: 24px 16px;
    }
}
