/* ============================================================
   初中英语语法重构 · 6大可视化专属组件样式 visualization.css
   ============================================================ */

/* 1. 句子积木解剖台 (Sentence Dissection Block) */
.sentence-dissect {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px 6px;
    flex-wrap: wrap;
    margin: 22px 0;
    font-size: 16px;
    font-weight: bold;
    background: #f8fafc;
    border-radius: 14px;
    padding: 22px 20px 24px;
    border: 1.5px solid #e2e8f0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}
.word-block {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.word-text {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 900;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    background: #f8fafc;
    color: #334155;
    border: 2px solid #cbd5e1;
    transition: all 0.15s ease;
}
.word-label {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.45;
    color: #64748b;
    max-width: 145px;
    margin-top: 2px;
}
.plus-sign {
    font-size: 18px;
    color: #94a3b8;
    margin: 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    line-height: 1;
    font-weight: 900;
    padding: 0;
}

/* 2. 车型四零件四宫格 (Car Parts Grid) */
.car-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 22px 0;
}
.car-cell {
    border-radius: 12px;
    padding: 20px 18px;
    text-align: center;
    border: 2px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
}
.car-cell:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.06); }
.car-cell .car-icon { font-size: 38px; margin-bottom: 8px; line-height: 1; }
.car-cell .car-role { font-size: 12px; font-weight: bold; letter-spacing: 0.05em; margin-bottom: 4px; }
.car-cell .car-name { font-size: 18px; font-weight: 900; margin-bottom: 4px; }
.car-cell .car-eng { font-size: 13.5px; margin-bottom: 8px; font-weight: 600; }
.car-cell .car-desc { font-size: 13px; line-height: 1.65; }

.cc-noun { background: #fff3e0; border-color: #ffb74d; color: #e65100; }
.cc-verb { background: #fce4ec; border-color: #f48fb1; color: #c62828; }
.cc-adj  { background: #e3f2fd; border-color: #90caf9; color: #1565c0; }
.cc-adv  { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }

/* 3. 3步做题流程卡 (Step Flow) */
.step-flow {
    display: flex;
    gap: 0;
    margin: 22px 0;
    align-items: stretch;
    border-radius: 14px;
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.03);
}
.step-item {
    flex: 1;
    padding: 20px 16px;
    text-align: center;
    position: relative;
    background: #fff;
}
.step-item:not(:last-child) { border-right: 1.5px solid #e2e8f0; }
.step-item::after {
    content: '→';
    position: absolute;
    right: -11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 900;
    color: #94a3b8;
    z-index: 2;
    background: #f8fafc;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
}
.step-item:last-child::after { display: none; }
.step-num-big {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 16px;
    margin: 0 auto 10px;
}
.step-item h4 { font-size: 15px; font-weight: 900; margin-bottom: 6px; }
.step-item p  { font-size: 13px; line-height: 1.6; color: #64748b; }
.step-item .step-eg { font-size: 12px; margin-top: 8px; padding: 4px 8px; border-radius: 6px; font-weight: bold; }

/* 4. 易错对错显微镜 (Error Comparison Cards) */
.wrong-text { color: #dc2626; font-size: 16px; font-weight: bold; text-decoration: line-through; }
.right-text { color: #16a34a; font-size: 16px; font-weight: bold; }
.compare-box {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 14px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

/* 5. 辨析与规则对比表格 (Magic Table) */
.magic-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.04);
    font-size: 14px;
    border: 1.5px solid #e2e8f0;
}
.magic-table th {
    background: var(--primary);
    color: var(--accent);
    padding: 13px 16px;
    text-align: left;
    font-size: 14.5px;
    font-weight: 900;
}
.magic-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    line-height: 1.65;
    color: #334155;
}
.magic-table tr:last-child td { border-bottom: none; }
.magic-table tr:hover td { background: #f8fafc; }

/* 6. 从句套娃夹心盒 (Clause Box) */
.clause-outer-box {
    background: #f8fafc;
    border: 2px solid #334155;
    border-radius: 14px;
    padding: 22px;
    margin: 20px 0;
}
.clause-inner-box {
    background: #fdf4ff;
    border: 2px dashed #a855f7;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 12px 0;
}

/* 7. 考前救命小抄 V2 (Print-friendly Cheatsheet) */
.cheatsheet-v2 {
    margin: 40px 0 28px;
    background: #fffdf5;
    border: 2px solid var(--accent);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    color: var(--primary);
}
.cheatsheet-v2-header {
    background: linear-gradient(135deg, #fff3c4, #fff8df);
    border-bottom: 2px solid var(--accent);
    padding: 16px 22px 14px;
}
.cheatsheet-v2-title {
    font-size: 19px;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 4px;
}
.cheatsheet-v2-subtitle {
    font-size: 13px;
    color: #7d6608;
    line-height: 1.6;
}
.cheatsheet-v2-body { padding: 18px 20px; }
.cheat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.cheat-card {
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-left: 5px solid #3498db;
    border-radius: 8px;
    padding: 12px 14px;
}
.cheat-card.core { border-left-color: #e74c3c; }
.cheat-card.method { border-left-color: #2980b9; }
.cheat-card.trap { border-left-color: #e67e22; }
.cheat-card.example { border-left-color: #27ae60; }
.cheat-card.memory { border-left-color: #8e44ad; }
.cheat-card.exam { border-left-color: #16a085; }
.cheat-card h4 {
    font-size: 14.5px;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 6px;
}
.cheat-card p, .cheat-card li {
    font-size: 13.5px;
    color: #444;
    line-height: 1.65;
    margin: 3px 0;
}
.cheat-card ul { padding-left: 18px; margin: 4px 0 0; }
.cheat-rule {
    display: inline-block;
    background: #fff3c4;
    color: #7d6608;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 4px;
}
.cheat-good { color: #1e8449; font-weight: 900; }
.cheat-bad { color: #c0392b; font-weight: 900; text-decoration: line-through; }
.cheatsheet-v2-footer {
    margin-top: 12px;
    background: #f8f9fa;
    border: 1.5px dashed #d0d0d0;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 13.5px;
    line-height: 1.65;
    color: #333;
}
.cheatsheet-v2-footer strong { color: #c0392b; }

/* ============================================================
   移动端可视化组件响应式增强
   ============================================================ */
@media (max-width: 680px) {
    .car-grid, .cheat-grid { grid-template-columns: 1fr; gap: 12px; }
    .step-flow { flex-direction: column; }
    .step-item:not(:last-child) { border-right: none; border-bottom: 1.5px solid #e0e0e0; }
    .step-item::after { display: none; }
    
    .sentence-dissect {
        padding: 16px 12px 18px;
        gap: 8px 4px;
    }
    .word-block { gap: 6px; }
    .word-text {
        padding: 6px 12px;
        font-size: 14px;
        min-height: 38px;
        border-radius: 8px;
    }
    .plus-sign {
        height: 38px;
        font-size: 16px;
    }
    .word-label {
        font-size: 11px;
        max-width: 120px;
    }
    
    .magic-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 16px 0;
    }
    .magic-table th, .magic-table td {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .compare-box { padding: 14px 16px; }
    .wrong-text, .right-text { font-size: 15px; }
    .clause-outer-box { padding: 16px 14px; }
    .clause-inner-box { padding: 10px 12px; }
}
