:root { --editor-bg:#f8fafc; --editor-panel:#111827; --editor-line:#e2e8f0; --editor-text:#334155; --editor-muted:#64748b; --editor-cyan:#0076bd; --editor-orange:#f36f21; --editor-green:#86efac; }
html { scroll-behavior:smooth; }
body.algorithm-page { background:var(--editor-bg); color:var(--editor-text); font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",Arial,sans-serif; }
.algorithm-page .glass { background:rgba(255,255,255,.9); border-color:#e2e8f0; }
.algorithm-page .nav-link { color:#172b42; }.algorithm-page .nav-link:hover,.algorithm-page .nav-active { color:#0076bd; }.algorithm-page .nav-link::after { background:#0076bd; }
.algorithm-hero { position:relative; overflow:hidden; background:radial-gradient(circle at 82% 15%,rgba(56,189,248,.24),transparent 25%),linear-gradient(135deg,#063b70 0%,#0076bd 68%); border-bottom:1px solid #dbeafe; }
.algorithm-hero::after { content:"</>"; position:absolute; right:6vw; bottom:-2.2rem; color:rgba(255,255,255,.1); font:900 clamp(9rem,22vw,22rem)/1 ui-monospace,SFMono-Regular,Menlo,monospace; pointer-events:none; }
.algorithm-kicker { color:#0076bd; letter-spacing:.18em; }.algorithm-hero .algorithm-kicker { color:#bae6fd; }.algorithm-shell { max-width:1180px; margin:0 auto; padding:0 1.25rem; }
.algorithm-layout { display:grid; grid-template-columns:minmax(0,1fr) 250px; gap:2.5rem; align-items:start; }.algorithm-document { min-width:0; }
.algorithm-section { scroll-margin-top:6rem; padding:4.5rem 0; border-bottom:1px solid var(--editor-line); }.algorithm-section:first-child { padding-top:3.25rem; }
.algorithm-section h2 { color:#063b70; font-size:clamp(1.55rem,2.8vw,2.15rem); line-height:1.25; margin:0 0 1.35rem; }.algorithm-section h3 { color:#0076bd; font-size:1.16rem; line-height:1.5; margin:2rem 0 .75rem; }.algorithm-section h4 { color:#f36f21; font-size:1rem; margin:1.35rem 0 .65rem; }
.algorithm-section p,.algorithm-section li { color:#475569; line-height:1.9; font-size:.98rem; }.algorithm-section p { margin:.55rem 0; }.algorithm-section ul,.algorithm-section ol { margin:.75rem 0 1rem; padding-left:1.5rem; }.algorithm-section li+li { margin-top:.35rem; }.algorithm-lead { color:#475569!important; font-size:1.05rem!important; }
.editor-panel { background:var(--editor-panel); border:1px solid var(--editor-line); border-radius:14px; overflow:hidden; box-shadow:0 24px 70px rgba(0,0,0,.2); }.editor-bar { display:flex; align-items:center; gap:.42rem; padding:.72rem 1rem; background:#0f172a; border-bottom:1px solid var(--editor-line); color:var(--editor-muted); font:.76rem ui-monospace,SFMono-Regular,Menlo,monospace; }.editor-dot { width:.62rem; height:.62rem; border-radius:999px; background:#ef4444; box-shadow:1rem 0 #f59e0b,2rem 0 #22c55e; margin-right:2rem; }.code-block { padding:1.1rem 1.25rem; overflow-x:auto; color:#c4d5e9; font:.92rem/1.85 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; white-space:pre-wrap; }
.code-block .keyword { color:#c084fc; }.code-block .func { color:var(--editor-cyan); }.code-block .string { color:var(--editor-green); }
.algorithm-table-wrap { margin:1.25rem 0 1.7rem; overflow-x:auto; border:1px solid #dbe3ec; border-radius:10px; background:#fff; }.algorithm-table { width:100%; min-width:620px; border-collapse:collapse; font-size:.9rem; }.algorithm-table th { background:#0076bd; color:#fff; font-weight:700; text-align:left; white-space:nowrap; }.algorithm-table th,.algorithm-table td { padding:.78rem .85rem; border-right:1px solid #dbe3ec; border-bottom:1px solid #dbe3ec; vertical-align:top; line-height:1.65; }.algorithm-table tr:last-child td { border-bottom:0; }.algorithm-table th:last-child,.algorithm-table td:last-child { border-right:0; }.algorithm-table tbody tr:nth-child(even) { background:#f0f8ff; }
.algorithm-image { display:block; max-width:min(100%,22rem); max-height:18rem; object-fit:contain; margin:1rem 0; padding:.75rem; background:#f8fafc; border-radius:10px; }.sample-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.35rem 1.5rem; margin:.45rem 0 1rem; }.sample-options p { margin:0; }
.algorithm-toc { position:sticky; top:6.5rem; padding:1rem 0 1rem 1.35rem; border-left:2px solid #0076bd; }.algorithm-toc p { color:#64748b; font:.72rem ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.14em; text-transform:uppercase; margin:0 0 1rem; }.algorithm-toc a { display:block; padding:.48rem 0; color:#64748b; font-size:.86rem; transition:color .2s ease,transform .2s ease; }.algorithm-toc a:hover { color:#0076bd; transform:translateX(3px); }
.algorithm-cta { display:inline-flex; align-items:center; gap:.55rem; padding:.75rem 1rem; border:1px solid rgba(255,255,255,.55); border-radius:8px; color:#fff; background:rgba(255,255,255,.12); font-weight:700; transition:background .2s ease,transform .2s ease; }.algorithm-hero .algorithm-cta:hover { background:rgba(255,255,255,.22); transform:translateY(-2px); }.algorithm-section .algorithm-cta { border-color:#0076bd; color:#0076bd; background:#fff; }.algorithm-section .algorithm-cta:hover { background:#eff6ff; transform:translateY(-2px); }.algorithm-page footer { margin-top:0; background:#063b70; border-top:1px solid rgba(255,255,255,.15); }
@media (max-width:900px) { .algorithm-layout { grid-template-columns:1fr; }.algorithm-toc { position:relative; top:auto; padding:1rem 0; border-left:0; border-bottom:1px solid #dbe3ec; display:flex; flex-wrap:wrap; gap:.2rem 1.25rem; }.algorithm-toc p { flex-basis:100%; } }
@media (max-width:600px) { .algorithm-shell { padding:0 1rem; }.algorithm-section { padding:3rem 0; }.sample-options { grid-template-columns:1fr; }.code-block { font-size:.82rem; } }
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; }.algorithm-cta,.algorithm-toc a { transition:none; } }

/* 2026-09-08: 规则页改为“技术手册”阅读布局，操作入口只保留在主站导航。 */
body.algorithm-page { background:#eef3f8; }
.algorithm-hero { background:#fff; border-bottom:1px solid #dbe3ec; }
.algorithm-hero::after { color:rgba(0,118,189,.07); }
.algorithm-hero .algorithm-kicker { color:#0076bd; }
.algorithm-hero h1 { color:#063b70; }
.algorithm-hero p:not(.algorithm-kicker) { color:#64748b; }
.algorithm-hero .algorithm-cta, .algorithm-section .algorithm-cta { display:none; }
.algorithm-hero > .algorithm-shell { padding-top:4.3rem; padding-bottom:4.3rem; }
.algorithm-layout { display:block; max-width:1040px; }
.algorithm-document { background:#fff; padding:0 clamp(1.3rem,5vw,5rem); border-left:1px solid #dbe3ec; border-right:1px solid #dbe3ec; }
.algorithm-section { padding:3.7rem 0; border-bottom:1px solid #e7edf3; }
.algorithm-section:first-child { padding-top:3.7rem; }
.algorithm-section h2 { font-size:clamp(1.65rem,3vw,2.3rem); letter-spacing:-.02em; }
.algorithm-toc { position:relative; top:auto; max-width:1040px; margin:0 auto; padding:1rem clamp(1.3rem,5vw,5rem); border:0; border-bottom:1px solid #dbe3ec; background:#f7fafd; display:flex; align-items:center; gap:.35rem 1.35rem; flex-wrap:wrap; }
.algorithm-toc p { flex-basis:100%; margin-bottom:.15rem; color:#0076bd; }
.algorithm-toc a { padding:.35rem 0; color:#64748b; }
.algorithm-toc a:hover { color:#0076bd; transform:none; }
.algorithm-page footer { margin-top:0; }
@media (max-width:600px) { .algorithm-hero > .algorithm-shell { padding-top:3.2rem; padding-bottom:3.2rem; }.algorithm-document { padding:0 1.1rem; }.algorithm-section,.algorithm-section:first-child { padding:2.8rem 0; }.algorithm-toc { padding-left:1.1rem; padding-right:1.1rem; } }

/* 2026-09-08: 首屏、正文与站点导航统一使用同一条 1180px 内容基线。 */
.algorithm-layout { max-width:1180px; background:#fff; }
.algorithm-document { padding:0; border:0; }
.algorithm-section,.algorithm-section:first-child { padding-left:0; padding-right:0; }
.algorithm-section > * { max-width:980px; }
.algorithm-section > .algorithm-table-wrap,.algorithm-section > .editor-panel { max-width:none; }
.algorithm-section h2 { max-width:980px; }
.algorithm-toc { max-width:1180px; }
.algorithm-hero { display:none; }
@media (max-width:600px) { .algorithm-section { padding-left:1rem; padding-right:1rem; } }

/* 2026-09-08: 对齐 ai-star.html 的全宽页面底色与 max-w-7xl 内容容器。 */
body.algorithm-page { background:#fff; }
.algorithm-shell,.algorithm-layout { width:100%; max-width:1280px; padding-left:2rem; padding-right:2rem; box-sizing:border-box; }
.algorithm-layout { background:transparent; }
.algorithm-document { width:100%; background:transparent; }
.algorithm-section > * { max-width:980px; }
.algorithm-section > .algorithm-table-wrap,.algorithm-section > .editor-panel { max-width:100%; }
.algorithm-toc { width:100%; max-width:1280px; padding-left:2rem; padding-right:2rem; background:#fff; }
@media (max-width:1023px) { .algorithm-shell,.algorithm-layout,.algorithm-toc { padding-left:1rem; padding-right:1rem; } }

/* 2026-09-08: 语言切换与纵向等级阶梯，突出不同组别的能力递进。 */
.language-switcher { scroll-margin-top:6rem; padding:4.5rem 0 1.5rem; border-top:1px solid #e7edf3; }
.language-switcher .algorithm-kicker { margin:0 0 .65rem; color:#64748b; font-size:.75rem; font-weight:800; letter-spacing:.16em; }
.language-switcher h2 { margin:0; color:#063b70; font-size:clamp(2rem,4vw,3rem); font-weight:800; letter-spacing:-.03em; }
.language-switcher > p:not(.algorithm-kicker) { margin:.9rem 0 0; color:#64748b; line-height:1.8; }
.algorithm-language-section { padding-top:2.6rem!important; }
.algorithm-language-section[hidden] { display:none; }
.algorithm-language-section > .algorithm-kicker,.algorithm-language-section > h2 { display:none; }
.language-current { display:flex; flex-direction:column; align-items:flex-start; gap:.65rem; margin-bottom:2.4rem; }
.language-current span { color:#94a3b8; font:700 .7rem/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.12em; }
.language-current strong { color:#063b70; font-size:clamp(2rem,4vw,3rem); line-height:1.05; letter-spacing:-.035em; }
.score-rounds { max-width:100%!important; margin:1.4rem 0 4.2rem; }
.score-round + .score-round { margin-top:2.4rem; }
.score-round-heading { display:flex; align-items:center; gap:.75rem; margin-bottom:.65rem; }
.score-round-heading span { display:inline-flex; width:2rem; height:2rem; align-items:center; justify-content:center; border-radius:50%; background:#e0f2fe; color:#0076bd; font-size:.72rem; font-weight:900; }
.score-round-heading h5 { margin:0; color:#063b70; font-size:1.05rem; }
.score-round .algorithm-table-wrap { margin-top:0; }
.level-stage { position:relative; display:grid; grid-template-columns:150px minmax(0,1fr); max-width:980px!important; padding-bottom:3.5rem; }
.level-stage::before { content:""; position:absolute; top:2.8rem; bottom:0; left:1.35rem; width:1px; background:#bfdbfe; }
.level-stage:last-of-type::before { bottom:3.5rem; }
.level-marker { position:relative; display:flex; flex-direction:column; align-items:flex-start; padding-left:3.4rem; padding-right:1rem; }
.level-marker::before { content:""; position:absolute; top:.65rem; left:.96rem; width:.82rem; height:.82rem; border:3px solid #fff; border-radius:50%; background:#0076bd; box-shadow:0 0 0 1px #7dd3fc; }
.level-number { color:#bfdbfe; font:900 2.7rem/.9 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:-.08em; }
.level-marker strong { margin-top:.85rem; color:#063b70; font-size:.96rem; line-height:1.5; }
.level-marker small { margin-top:.35rem; color:#f36f21; font-size:.72rem; font-weight:800; letter-spacing:.06em; }
.level-body { min-width:0; padding:0 0 0 2rem; border-top:1px solid #dbe3ec; }
.level-body > h3:first-child,.level-body > h4:first-child { display:none; }
.level-body > p:first-of-type { margin-top:1.3rem; }
.level-body ul,.level-body ol { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.4rem 2rem; padding-left:1.25rem; }
.level-body li { padding-right:.6rem; }
.sample-zone { max-width:100%!important; margin-top:1rem; padding:3rem 0 0; border-top:3px solid #e0f2fe; }
.sample-zone > h3:first-child { margin-top:0; color:#063b70; font-size:1.55rem; }
.sample-zone .editor-panel { max-width:760px; }
@media (max-width:767px) {
  .language-switcher { padding-top:3.2rem; }
  .level-stage { grid-template-columns:1fr; padding-left:2.4rem; }
  .level-stage::before { left:.35rem; }
  .level-marker { padding:0 0 1.2rem; }
  .level-marker::before { left:-2.45rem; }
  .level-number { font-size:2rem; }
  .level-marker strong { margin-top:.45rem; }
  .level-body { padding-left:0; }
  .level-body ul,.level-body ol { grid-template-columns:1fr; }
}
