/* 地图页 */
.map-intro { padding-top: 44px; padding-bottom: 8px; }
.map-intro h1 { margin-bottom: .25em; }
.map-intro p { max-width: 40em; color: var(--ink-2); }

.map-section { padding-top: 10px; padding-bottom: 40px; }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-bottom: 12px; }
.map-tools .legend { flex: 1 1 auto; }
.map-selection-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.map-selection-actions[hidden], .map-selection-actions button[hidden], .panel[hidden] { display: none !important; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { font: inherit; font-size: .86rem; border: 0; background: #fff; padding: 4px 14px; cursor: pointer; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
body.view-list .map-only, body.view-list .map-view { display: none; }

.map-shell {
  display: grid; grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--rule); border-radius: 10px; background: #fff; overflow: hidden;
}
.map-shell.has-selection { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 980px) { .map-shell.has-selection { grid-template-columns: minmax(0, 1fr); } }
.map-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; cursor: grab; }
.map-scroll.dragging { cursor: grabbing; }
.map-scroll svg { display: block; width: auto; max-width: none; height: 560px; }
.map-note { font-size: .84rem; color: var(--graphite); margin-top: 10px; }

.mnode { cursor: pointer; }
.mnode:focus { outline: none; }
.mnode:focus-visible .ring, .mnode.sel .ring { opacity: 1; }
.mnode .ring { opacity: 0; }
.mnode:hover .dot { stroke-width: 3.5; }
.mlabel { font-family: var(--f-body); font-size: 13px; fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.myear { font-family: var(--f-num); font-size: 10.5px; fill: var(--faint); paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; }
.medge { fill: none; stroke: #c3ccd2; stroke-width: 1.4; transition: stroke .2s, opacity .2s; }
.dim .medge { opacity: .25; }
.dim .medge.hot { opacity: 1; stroke: var(--ink); stroke-width: 2; }
.dim .mnode { opacity: .35; transition: opacity .2s; }
.dim .mnode.hot { opacity: 1; }

.panel { border-left: 1px solid var(--rule); padding: 22px 24px; font-size: .95rem; min-height: 560px; }
@media (max-width: 980px) { .panel { border-left: 0; border-top: 1px solid var(--rule); min-height: 0; } }
.p-meta { color: var(--graphite); font-size: .85rem; display: flex; align-items: center; gap: 8px; }
.p-meta i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.panel h3 { font-size: 1.5rem; margin: 4px 0 12px; }
.node-info dl { margin: 0; }
.node-info dt { font-size: .8rem; color: var(--graphite); margin-top: 12px; }
.node-info dd { margin: 2px 0 0; line-height: 1.75; }
.node-info dd.q { font-family: var(--f-hand); font-weight: 600; font-size: 1.08rem; }
.node-info .cta { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--rule); }
.node-info .cta .btn { max-width: 100%; white-space: normal; }
.node-info .cta .s { font-size: .86rem; color: var(--graphite); margin-top: 6px; }

/* 列表视图 */
.list-view { border-top: 1px solid var(--ink); }
.era-h { font-family: var(--f-hand); font-weight: 700; font-size: 1.15rem; margin: 26px 0 6px; display: flex; gap: 12px; align-items: baseline; }
.era-h small { font-family: var(--f-num); font-size: .8rem; color: var(--graphite); font-weight: 400; }
.era-h.winter { color: var(--graphite); }
.list-view > details { border-bottom: 1px solid var(--rule); }
.list-view > details > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 3.4em minmax(0, 1fr) auto 1em; gap: 10px; align-items: baseline; padding: 11px 2px; }
.list-view > details > summary::-webkit-details-marker { display: none; }
.list-view > details > summary .y { font-family: var(--f-num); font-size: .85rem; color: var(--graphite); }
.list-view > details > summary .nm { font-weight: 600; }
.list-view > details > summary .nm i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.list-view > details > summary .tag { font-size: .78rem; color: var(--lane-learn); white-space: nowrap; }
.list-view > details > summary::after { content: "+"; grid-column: 4; color: var(--graphite); text-align: center; }
.list-view > details[open] > summary::after { content: "−"; }
.list-view > details > summary:focus-visible { outline: 2px solid #c8781a; outline-offset: 3px; }
.list-view .node-info { padding: 0 2px 16px 3.9em; }
@media (max-width: 560px) { .list-view .node-info { padding-left: 2px; } }

/* 五次转弯 */
.overview { padding-top: 40px; padding-bottom: 70px; border-top: 1px solid var(--rule); margin-top: 20px; }
.overview h2 { margin-top: 0; }
.turns { list-style: none; margin: 26px 0 0; padding: 0; counter-reset: t; }
.turns > li {
  counter-increment: t; display: grid; grid-template-columns: 9.5em minmax(0, 40em); gap: 8px 36px;
  padding: 22px 0; border-top: 1px solid var(--rule);
}
@media (max-width: 760px) { .turns > li { grid-template-columns: 1fr; } }
.turns .when { font-family: var(--f-hand); font-weight: 700; font-size: 1.15rem; line-height: 1.5; }
.turns .when::before { content: "第" counter(t) "次转弯"; display: block; font-family: var(--f-body); font-weight: 400; font-size: .8rem; color: var(--graphite); }
.turns .when small { display: block; font-family: var(--f-num); font-weight: 400; font-size: .8rem; color: var(--graphite); }
.turns h3 { margin: 0 0 6px; font-size: 1.25rem; }
.turns .remember { margin: 10px 0 6px; }
.turns .go { font-size: .9rem; }
.tool {
  margin: 34px 0 0; border: 1px solid var(--rule); border-radius: 10px; background: #fafbfc;
  padding: 22px 24px; display: grid; grid-template-columns: 12em 1fr; gap: 12px 28px;
}
@media (max-width: 760px) { .tool { grid-template-columns: 1fr; } }
.tool h3 { margin: 0; }
.tool ol { margin: 0; padding-left: 1.3em; }
.tool li { margin-bottom: 4px; }
.tool .s { color: var(--graphite); font-size: .9rem; grid-column: 2; margin: 0; }
@media (max-width: 760px) { .tool .s { grid-column: 1; } }
.node-info .rels { margin: 12px 0 4px; font-size: .86rem; color: var(--ink-2); }
.node-info .rels b { display: block; font-size: .78rem; color: var(--graphite); font-weight: 600; letter-spacing: .04em; margin-bottom: 4px; }
.node-info .rels ul { margin: 0; padding-left: 1.1em; }
.node-info .rels li { margin: 3px 0; line-height: 1.6; }
.node-info .rels button { font: inherit; font-weight: 600; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--rule); padding: 0; cursor: pointer; }
.node-info .rels button:hover { border-color: var(--ink); }

