/* ===== 统一站点外框：跨页面一致的顶部导航 + 新手提示框 =====
   命名空间 sn- 开头，避免与课程/练习场自身样式冲突。 */

.sn-nav{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  padding:10px 18px; background:#0f172a; color:#e2e8f0;
  border-bottom:1px solid #1e293b;
}
.sn-brand{
  font-weight:800; font-size:16px; color:#fff; text-decoration:none;
  letter-spacing:.02em; white-space:nowrap;
}
.sn-links{ display:flex; gap:8px; flex-wrap:wrap; margin-left:auto; }
.sn-links a{
  color:#cbd5e1; text-decoration:none; font-size:14px;
  padding:7px 14px; border-radius:999px; border:1px solid #334155; background:#1e293b;
  white-space:nowrap;
}
.sn-links a:hover{ background:#334155; color:#fff; }
.sn-links a.sn-active{ background:#2563eb; border-color:#2563eb; color:#fff; }

/* 新手秒懂提示框（浅色，适配课程页） */
.sn-beginner{
  background:linear-gradient(135deg,#eff6ff,#f0fdf4);
  border:1px solid #bfdbfe; border-radius:14px; padding:16px 18px; margin:0 0 28px;
}
.sn-beginner h3{ margin:0 0 8px; font-size:16px; color:#1d4ed8; }
.sn-beginner p{ margin:6px 0; font-size:14.5px; color:#334155; line-height:1.7; }
.sn-beginner b{ color:#0f172a; }
.sn-beginner .row{ display:flex; gap:10px; align-items:flex-start; margin:8px 0; }
.sn-beginner .num{
  flex:0 0 auto; width:26px; height:26px; border-radius:50%;
  background:#2563eb; color:#fff; font-weight:700; font-size:13px;
  display:flex; align-items:center; justify-content:center;
}

@media (max-width:560px){
  .sn-nav{ padding:9px 14px; gap:8px; }
  .sn-brand{ font-size:14px; }
  .sn-links a{ padding:6px 11px; font-size:13px; }
}

/* ===== 强制更新提示弹窗 ===== */
#sn-update-mask{
  position:fixed; inset:0; z-index:9999;
  background:rgba(15,23,42,.78);
  display:flex; align-items:center; justify-content:center;
  padding:18px; overflow:auto; -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
}
.sn-update-card{
  background:#fff; color:#0f172a; width:min(560px,100%);
  border-radius:16px; padding:26px 24px; box-shadow:0 20px 60px rgba(0,0,0,.35);
  max-height:90vh; overflow:auto;
}
.sn-update-badge{
  display:inline-block; background:#22c55e; color:#fff; font-weight:700;
  font-size:13px; padding:5px 12px; border-radius:999px; margin-bottom:10px;
}
.sn-update-card h2{ font-size:20px; margin:4px 0 2px; line-height:1.35; }
.sn-update-date{ color:#64748b; font-size:13px; margin-bottom:14px; }
.sn-update-list{ margin:0 0 14px; padding-left:20px; }
.sn-update-list li{ margin:7px 0; line-height:1.55; font-size:15px; }
.sn-update-hist{ border-top:1px dashed #e2e8f0; padding-top:12px; margin-top:6px; }
.sn-update-hist summary{ cursor:pointer; color:#2563eb; font-weight:600; font-size:14px; }
.sn-update-hist .cl-item{ margin-top:14px; }
.cl-head{ display:flex; gap:10px; align-items:baseline; }
.cl-v{ font-weight:800; color:#0f172a; }
.cl-d{ color:#94a3b8; font-size:12px; }
.cl-t{ font-weight:600; margin:2px 0 4px; }
.cl-item ul{ margin:0; padding-left:18px; }
.cl-item li{ font-size:13.5px; line-height:1.5; margin:4px 0; color:#334155; }
.sn-update-btn{
  display:block; width:100%; margin-top:18px; padding:14px;
  background:#2563eb; color:#fff; border:none; border-radius:10px;
  font-size:16px; font-weight:700; cursor:pointer;
}
.sn-update-btn:active{ background:#1d4ed8; }

/* ===== 内嵌运行器卡片 ===== */
.run-box{
  background:#0f172a; border-radius:12px; padding:12px; margin:14px 0;
  border:1px solid #1e293b;
}
.run-code{
  width:100%; min-height:140px; resize:vertical;
  background:#1e293b; color:#e2e8f0; border:1px solid #334155; border-radius:8px;
  padding:10px 12px; font-family:SFMono-Regular,Consolas,Menlo,monospace;
  font-size:14px; line-height:1.5; box-sizing:border-box;
}
.run-bar{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:10px 0 6px; }
.run-btn{
  background:#22c55e; color:#04210f; border:none; border-radius:8px;
  padding:11px 20px; font-size:15px; font-weight:800; cursor:pointer;
}
.run-btn:disabled{ opacity:.55; cursor:default; }
.run-lang{ background:#1e293b; color:#e2e8f0; border:1px solid #334155; border-radius:8px; padding:9px 10px; font-size:14px; }
.run-reset{ background:#334155; color:#e2e8f0; border:none; border-radius:8px; padding:9px 14px; font-size:14px; cursor:pointer; }
.run-badge{ font-size:13px; padding:6px 10px; border-radius:999px; background:#334155; color:#cbd5e1; margin-left:auto; }
.run-badge.run-ok{ background:#14532d; color:#86efac; }
.run-badge.run-err{ background:#7f1d1d; color:#fecaca; }
.run-badge.run-wait{ background:#3b2f08; color:#fde68a; }
.run-out{
  background:#020617; color:#a5f3fc; border-radius:8px; padding:10px 12px;
  font-family:SFMono-Regular,Consolas,Menlo,monospace; font-size:13.5px;
  white-space:pre-wrap; word-break:break-word; min-height:38px; margin:0;
}
.run-err{ color:#fca5a5; padding:8px; }

@media (max-width:560px){
  .sn-update-card{ padding:20px 16px; border-radius:12px; }
  .sn-update-card h2{ font-size:18px; }
  .run-btn{ flex:1 1 auto; }
  .run-lang{ flex:1 1 auto; }
}

/* ===== 加宽正文与代码区，减少两侧留白（覆盖各教程内联 max-width） ===== */
main{ max-width:1120px !important; }
@media (max-width:600px){
  main{ padding:20px 16px 90px !important; }
}

/* ===== 统一「复制」按钮：补齐部分教程缺失的样式，并为自动注入按钮提供外观 =====
   部分页面（如 C#/Ruby）有按钮但缺 .copy 定位样式，导致按钮跑偏；这里统一兜底。
   注：教程代码块为浅色 Prism 主题背景，故按钮用浅色外观。 */
.copy{ position:relative; }
.copy button, .copy-btn{
  position:absolute; top:8px; right:8px; z-index:2;
  border:1px solid #d0d5dd; background:#fff; color:#64748b;
  border-radius:6px; padding:4px 10px; font-size:11px; cursor:pointer; line-height:1.4;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif;
}
.copy button:hover, .copy-btn:hover{ background:#f1f5f9; color:#0f172a; border-color:#94a3b8; }
