/* ===== 全局基础重置 & 新闻专业基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    /* 新闻行业标准宋体/无衬线字体，正式优雅 */
    font-family: "PingFang SC", "Microsoft YaHei", "SimSun", 宋体, sans-serif;
    /* 正文标准新闻深灰，不刺眼、阅读舒适 */
    color: #212529;
    /* 素雅浅灰底色，替代纯白，高级不刺眼 */
    background-color: #f8f9fa;
    line-height: 1.7;
}

/* ===== 步骤进度条样式（商务稳重、无花哨色彩） ===== */
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.55;
    transition: opacity 0.3s ease;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 0.85;
}

.step-circle {
    width: 32px;
    height: 32px;
    /* 去除大圆角，改为轻微圆角，商务规整 */
    border-radius: 3px;
    background: #e9ecef;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* 替换高饱和蓝绿，使用新闻专业深灰蓝、沉稳墨绿 */
.step-item.active .step-circle {
    background: #2c5282;
    color: #ffffff;
}

.step-item.completed .step-circle {
    background: #2f855a;
    color: #ffffff;
}

.step-label {
    font-size: 12px;
    color: #6c757d;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.step-item.active .step-label {
    color: #2c5282;
    font-weight: 500;
}

.step-line {
    width: 40px;
    height: 2px;
    background: #dee2e6;
    transition: background 0.3s ease;
}

.step-line.active,
.step-line.completed {
    background: #2f855a;
}

/* ===== 步骤区域切换 ===== */
.step-section {
    display: none;
}

.step-section.active {
    display: block;
}

/* ===== 案例卡片样式（核心优化：新闻简约质感） ===== */
.case-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    /* 取消大圆角，新闻风格直角微圆弧 */
    border-radius: 4px;
    /* 加大上下内边距，提升阅读呼吸感 */
    padding: 20px 24px;
    transition: all 0.3s ease;
    /* 轻微阴影，克制不浮夸 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.case-card:hover {
    border-color: #2c5282;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: none; /* 取消悬浮位移，保持新闻稳重感 */
}

/* 来源标签：去除鲜艳马卡龙色，统一新闻素雅配色 */
.source-tag {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 2px;
    background: #f1f3f5;
    color: #495057;
    letter-spacing: 0.3px;
}

.source-tag.cctv {
    background: #f8f9fa;
    color: #856404;
    border: 1px solid #ffeeba;
}

.source-tag.rmw {
    background: #f8f9fa;
    color: #2c5282;
    border: 1px solid #bfd3e6;
}

