/* ============================================
   在线答题考试系统 — 前台样式
   配色：暖装白 #F5F3EF / 微笑橙 #F55600 / 墨黑 #161D26
   字体：思源黑体 Bold (Noto Sans SC)
   ============================================ */

/* === 字体引入 === */
@font-face {
    font-family: 'Noto Sans SC';
    src: url('../fonts/NotoSansSC-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 700;
    background-color: #F5F3EF;
    color: #161D26;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #3BA9F7;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   首页 (index.php)
   ============================================ */
.page-home {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.home-container {
    width: 100%;
    max-width: 560px;
    text-align: center;
}

.home-logo {
    margin-bottom: 24px;
}

.logo-img {
    height: 48px;
    width: auto;
}

.home-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 2px 20px rgba(22, 29, 38, 0.06);
    text-align: left;
}

.home-title {
    font-size: 28px;
    color: #161D26;
    text-align: center;
    margin-bottom: 4px;
}

.home-subtitle {
    font-size: 14px;
    color: #A3AAB5;
    text-align: center;
    margin-bottom: 28px;
}

.home-rules {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.rule-item {
    flex: 1;
    background: #F5F3EF;
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
}

.rule-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 6px;
}

.rule-text strong {
    display: block;
    font-size: 13px;
    color: #161D26;
    margin-bottom: 2px;
}

.rule-text span {
    font-size: 12px;
    color: #A3AAB5;
}

.home-notice {
    background: #F5F3EF;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 28px;
}

.home-notice h3 {
    font-size: 15px;
    margin-bottom: 10px;
    color: #161D26;
}

.home-notice ul {
    list-style: none;
    padding: 0;
}

.home-notice li {
    font-size: 13px;
    color: #252F3E;
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

.home-notice li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #F55600;
    font-weight: bold;
}

/* 开始按钮 */
.btn-start {
    display: block;
    width: 100%;
    padding: 16px;
    font-family: inherit;
    font-weight: 700;
    font-size: 18px;
    color: #FFFFFF;
    background: #F55600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-start:hover {
    background: #e04d00;
}

.btn-start:active {
    transform: scale(0.98);
}

.btn-start:disabled {
    background: #A3AAB5;
    cursor: not-allowed;
}

.home-warning {
    text-align: center;
    color: #FF4061;
    font-size: 13px;
    margin-top: 12px;
}

.home-footer {
    margin-top: 20px;
    font-size: 12px;
    color: #A3AAB5;
}

/* ============================================
   答题页 (exam.php)
   ============================================ */
.page-exam {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.exam-container {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部栏 */
.exam-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo-img-small {
    height: 32px;
    width: auto;
}

.exam-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 20px;
    color: #161D26;
    background: #FFFFFF;
    padding: 8px 20px;
    border-radius: 24px;
    transition: color 0.3s, background 0.3s;
}

.exam-timer.timer-warning {
    color: #FF4061;
    background: #FFF0F0;
    animation: pulse 0.8s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.03); }
}

.timer-icon {
    font-size: 18px;
}

.exam-progress {
    font-size: 14px;
    color: #A3AAB5;
}

.exam-progress span:first-child {
    color: #F55600;
    font-size: 20px;
}

/* 题目区域 */
.exam-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    padding: 24px 0;
}

.question-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 36px 32px;
    width: 100%;
    box-shadow: 0 2px 20px rgba(22, 29, 38, 0.06);
    transition: all 0.3s;
}

.question-number {
    font-size: 13px;
    color: #A3AAB5;
    margin-bottom: 12px;
}

.question-text {
    font-size: 20px;
    color: #161D26;
    line-height: 1.5;
    margin-bottom: 28px;
}

/* 选项 */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    background: #FFFFFF;
    border: 2px solid #A3AAB5;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    color: #161D26;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.option-btn:hover {
    border-color: #F55600;
    background: #FFF8F5;
}

.option-btn:active {
    transform: scale(0.99);
}

.option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F5F3EF;
    color: #161D26;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.option-text {
    flex: 1;
}

/* 选项状态 */
.option-btn.selected {
    border-color: #F55600;
    background: #F55600;
    color: #FFFFFF;
}

.option-btn.selected .option-label {
    background: rgba(255,255,255,0.2);
    color: #FFFFFF;
}

.option-btn.correct-feedback {
    border-color: #25CB5C;
    background: #EDFFF5;
    color: #161D26;
}

