/* ================================================================
   ICS First-Edition Reading Pages
   在线阅读页专用样式（四卷本第一版）
   ================================================================ */

.rd-wrap {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

@media (max-width: 1100px) {
    .rd-wrap { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- 目录 ---------- */
.rd-toc {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 1.5rem 1.25rem;
    border-radius: 16px;
    background: rgba(17, 24, 39, 0.55);
    border: 1px solid rgba(167, 139, 250, 0.18);
    backdrop-filter: blur(12px);
}
.rd-toc-h {
    font-family: var(--font-en-display, 'Orbitron', sans-serif);
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-quantum-purple-light, #a78bfa);
    margin: 0 0 1rem;
}
.rd-toc ol { list-style: none; margin: 0; padding: 0; }
.rd-toc li { margin: 0.3rem 0; }
.rd-toc a {
    display: block;
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(229, 231, 235, 0.72);
    text-decoration: none;
    padding: 0.28rem 0.4rem;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
}
.rd-toc a:hover {
    color: #fff;
    background: rgba(167, 139, 250, 0.12);
    border-left-color: var(--color-quantum-purple-light, #a78bfa);
}
.rd-toc-part a {
    font-weight: 600;
    color: var(--color-nebula-cyan, #06b6d4);
    margin-top: 0.6rem;
    letter-spacing: 0.02em;
}
.rd-toc-num {
    font-family: var(--font-en-display, 'Orbitron', sans-serif);
    font-size: 0.72rem;
    color: rgba(167, 139, 250, 0.85);
    margin-right: 0.3rem;
}

/* ---------- 正文容器 ---------- */
.rd-main { min-width: 0; }
.rd-article { max-width: 860px; }

.rd-ch-title {
    font-family: var(--font-en-display, 'Orbitron', sans-serif);
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
    line-height: 1.35;
    margin: 3.5rem 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(167, 139, 250, 0.25);
}
.rd-ch-sub {
    display: block;
    font-family: var(--font-en-sans, 'Inter', sans-serif);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: rgba(167, 139, 250, 0.85);
    margin-top: 0.35rem;
    text-transform: none;
}
.rd-part {
    font-family: var(--font-en-display, 'Orbitron', sans-serif);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-nebula-cyan, #06b6d4);
    margin: 4rem 0 1rem;
    padding: 0.9rem 0 0.9rem 1rem;
    border-left: 3px solid var(--color-nebula-cyan, #06b6d4);
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.08), transparent);
}

.rd-h1 { font-family: var(--font-en-display, 'Orbitron', sans-serif); font-size: 1.7rem; margin: 2.5rem 0 1rem; color: #fff; }
.rd-h2 { font-family: var(--font-en-display, 'Orbitron', sans-serif); font-size: 1.25rem; margin: 2rem 0 0.8rem; color: rgba(255,255,255,0.95); letter-spacing: 0.02em; }
.rd-h3 { font-size: 1.08rem; font-weight: 600; margin: 1.6rem 0 0.6rem; color: rgba(255,255,255,0.92); }
.rd-h4 { font-size: 0.98rem; font-weight: 600; margin: 1.3rem 0 0.5rem; color: rgba(229,231,235,0.9); }
.rd-h5 { font-size: 0.92rem; font-weight: 600; margin: 1.1rem 0 0.4rem; color: rgba(229,231,235,0.85); }

.rd-p {
    font-size: 1rem;
    line-height: 1.85;
    color: rgba(229, 231, 235, 0.86);
    margin: 0.85rem 0;
}
.rd-list { margin: 0.7rem 0 0.9rem 1.4rem; }
.rd-list li {
    font-size: 0.98rem;
    line-height: 1.8;
    color: rgba(229, 231, 235, 0.86);
    margin: 0.3rem 0;
}
.rd-hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(167,139,250,0.3), transparent);
    margin: 2rem 0;
}
.rd-quote {
    margin: 1.2rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--color-quantum-purple-light, #a78bfa);
    background: rgba(167, 139, 250, 0.07);
    border-radius: 0 8px 8px 0;
    color: rgba(229, 231, 235, 0.9);
    font-size: 0.97rem;
    line-height: 1.8;
}
.rd-box {
    font-family: 'SFMono-Regular', 'Consolas', 'Menlo', monospace;
    font-size: 0.76rem;
    line-height: 1.45;
    color: rgba(167, 139, 250, 0.9);
    background: rgba(10, 14, 24, 0.7);
    border: 1px solid rgba(167, 139, 250, 0.16);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    overflow-x: auto;
    white-space: pre;
    margin: 1.2rem 0;
}
.rd-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
    font-size: 0.88rem;
}
.rd-table th, .rd-table td {
    border: 1px solid rgba(167, 139, 250, 0.18);
    padding: 0.5rem 0.7rem;
    text-align: left;
    color: rgba(229, 231, 235, 0.88);
    line-height: 1.6;
}
.rd-table th {
    background: rgba(167, 139, 250, 0.12);
    font-weight: 600;
    color: #fff;
}
.rd-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

.rd-ch { scroll-margin-top: 90px; }
.rd-end {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(167,139,250,0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}
.rd-end a {
    font-size: 0.9rem;
    color: var(--color-quantum-purple-light, #a78bfa);
    text-decoration: none;
}
.rd-end a:hover { text-decoration: underline; }
.rd-meta {
    font-size: 0.8rem;
    color: rgba(156, 163, 175, 0.8);
    line-height: 1.7;
    margin: 1rem 0 0;
}
.rd-note {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.28);
    font-size: 0.9rem;
    line-height: 1.75;
    color: rgba(253, 230, 138, 0.92);
}

/* 中文阅读页微调 */
body.rd-zh .rd-p, body.rd-zh .rd-list li {
    font-family: var(--font-zh-serif, 'Noto Serif SC', serif);
    font-size: 1.02rem;
    line-height: 2.0;
    letter-spacing: 0.01em;
}
body.rd-zh .rd-ch-title {
    font-family: var(--font-zh-sans, 'Noto Sans SC', sans-serif);
    letter-spacing: 0.05em;
}
body.rd-zh .rd-toc-h { font-family: var(--font-zh-sans, 'Noto Sans SC', sans-serif); letter-spacing: 0.2em; }

@media (max-width: 1100px) {
    .rd-toc { position: static; max-height: none; }
}

/* ------------------------------------------------------------------
   章内子块（脚注 / 参考文献 / 附录 / 补充材料）— v2 全量修复新增
   ------------------------------------------------------------------ */
.rd-subblock {
    margin: 1.6rem 0 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.05);
    overflow: hidden;
}
.rd-subblock > summary {
    cursor: pointer;
    padding: 0.7rem 1.1rem;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(196, 213, 235, 0.95);
    background: rgba(148, 163, 184, 0.09);
    list-style: none;
    user-select: none;
}
.rd-subblock > summary::-webkit-details-marker { display: none; }
.rd-subblock > summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 0.55em;
    transition: transform 0.18s ease;
    color: rgba(125, 211, 252, 0.85);
}
.rd-subblock[open] > summary::before { transform: rotate(90deg); }
.rd-subblock[open] > summary { border-bottom: 1px solid rgba(148, 163, 184, 0.18); }
.rd-subblock > *:not(summary) { padding: 0 1.1rem; }
.rd-subblock .rd-p:last-child,
.rd-subblock .rd-table-wrap:last-child { margin-bottom: 1rem; }

.rd-subblock.rd-foot > summary { color: rgba(148, 163, 184, 0.95); }
.rd-subblock.rd-ref > summary { color: rgba(167, 196, 160, 0.95); }
.rd-subblock.rd-app > summary { color: rgba(196, 181, 253, 0.95); }
.rd-subblock.rd-supp > summary { color: rgba(253, 186, 116, 0.95); }

/* 卷首导读 */
.rd-front { margin-bottom: 2.2rem; }
.rd-front .rd-p { color: rgba(226, 232, 240, 0.88); }
