/* ================================================================
   菜刀客在线工具页 · xingge.html 私有样式
   需在 /css/common.css 之后加载。
   ================================================================ */

/* ---- 面板对调：逐题作答（宽）在左，测试说明（400px）在右，宽度保持互换前原值 ---- */
.main {
    grid-template-columns: 1fr 400px;
}

@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }
}

/* ---- 页面宽度小于 600px 时隐藏复制结果 / 下载按钮 ---- */
@media (max-width: 600px) {
    #copyResultBtn,
    #downloadBtn {
        display: none;
    }
}

/* ---- 页面宽度小于 610px 时隐藏导航列表，改用 ☰ 折叠菜单 ---- */
@media (max-width: 610px) {
    #topNav .nav-list {
        display: none;
    }
    #topNav .nav-toggle {
        display: inline-flex;
    }
    #topNav.open .nav-dropdown {
        display: block;
    }
}

/* ---- 题目舞台（滑动容器）：高度按内容撑开 ---- */
.quiz-stage {
    position: relative;
    overflow: hidden;
    min-height: 340px;
}

.quiz-card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 24px 24px;
    background: #fff;
    will-change: transform, opacity;
}

/* 状态类顺序：onscreen 必须在 from-* / slide-out-* 之后，保证覆盖生效 */
.quiz-card.onscreen { transform: translateX(0); opacity: 1; }
.quiz-card.slide-out-left { transform: translateX(-105%); opacity: 0; }
.quiz-card.slide-out-right { transform: translateX(105%); opacity: 0; }
.quiz-card.from-left { transform: translateX(-105%); opacity: 0; }
.quiz-card.from-right { transform: translateX(105%); opacity: 0; }

.quiz-card { transition: transform 260ms ease, opacity 260ms ease; }

/* ---- 结果明细行：小尺寸下保持横向，不被压缩成竖向 ---- */
.summary-row {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 10px;
}

.summary-row .item-name {
    flex: 0 0 auto;
    white-space: nowrap;
}

.summary-row .item-value {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    overflow-wrap: break-word;
    padding-left: 5px;
}

/* ---- 进度条 ---- */
.progress-track {
    height: 6px;
    border-radius: 3px;
    background: #eef2ff;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 320ms ease;
}

/* ---- 题号 ---- */
.quiz-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
    font-weight: 600;
}

/* ---- 题干加大加粗 ---- */
.quiz-text {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 22px;
}

/* ---- 选项卡片 ---- */
.quiz-opts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.quiz-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: left;
}

.quiz-opt:hover {
    border-color: #667eea;
    background: #eef2ff;
    transform: translateY(-1px);
}

.quiz-opt.selected {
    border-color: #667eea;
    background: #eef2ff;
    color: #4338ca;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.opt-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    border-radius: 50%;
    color: #667eea;
    background: #eef2ff;
}

.quiz-opt.selected .opt-icon {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ---- 结果页样式 ---- */
.result-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-type {
    font-size: 18px;
    font-weight: 700;
    color: #4338ca;
    text-align: center;
    padding: 14px;
    background: #eef2ff;
    border-radius: 8px;
}

.result-desc {
    font-size: 14px;
    line-height: 1.8;
    color: #4b5563;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 14px 16px;
}

.result-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.result-actions .btn { flex: 1; }