.source-tag.rmfz {
    background: #f8f9fa;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ===== 分类按钮样式（弱化花哨动效） ===== */
.category-btn {
    transition: color 0.2s ease, border-color 0.2s ease;
}

.category-btn:hover {
    transform: none; /* 取消平移，保持规整 */
    color: #2c5282;
}

/* ===== 拖拽卡片样式（新闻商务简约） ===== */
.drag-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 18px 22px;
    cursor: grab;
    transition: all 0.25s ease;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.drag-card:hover {
    border-color: #2c5282;
    box-shadow: 0 2px 6px rgba(44, 82, 130, 0.08);
}

.drag-card.dragging {
    opacity: 0.65;
    border-color: #2c5282;
    cursor: grabbing;
}

/* 去除渐变亮色背景，改用素雅纯色 */
.drag-card.matched {
    border-color: #2f855a;
    background-color: #f7fbf9;
}

.drag-card.error {
    border-color: #c53030;
    background-color: #fef7f7;
}

.drag-card.locked {
    border-color: #2f855a;
    background-color: #f7fbf9;
    cursor: not-allowed;
    opacity: 0.85;
    pointer-events: none;
}

/* ===== 分类框样式 ===== */
.category-box {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 18px 22px;
    text-align: center;
    transition: all 0.25s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.category-box:hover {
    border-color: #2c5282;
}

.category-box.drag-over {
    border-color: #2c5282;
    background-color: #f5f8fc;
    transform: none; /* 取消放大浮夸效果 */
}

.category-box.matched {
    border-color: #2f855a;
    background-color: #f7fbf9;
}

.category-box.error {
    border-color: #c53030;
    background-color: #fef7f7;
}

/* ===== 连线样式（沉稳单色，无高饱和） ===== */
.connection-line {
    fill: none;
    stroke: #2c5282;
    stroke-width: 2.2;
    stroke-linecap: round;
    opacity: 0.85;
}

.connection-line.temp {
    stroke: #94a3b8;
    stroke-width: 1.8;
    opacity: 0.6;
}

.connection-line.correct,
.connection-line.locked {
    stroke: #2f855a;
    stroke-width: 2.5;
}

.connection-line.error {
    stroke: #c53030;
    stroke-width: 2.2;
    opacity: 0.8;
}

/* ===== 弹窗样式（稳重淡入，无夸张缩放） ===== */
#category-detail-modal.show,
#case-detail-modal.show,
#result-modal.show {
    animation: modalFadeIn 0.3s forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#category-detail-modal.show > div,
#case-detail-modal.show > div,
#result-modal.show > div {
    animation: modalSlideIn 0.3s forwards;
}

@keyframes modalSlideIn {
    from {
        opacity: 0.9;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 游戏容器 ===== */
.game-container {
    min-height: 500px;
    padding: 10px 0;
}

/* ===== 按钮通用样式（新闻简约风） ===== */
#submit-btn,
#view-summary-btn,
#case-detail-link1,
#case-detail-link2 {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border-radius: 3px;
}

#submit-btn:not(:disabled):hover,
#view-summary-btn:hover,
#case-detail-link1:hover,
#case-detail-link2:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#view-summary-btn:hover {
    box-shadow: 0 2px 6px rgba(47, 133, 90, 0.12);
}

/* ===== 案例详情弹窗图片 ===== */
#case-detail-image {
    object-fit: cover;
    background: #f1f3f5;
    border-radius: 4px;
}

/* ===== 高亮效果（弱化刺眼黄色，改用低调商务黄） ===== */
.drag-card.highlighted {
    border-color: #d69e2e;
    box-shadow: 0 0 0 2px rgba(214, 158, 46, 0.15);
}

/* ===== 加载状态 ===== */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 响应式布局（保留规整间距） ===== */
@media (max-width: 640px) {
    .step-label {
        font-size: 10px;
    }
    
    .step-circle {
        width: 28px;
        height: 28px;
    }
    
    .step-line {
        width: 20px;
    }
    
    .game-container {
        min-height: 600px;
    }

    .case-card, .drag-card, .category-box {
        padding: 16px 18px;
    }
}

@media (max-width: 1023px) {
    .drag-card {
        margin-bottom: 16px;
    }
    
    .category-box {
        margin-bottom: 16px;
    }
}

/* ===== 打印样式（新闻打印适配，整洁无冗余） ===== */
@media print {
    body {
        background: #fff;
    }

    .step-section {
        display: block !important;
    }
    
    #step2 {
        display: none !important;
    }
    
    header, .no-print {
        display: none !important;
    }

    .case-card, .drag-card, .category-box {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ===== 滚动条（简约商务风） ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 0;
}

::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #86909c;
}

/* ===== 文本选择 ===== */
.drag-card,
.category-box {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ===== 禁用状态 ===== */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== 全局过渡动画（统一克制） ===== */
.case-card,
.drag-card,
.category-box,
button {
    transition: all 0.25s ease;
}

/* ===== 暗色模式（专业素雅深色新闻风） ===== */
@media (prefers-color-scheme: dark) {
    body {
        background: #121417;
        color: #e9ecef;
    }
    
    .case-card,
    .drag-card,
    .category-box,
    .bg-white {
        background: #1e2126;
        border-color: #343a40;
    }
    
    .text-gray-800 {
        color: #e9ecef;
    }
    
    .text-gray-600 {
        color: #adb5bd;
    }
    
    .text-gray-500 {
        color: #86909c;
    }

    .drag-card.matched {
        background-color: #1a2922;
    }

    .drag-card.error {
        background-color: #2b1b1d;
    }

    .category-box.drag-over {
        background-color: #1a222d;
    }
}

/* ===== 焦点样式（简约无障碍） ===== */
button:focus,
.drag-card:focus,
.category-box:focus {
    outline: 1px solid #2c5282;
    outline-offset: 2px;
}

/* ===== 无障碍动画优化 ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}