/* --- 全局和字体设置 --- */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

:root {
    --primary-color: #E91E63; /* 图片中的粉红色 */
    --correct-color: #D4EDDA; /* 绿色背景 */
    --correct-text-color: #155724;
    --selected-border-color: #007BFF; /* 蓝色边框 */
    --text-color: #333;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
}

body {
    font-family: 'Lato', sans-serif;
    margin: 0;
    background-color: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* --- 顶部导航栏 --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
}

.main-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-nav li {
    display: inline-block;
    margin: 0 15px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    padding-bottom: 5px;
}

.main-nav a.active, .main-nav a:hover {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
}

.search-bar {
    position: relative;
    margin-right: 1rem;
}

.search-bar input {
    padding: 8px 30px 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

.search-bar .fa-search {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: #aaa;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
}

/* --- 面包屑导航 --- */
.breadcrumbs {
    margin-bottom: 1.5rem;
    color: #6c757d;
}
.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}

/* --- 测试主区域 --- */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.jump-to select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.question-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.question-text {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

/* --- 答案选项 --- */
.answer-options .option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.answer-options .option:hover {
    background-color: #f1f1f1;
}

.answer-options input[type="radio"] {
    display: none; /* 隐藏原生 radio 按钮 */
}

/* 自定义 radio 按钮样式 */
.answer-options label {
    cursor: pointer;
    padding-left: 35px;
    position: relative;
    width: 100%;
}

.answer-options label::before {
    /*
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;*/
}

.answer-options label::after {
    /*
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: var(--selected-border-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;*/
}

.answer-options input[type="radio"]:checked + label::after {
    opacity: 1;
}

/* 状态样式 */
.option.selected {
    border-color: var(--selected-border-color);
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.option.correct {
    background-color: var(--correct-color);
    border-color: var(--correct-text-color);
    color: var(--correct-text-color);
}

.option.disabled {
    cursor: not-allowed;
    pointer-events: none; /* 禁止再次点击 */
}

/* --- 解释区域 --- */
.explanation {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: #fdfdfd;
}

.explanation-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #555;
}

/* --- 卡片底部 --- */
.card-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.previous-question, .end-session,.back_list, .submit, .next-question {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
}

.next-question {
    display: flex;
    align-items: center;
    gap: 5px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6c757d;
}

.upvote, .share {
    display: flex;
    align-items: center;
}

.upvote-btn, .share-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
}
.upvote-btn i {
    color: #28a745;
}