.option-btn.wrong-feedback {
    border-color: #FF4061;
    background: #FFF0F3;
    color: #161D26;
}

.option-btn.disabled {
    pointer-events: none;
    opacity: 0.8;
}

/* 反馈区域 */
.feedback-area {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #E5E1D6;
    text-align: center;
}

.feedback-content {
    font-size: 18px;
    margin-bottom: 16px;
    padding: 12px 20px;
    border-radius: 10px;
    display: inline-block;
}

.feedback-content.feedback-correct {
    color: #25CB5C;
    background: #EDFFF5;
}

.feedback-content.feedback-wrong {
    color: #FF4061;
    background: #FFF0F3;
}

.btn-next {
    display: inline-block;
    padding: 12px 48px;
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    color: #FFFFFF;
    background: #F55600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-next:hover {
    background: #e04d00;
}

/* 底部 */
.exam-footer {
    text-align: center;
    padding: 16px 0;
    font-size: 13px;
    color: #A3AAB5;
}

.exam-footer span {
    color: #F55600;
}

/* ============================================
   时间到弹窗
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 29, 38, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 48px 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.modal-card h2 {
    font-size: 22px;
    color: #161D26;
    margin-bottom: 8px;
}

.modal-card p {
    font-size: 14px;
    color: #A3AAB5;
}

/* ============================================
   结果页 (result.php)
   ============================================ */
.page-result {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.result-container {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

/* 深色 Hero 区域 */
.result-hero {
    background: #252F3E;
    border-radius: 24px;
    padding: 40px 32px;
    color: #FFFFFF;
    margin-bottom: 24px;
}

.logo-img-white {
    height: 40px;
    width: auto;
    margin-bottom: 24px;
}

.result-score-wrap {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

.result-score {
    font-size: 72px;
    color: #9178F7;
    line-height: 1;
}

.result-score-label {
    font-size: 24px;
    color: #A3AAB5;
}

.result-status {
    font-size: 20px;
    padding: 8px 24px;
    border-radius: 24px;
    display: inline-block;
    margin-bottom: 12px;
}

.status-pass {
    background: rgba(37, 203, 92, 0.15);
    color: #25CB5C;
}

.status-fail {
    background: rgba(255, 64, 97, 0.15);
    color: #FF4061;
}

.result-pass-line {
    font-size: 13px;
    color: #A3AAB5;
}

/* 统计卡片 */
.result-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.stat-card {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 16px 8px;
    box-shadow: 0 2px 12px rgba(22, 29, 38, 0.04);
}

.stat-value {
    font-size: 22px;
    color: #161D26;
    margin-bottom: 2px;
    word-break: break-all;
}

.stat-label {
    font-size: 12px;
    color: #A3AAB5;
}

/* 正确率环形图 */
.result-chart {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(22, 29, 38, 0.04);
}

.donut-chart {
    position: relative;
    display: inline-block;
    margin-bottom: 8px;
}

.donut-chart svg {
    display: block;
}

.donut-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    color: #161D26;
}

.chart-label {
    font-size: 13px;
    color: #A3AAB5;
}

/* 考试信息 */
.result-info {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(22, 29, 38, 0.04);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid #E5E1D6;
}

.info-row span:first-child {
    color: #A3AAB5;
}

.info-row span:last-child {
    color: #161D26;
}

/* 操作按钮 */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.btn-retake {
    display: block;
    width: 100%;
    padding: 16px;
    font-family: inherit;
    font-weight: 700;
    font-size: 18px;
    color: #FFFFFF;
    background: #F55600;
    border-radius: 12px;
    text-align: center;
    transition: background 0.2s;
}

.btn-retake:hover {
    background: #e04d00;
}

.btn-home-link {
    font-size: 14px;
    color: #A3AAB5;
}

.btn-home-link:hover {
    color: #161D26;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 600px) {
    .home-card { padding: 28px 20px; }
    .home-rules { flex-direction: column; }
    .home-title { font-size: 24px; }
    .question-card { padding: 24px 20px; }
    .question-text { font-size: 17px; }
    .result-stats { grid-template-columns: repeat(2, 1fr); }
    .result-score { font-size: 56px; }
    .exam-header { padding: 10px 0; }
    .exam-timer { font-size: 16px; padding: 6px 14px; }
}
