/* 数据结构专题：topic-graph */

.topic-graph-story {
    color: var(--article-text-color);
    font-size: 14px;
    line-height: 1.65;
}
.topic-graph-story * { box-sizing:border-box; }
.topic-graph-story p { margin:0 0 12px; }
.topic-graph-story strong { color:var(--article-heading-color); }
.topic-graph-story code, .topic-graph-story pre {
    font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
.topic-graph-section { margin-top:22px; scroll-margin-top:110px; }
.topic-graph-section > h2 {
    display:flex; align-items:center; gap:14px; margin:0 0 8px;
    color:var(--article-heading-color); font-size:20px; line-height:1.35; font-weight:900;
}
.topic-graph-number {
    display:inline-flex; flex:0 0 38px; height:38px; align-items:center; justify-content:center;
    border-radius:50%; background:#0752ff; color:#fff; font-size:16px; font-weight:700;
}
.topic-graph-story pre {
    margin:14px 0; padding:16px; border-radius:14px; overflow:auto;
    background:#152033; color:#f4f7ff; line-height:1.6; font-size:12px;
}
.topic-graph-story pre code { color:inherit; white-space:pre; }
.topic-graph-story .cards { display:grid; gap:10px; margin-top:14px; }
.topic-graph-story .cards.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.topic-graph-story .cards.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.topic-graph-story .cards.four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.topic-graph-story .cards article {
    padding:14px 10px; border:1px solid #e1ebff; border-radius:14px;
    background:#f9fbff; text-align:center;
}
.topic-graph-story .cards h3 { margin:0 0 4px; color:var(--article-heading-color); font-size:13px; }
.topic-graph-story .cards p { margin:0; color:#617296; font-size:10px; }
.topic-graph-story .compare {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:14px;
}
.topic-graph-story .compare > div {
    padding:15px; border-radius:15px; background:#eef5ff; text-align:center;
}
.topic-graph-story .compare > div:nth-child(2) { background:#eef9f0; }
.topic-graph-story .compare h3 { margin:0 0 5px; color:var(--article-heading-color); font-size:14px; }
.topic-graph-story .compare p { margin:0; color:#617296; font-size:10px; }
.topic-graph-story .flow {
    display:grid; grid-template-columns:1fr 34px 1fr 34px 1fr;
    gap:7px; align-items:center; margin-top:14px;
}
.topic-graph-story .flow span {
    display:flex; min-height:116px; align-items:center; justify-content:center;
    padding:12px; border-radius:14px; background:#eef5ff; color:#1d3d75;
    font-weight:800; text-align:center;
}
.topic-graph-story .flow span:nth-of-type(2) { background:#fff6df; }
.topic-graph-story .flow span:nth-of-type(3) { background:#eef9f0; }
.topic-graph-story .flow b { color:#4f82ff; font-size:22px; text-align:center; }
.topic-graph-story .tip, .topic-graph-story .warn {
    margin-top:14px; padding:14px 16px; border-radius:14px;
}
.topic-graph-story .tip { background:#eaf5ff; }
.topic-graph-story .warn { border:1px solid #ffd0dc; background:#fff2f6; }
.topic-graph-story .tip h3, .topic-graph-story .warn h3 { margin:0 0 4px; font-size:15px; }
.topic-graph-story .tip h3 { color:#0752ff; }
.topic-graph-story .warn h3 { color:#d83265; }
.topic-graph-story .formula {
    margin-top:14px; padding:16px; border-radius:14px;
    background:#eef5ff; color:#0752ff; font-size:16px; font-weight:900; text-align:center;
}
.topic-graph-story .trace, .topic-graph-story .linked {
    display:flex; flex-wrap:wrap; gap:7px; align-items:center;
    margin-top:14px; padding:14px; border-radius:14px; background:#f7f8fc;
}
.topic-graph-story .trace span, .topic-graph-story .linked span {
    padding:9px 11px; border-radius:9px; background:#fff;
    color:#1d3d75; font-size:10px; font-weight:800;
}
.topic-graph-story .trace b, .topic-graph-story .linked b { color:#4f82ff; }
.topic-graph-story .stack-visual {
    display:flex; width:min(320px,100%); flex-direction:column;
    gap:5px; margin:16px auto 0; padding:14px; border-radius:14px; background:#f7f8fc;
}
.topic-graph-story .stack-visual span {
    padding:11px; border-radius:9px; border:1px solid #dce8ff;
    background:#fff; color:#0752ff; font-weight:900; text-align:center;
}
.topic-graph-story .queue {
    display:flex; gap:6px; align-items:center; justify-content:center;
    margin-top:14px; padding:16px; border-radius:14px; background:#f7f8fc;
}
.topic-graph-story .queue span {
    padding:12px; border-radius:9px; background:#fff; color:#0752ff; font-weight:900;
}
.topic-graph-story .node {
    display:grid; grid-template-columns:1fr 1fr; gap:4px;
    width:min(340px,100%); margin:14px auto 0; padding:6px;
    border-radius:12px; background:#0752ff;
}
.topic-graph-story .node > div {
    padding:14px; background:#fff; border-radius:8px; text-align:center;
}
.topic-graph-story .tree, .topic-graph-story .binary-tree {
    margin-top:14px; padding:16px; border-radius:14px; background:#f7f8fc; text-align:center;
}
.topic-graph-story .tree > span, .topic-graph-story .binary-tree > span {
    display:inline-flex; padding:10px 16px; border-radius:999px; background:#0752ff; color:#fff; font-weight:900;
}
.topic-graph-story .tree > div, .topic-graph-story .binary-tree > div {
    display:flex; justify-content:center; gap:18px; margin-top:18px;
}
.topic-graph-story .tree > div span, .topic-graph-story .binary-tree > div span {
    display:inline-flex; min-width:52px; justify-content:center; padding:10px;
    border-radius:999px; background:#fff; border:1px solid #dce8ff; color:#1d3d75; font-weight:800;
}
.topic-graph-story .graph-demo {
    display:grid; grid-template-columns:repeat(4,1fr); gap:18px;
    margin-top:14px; padding:24px; border-radius:14px; background:#f7f8fc;
}
.topic-graph-story .graph-demo span {
    display:flex; align-items:center; justify-content:center;
    width:58px; height:58px; margin:auto; border-radius:50%;
    background:#0752ff; color:#fff; font-weight:900;
}
.topic-graph-summary {
    margin-top:22px; padding:18px; border-radius:16px; background:#e9f3ff; scroll-margin-top:110px;
}
.topic-graph-summary h2 { margin:0 0 7px; color:#0752ff; font-size:19px; }
.topic-graph-summary ul { margin:0; padding-left:20px; line-height:1.75; }
.topic-graph-summary .next {
    margin:10px 0 0; padding-top:10px; border-top:1px dashed #b8d3f6;
}
.topic-graph-pagination {
    display:flex; justify-content:space-between; gap:18px; margin-top:14px;
}
.topic-graph-pagination a {
    display:flex; align-items:center; gap:10px; max-width:49%; padding:10px 13px;
    border:1px solid #d9e7ff; border-radius:12px; background:#ffffffb3; text-decoration:none;
}
.topic-graph-pagination a:last-child { text-align:right; }
.topic-graph-pagination strong { display:block; color:#0752ff; font-size:16px; }
.topic-graph-pagination small { display:block; color:#576b9f; font-size:12px; }

@media (max-width:900px) {
    .topic-graph-story .cards.four { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:640px) {
    .topic-graph-story { font-size:12px; }
    .topic-graph-section > h2 { gap:9px; font-size:16px; }
    .topic-graph-number { flex-basis:31px; height:31px; font-size:14px; }
    .topic-graph-story .cards.two,
    .topic-graph-story .cards.three,
    .topic-graph-story .cards.four,
    .topic-graph-story .compare,
    .topic-graph-story .flow {
        grid-template-columns:minmax(0,1fr);
    }
    .topic-graph-story .flow b { transform:rotate(90deg); }
    .topic-graph-story .queue { flex-wrap:wrap; }
    .topic-graph-story .graph-demo { grid-template-columns:repeat(2,1fr); }
    .topic-graph-pagination { gap:9px; }
    .topic-graph-pagination a { flex:1; min-width:0; padding:8px 6px; }
    .topic-graph-pagination strong { font-size:13px; }
    .topic-graph-pagination small { font-size:10px; line-height:1.35; }
}
