/*
 * 交易手册 · 排版系统 V2
 * 基于中文阅读体验优化的书籍级排版
 */

/* ===== 阅读环境 ===== */
.manual-article {
    max-width: 42em;           /* 中文45-55字/行 最佳阅读宽度 */
    margin: 0 auto;
    padding: 0 24px 120px;
    font-family: "Noto Serif CJK SC", "Source Han Serif SC", "STSong", "SimSun", "Songti SC", Georgia, serif;
    font-size: 17px;
    line-height: 1.85;
    color: #2a2a2a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 章节标题 */
.manual-article-title {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
    margin: 48px 0 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #1a1a1a;
    line-height: 1.3;
}

/* 阅读时间 / 字数统计 */
.manual-meta {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
    font-size: 13px;
    color: #999;
    margin: -32px 0 32px;
    display: flex; gap: 20px;
}

/* 三级标题：如 一、二、三... */
.manual-h3 {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 56px 0 16px;
    padding: 0;
    letter-spacing: -0.01em;
}

/* 四级标题：如 1. 2. 3. */
.manual-h4 {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 36px 0 12px;
    padding: 0;
}

/* 正文段落 */
.manual-p {
    margin: 0 0 22px;
    text-align: justify;
    text-justify: inter-ideograph;
    hyphens: auto;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 上间距继承，连续段落不堆叠 */
.manual-p + .manual-p { margin-top: 0; }

/* ===== 军事引用（孙子兵法） ===== */
.manual-quote {
    margin: 32px 0;
    padding: 24px 28px;
    background: linear-gradient(to right, #f5f5f5, #fafafa);
    border-left: 4px solid #bbb;
    color: #555;
    font-size: 15px;
    line-height: 2.0;
    position: relative;
}

.manual-quote::before {
    content: '';
    position: absolute;
    left: -4px; top: 0; bottom: 0;
    width: 4px;
    background: #2c3e50;
    opacity: 0;
    transition: opacity 0.3s;
}

.manual-quote:hover::before { opacity: 1; }

/* ===== 关键规则卡片 ===== */
.manual-keyrule {
    margin: 28px 0;
    padding: 20px 24px 20px 56px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.9;
    color: #444;
    position: relative;
}

.manual-keyrule::before {
    content: '#';
    position: absolute;
    left: 20px; top: 22px;
    font-size: 20px;
    font-weight: 900;
    color: #2c3e50;
    opacity: 0.4;
}

/* ===== 对话行 ===== */
.manual-dialogue {
    margin: 12px 0;
    padding: 8px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #777;
    border-left: 2px solid transparent;
    transition: border-color 0.2s;
}

.manual-dialogue:hover {
    border-left-color: #ddd;
    color: #555;
}

/* ===== 表格容器 ===== */
.manual-table-wrap {
    margin: 32px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.manual-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.manual-table thead { position: sticky; top: 0; z-index: 1; }

.manual-table th {
    background: #1a1a1a;
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    white-space: nowrap;
}

.manual-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.manual-table tbody tr:hover td {
    background: #fafafa;
}

.manual-table tbody tr:last-child td {
    border-bottom: 2px solid #1a1a1a;
}

/* ===== 阅读进度条 ===== */
.manual-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: linear-gradient(to right, #2c3e50, #c0392b);
    z-index: 10000;
    transition: width 0.1s linear;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .manual-article {
        max-width: 100%;
        padding: 0 16px 80px;
        font-size: 16px;
        line-height: 1.8;
    }
    .manual-article-title { font-size: 23px; margin: 32px 0 28px; }
    .manual-h3 { font-size: 17px; margin: 40px 0 12px; }
    .manual-table-wrap { margin: 20px -16px; }
    .manual-table { font-size: 12px; }
    .manual-table th, .manual-table td { padding: 8px 10px; }
}

@media (max-width: 480px) {
    .manual-article { font-size: 15px; padding: 0 12px 60px; }
    .manual-article-title { font-size: 20px; }
    .manual-quote { padding: 16px 18px; font-size: 14px; }
}
