/* =========================================
   1. Writing Page Variables
   ========================================= */
:root {
    --color-writing-primary: #c0392b;   /* 深红 - 核心色 */
    --color-writing-light: #e74c3c;     /* 亮红 - 强调色 */
    --color-writing-dark: #8e1e13;      /* 暗红 - 背景色 */
    
    --bg-ladder: #fdfbf7;               /* 纸张背景色 */
    --bg-rules: #2c3e50;                /* 深色背景 */
    
    --font-academic: 'Merriweather', 'Playfair Display', serif; /* 增加 Merriweather 适合正文阅读 */
}

/* =========================================
   2. Hero Section
   ========================================= */
.writing-hero {
    background: linear-gradient(135deg, #fff 0%, #fef9f8 100%);
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 装饰背景：笔尖/墨迹 */
.writing-hero::before {
    content: '\f303'; /* FontAwesome Pen Nib */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -50px; right: -50px;
    font-size: 20rem;
    color: rgba(192, 57, 43, 0.03);
    transform: rotate(15deg);
}

.hero-tag {
    display: inline-block;
    background: rgba(192, 57, 43, 0.1);
    color: var(--color-writing-primary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 25px;
    border: 1px solid rgba(192, 57, 43, 0.2);
}

.hero-title {
    font-size: 3.5rem;
    color: #2c3e50;
    margin-bottom: 25px;
    line-height: 1.2;
}

.hero-desc {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.2rem;
    color: #7f8c8d;
    line-height: 1.8;
}

.hero-desc b {
    color: var(--color-writing-primary);
    border-bottom: 2px solid rgba(192, 57, 43, 0.3);
}

/* =========================================
   3. Ladder Section (The 7 Levels)
   ========================================= */
.ladder-section {
    padding: 80px 0;
    background-color: var(--bg-ladder);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.ladder-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding-left: 40px; /* Space for badges */
}

/* 垂直连接线 */
.ladder-line {
    position: absolute;
    top: 20px; bottom: 20px;
    left: 19px; /* Centered with badges */
    width: 2px;
    background: linear-gradient(to bottom, #bdc3c7 0%, #e74c3c 50%, #8e44ad 100%);
    z-index: 1;
}

.ladder-step {
    position: relative;
    margin-bottom: 40px;
}

/* 等级徽章 */
.level-badge {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #bdc3c7;
    color: #95a5a6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    z-index: 2;
    box-shadow: 0 0 0 5px var(--bg-ladder); /* Creates gap effect */
    transition: all 0.3s ease;
}

/* 卡片样式 */
.step-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    margin-left: 30px;
}

.step-card:hover {
    transform: translateX(10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.sentence {
    font-family: var(--font-academic);
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    line-height: 1.5;
}

.analysis {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.tag {
    background: #f1f2f6;
    color: #7f8c8d;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-top: 3px;
}

.analysis p {
    font-size: 0.95rem;
    color: #636e72;
    margin: 0;
    line-height: 1.6;
}

/* --- 等级颜色定义 --- */

/* Basic (Lv 1-2) */
.ladder-step.basic .level-badge { border-color: #bdc3c7; color: #7f8c8d; }

/* Intermediate (Lv 3-4) */
.ladder-step.intermediate .level-badge { border-color: #3498db; color: #3498db; }
.ladder-step.intermediate .tag { background: rgba(52, 152, 219, 0.1); color: #2980b9; }

/* Advanced (Lv 5-6) */
.ladder-step.advanced .level-badge { border-color: #e67e22; color: #e67e22; }
.ladder-step.advanced .tag { background: rgba(230, 126, 34, 0.1); color: #d35400; }

/* Master (Lv 7) */
.ladder-step.master .level-badge { 
    border-color: #8e44ad; 
    background: #8e44ad; 
    color: #fff; 
    width: 50px; height: 50px; 
    left: -45px; /* Adjust centering */
    font-size: 1.2rem;
}
.ladder-step.master .step-card {
    border: 1px solid rgba(142, 68, 173, 0.3);
    background: linear-gradient(to right, #fdfaff, #fff);
}
.ladder-step.master .sentence { color: #8e44ad; font-weight: 600; }
.ladder-step.master .tag { background: #8e44ad; color: #fff; }

/* =========================================
   4. Rules Section (The Constitution)
   ========================================= */
.rules-section {
    background-color: var(--bg-rules);
    color: #fff;
    padding: 80px 0;
}

.rules-header {
    text-align: center;
    margin-bottom: 60px;
}

.rules-header h2 {
    color: #fff;
    margin-bottom: 10px;
}

.rules-header p {
    color: rgba(255,255,255,0.6);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.rule-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.rule-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-5px);
}

.rule-num {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: rgba(255,255,255,0.1);
    font-weight: 900;
    margin-bottom: 10px;
}

.rule-card h3 {
    font-size: 1.4rem;
    color: #f1c40f; /* 金色标题 */
    margin-bottom: 15px;
}

.rule-card p {
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

.examples {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Lato', sans-serif;
}

.ex { margin-bottom: 5px; }
.ex:last-child { margin-bottom: 0; }

.ex.wrong { color: #ff7675; text-decoration: line-through; opacity: 0.8; }
.ex.right { color: #55efc4; font-weight: 700; }
.ex i { width: 20px; display: inline-block; }

/* =========================================
   5. Footer CTA
   ========================================= */
.writing-footer {
    background: #fff;
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid #eee;
}

.writing-footer p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 30px;
}

.btn-cta {
    display: inline-block;
    background-color: var(--color-writing-primary);
    color: #fff;
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-cta:hover {
    background-color: var(--color-writing-dark);
    box-shadow: 0 10px 20px rgba(192, 57, 43, 0.3);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .ladder-container { padding-left: 20px; }
    .level-badge { width: 30px; height: 30px; font-size: 0.7rem; left: -35px; }
    .ladder-line { left: -20px; } /* Hide line on very small screens or adjust */
    .ladder-step { margin-left: 0; }
    .step-card { margin-left: 0; margin-top: 10px; }
    .level-badge { position: relative; left: 0; top: 0; transform: none; margin-bottom: 10px; display: inline-flex; }
    .ladder-line { display: none; } /* Remove line on mobile for cleaner stack */
}

/* =========================================
   Mobile Optimization (Writing Page)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Hero 区域 */
    .writing-hero {
        padding: 100px 0 60px;
    }
    .writing-hero::before {
        font-size: 10rem; /* 背景的大钢笔图标变小点 */
        top: -20px;
        right: -20px;
        opacity: 0.05;
    }

    /* 2. 阶梯图变成时间轴 */
    .ladder-container {
        padding-left: 0; /* 取消左边距 */
    }
    
    .ladder-line {
        left: 20px; /* 线条靠左 */
    }
    
    .ladder-step {
        margin-left: 40px; /* 卡片往右挪，避开线 */
        margin-bottom: 30px;
    }
    
    .level-badge {
        left: -35px; /* 徽章挂在线上 */
        width: 35px;
        height: 35px;
        font-size: 0.75rem;
    }
    
    .step-card {
        margin-left: 0; /* 卡片紧贴内容区 */
        padding: 20px;
    }
    
    .sentence {
        font-size: 1.1rem; /* 英文句子字体微调 */
    }
    
    /* 3. 11条军规卡片 */
    .rules-grid {
        grid-template-columns: 1fr; /* 单列展示 */
    }
}