/* 阅读关系而非拥挤年表 */
.map-reading { display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; margin:0 0 14px; font-size:.82rem; color:var(--graphite); }
.map-reading > span { display:inline-flex; align-items:center; gap:7px; }
.map-line-key { display:inline-block; width:24px; border-top:1.5px solid #77889a; }
.map-line-key.comparison { border-top-style:dashed; }
.map-course-key { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--ink); }
.map-scroll svg { height:auto; width:1640px; }
.medge.compare { stroke-dasharray:5 5; }
.mnode:focus-visible .ring { stroke:#c8781a; stroke-width:2.5; }
.panel { max-height:760px; overflow:auto; }
.map-sources { margin-top:14px; font-size:.82rem; }
.map-sources summary { cursor:pointer; color:var(--graphite); }
.map-sources ul { padding-left:1.2em; line-height:1.7; }
.map-math { font-size:.84rem; }
.list-view > details.selected > summary { color:var(--lane-learn); background:#edf3fa; }
.map-tools button,.rels button { min-height:36px; }
.map-tools button:focus-visible,.map-reading button:focus-visible,.rels button:focus-visible { outline:2px solid #c8781a; outline-offset:3px; }
@media(max-width:760px) { .map-tools .legend { flex-basis:100%; } .map-reading { align-items:flex-start; } .map-reading>a { margin-left:0; } .panel { max-height:none; padding:18px; } .map-scroll { max-height:540px; overflow:auto; } .list-view .node-info { padding-left:2px; } .node-info .cta a { white-space:normal; } }
@media(prefers-reduced-motion:reduce) { .medge,.mnode { transition:none!important; } }
