/* Internal Medicine Logic Simulator Styles */

/* Base & Layout */
.im-home {
    text-align: center;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.disease-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.disease-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 18px 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 文字过长时省略 */
    overflow: hidden;
    word-break: break-all;
}

.disease-card:hover {
    border-color: #5d4037;
    background: #fdf5e6;
    /* Antique White */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Step Container */
.step-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fafafa;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.slide-in {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Case Card */
.case-card {
    background: #fff;
    border-left: 4px solid #5d4037;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.case-card h3 {
    margin-top: 0;
    color: #5d4037;
    font-size: 1.1em;
}

.case-card p.highlight {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

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

.btn-option {
    padding: 15px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.btn-option:hover {
    background: #f5f5f5;
}

.btn-option.correct {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
    position: relative;
}

.btn-option.correct::after {
    content: "✓";
    position: absolute;
    right: 20px;
    font-weight: bold;
}

.btn-option.wrong {
    background: #ffebee;
    border-color: #ef5350;
    color: #c62828;
    animation: shake 0.4s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Tag Cloud (Step 2) */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.tag {
    padding: 8px 16px;
    background: #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    user-select: none;
}

.tag.selected {
    background: #5d4037;
    color: #fff;
}

.tag.correct {
    background: #4caf50;
    color: #fff;
}

.tag.wrong {
    background: #ef5350;
    color: #fff;
}

.btn-next {
    margin-top: 25px;
    width: 100%;
    padding: 15px;
    background: #5d4037;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.btn-next.hidden {
    display: none;
}

/* Flip Card (Step 3) */
.card-flip-container {
    perspective: 1000px;
    height: 120px;
    margin: 20px 0;
    cursor: pointer;
}

.card-front,
.card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: transform 0.6s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-front {
    background: #f5f5f5;
    color: #666;
    border: 2px dashed #ccc;
    transform: rotateY(0deg);
}

.card-back {
    background: #fff;
    color: #333;
    border: 2px solid #5d4037;
    transform: rotateY(180deg);
}

.card-flip-container.flipped .card-front {
    transform: rotateY(-180deg);
}

.card-flip-container.flipped .card-back {
    transform: rotateY(0deg);
}

/* Answer Sheet (Step 5) */
.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.answer-sheet.paper-texture {
    background: #fffdf5;
    /* Off-white paper */
    background-image:
        linear-gradient(#e0e0e0 1px, transparent 1px),
        linear-gradient(90deg, #e0e0e0 1px, transparent 1px);
    background-size: 20px 20px;
    /* Grid */
    border: 2px solid #444;
    padding: 30px;
    font-family: 'Kaiti', 'KaiTi', serif;
    /* Handwriting font if available */
    color: #000;
    position: relative;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.1);
}

.sheet-row {
    margin-bottom: 15px;
    display: flex;
    align-items: baseline;
    border-bottom: 1px solid #aaa;
    padding-bottom: 5px;
}

.sheet-row label {
    font-weight: bold;
    font-family: sans-serif;
    /* Printed label */
    margin-right: 10px;
    min-width: 80px;
}

.handwriting {
    font-size: 1.1em;
    color: #00008b;
    /* Blue ink */
    flex: 1;
}

.sheet-section {
    margin-bottom: 20px;
    border: 2px solid #aaa;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
}

.sheet-section label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    font-family: sans-serif;
}

.interactive-section {
    cursor: pointer;
    border-color: #5d4037;
    border-style: dashed;
    transition: all 0.3s;
}

.interactive-section:hover {
    background: #fdf5e6;
}

.hidden-content {
    filter: blur(5px);
    transition: filter 0.3s;
    min-height: 40px;
}

.interactive-section.expanded .hidden-content {
    filter: blur(0);
}

.highlight-red {
    color: #d32f2f;
    font-weight: bold;
}

.dosage-note {
    font-size: 0.8em;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}

/* ========== 答题卡夜间模式 ========== */

[data-theme="dark"] .answer-sheet.paper-texture {
    background: #2a2a2a;
    background-image:
        linear-gradient(#444 1px, transparent 1px),
        linear-gradient(90deg, #444 1px, transparent 1px);
    border-color: #555;
}

[data-theme="dark"] .sheet-row label,
[data-theme="dark"] .sheet-section label {
    color: #aaa;
}

[data-theme="dark"] .handwriting {
    color: #64b5f6;
    /* 夜间模式使用亮蓝色 */
}

[data-theme="dark"] .sheet-section {
    background: rgba(40, 40, 40, 0.8);
    border-color: #555;
}

[data-theme="dark"] .interactive-section {
    border-color: #666;
}

[data-theme="dark"] .interactive-section:hover {
    background: #333;
}

[data-theme="dark"] .hidden-content {
    color: #ccc;
}

[data-theme="dark"] .highlight-red {
    color: #ff8a80;
}

[data-theme="dark"] .dosage-note {
    color: #888;
}