/* 洛谷算法评分系统 v3 · 共用样式 */
:root {
  --blue-900: #10375c;
  --blue-700: #1c5d99;
  --blue-600: #2e75b6;
  --blue-500: #3d8fd1;
  --blue-100: #e7f2fb;
  --blue-50: #f4f9fd;
  --green: #52c41a;
  --green-dark: #389e0d;
  --green-bg: #f0fbe8;
  --red: #e5484d;
  --amber: #d48806;
  --ink: #1f2933;
  --ink-2: #52606d;
  --ink-3: #7b8794;
  --line: #e3edf5;
  --card: #ffffff;
  --radius: 14px;
  --shadow-sm: 0 2px 10px rgba(23, 62, 102, 0.06);
  --shadow: 0 10px 30px rgba(23, 62, 102, 0.10);
  --shadow-lg: 0 24px 60px rgba(23, 62, 102, 0.16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--blue-50);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 10px; font-size: 14px; cursor: pointer;
  transition: all .16s ease; white-space: nowrap;
}
.btn:hover { border-color: #c5dcee; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); border-color: transparent; color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-green { background: linear-gradient(135deg, #57c22b, #48b115); border-color: transparent; color: #fff; }
.btn-danger { color: var(--red); border-color: #f6d3d4; background: #fff6f6; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(61, 143, 209, .12); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid rgba(227, 237, 245, .8); }
.card-pad { padding: 20px 22px; }
.section-title { font-size: 17px; font-weight: 700; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.section-sub { font-size: 13px; color: var(--ink-3); margin: 0 0 16px; }
.muted { color: var(--ink-3); }
.tiny { font-size: 12px; }
.mono { font-family: "JetBrains Mono", Consolas, "Courier New", monospace; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-blue { background: var(--blue-100); color: var(--blue-700); }
.pill-green { background: var(--green-bg); color: var(--green-dark); }
.pill-red { background: #fdecec; color: var(--red); }
.pill-gray { background: #f1f5f9; color: var(--ink-2); }
.pill-amber { background: #fdf6e3; color: var(--amber); }

.status-AC { color: var(--green-dark); font-weight: 700; }
.status-bad { color: var(--red); font-weight: 700; }
.status-warn { color: var(--amber); font-weight: 700; }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(20, 40, 60, .92); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow); animation: toast-in .2s ease;
}
.toast.err { background: rgba(190, 40, 44, .95); }
.toast.ok { background: rgba(35, 128, 60, .95); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 浮动卡片（首页） ---------- */
.hero {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 520px at 12% -10%, #d9ecfb 0%, transparent 60%),
    radial-gradient(900px 480px at 100% 0%, #e8f7e6 0%, transparent 55%),
    linear-gradient(180deg, #f7fbfe 0%, #eef6fc 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(46, 117, 182, .10) 1px, transparent 1px);
  background-size: 26px 26px; mask-image: linear-gradient(180deg, rgba(0,0,0,.7), transparent 75%);
  pointer-events: none;
}
.hero-head { position: relative; text-align: center; margin-bottom: 44px; }
.hero-badge {
  display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,255,255,.8); border: 1px solid var(--line); font-size: 12px; color: var(--blue-700);
  font-weight: 600; letter-spacing: .3px; box-shadow: var(--shadow-sm);
}
.hero h1 { font-size: clamp(26px, 3.4vw, 40px); margin: 18px 0 10px; letter-spacing: -.5px; }
.hero p.lead { color: var(--ink-2); font-size: 15px; margin: 0; }

.float-stage { position: relative; display: grid; grid-template-columns: repeat(2, minmax(280px, 360px)); gap: 32px; z-index: 1; }
@media (max-width: 760px) { .float-stage { grid-template-columns: 1fr; gap: 22px; } }

.float-card {
  position: relative; display: block; background: #fff; border-radius: 20px; padding: 30px 28px 26px;
  border: 1px solid rgba(227, 237, 245, .9);
  box-shadow: 0 18px 40px rgba(23, 62, 102, .12);
  cursor: pointer; color: inherit; text-decoration: none;
  animation: floaty 6s ease-in-out infinite;
  transition: transform .28s cubic-bezier(.2,.8,.3,1), box-shadow .28s;
  will-change: transform;
}
.float-card:nth-child(2) { animation-delay: -3s; }
.float-card:hover { transform: translateY(-10px) scale(1.015); box-shadow: 0 30px 60px rgba(23, 62, 102, .20); text-decoration: none; }
.float-card:active { transform: translateY(-4px) scale(1.005); }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@media (prefers-reduced-motion: reduce) { .float-card { animation: none; } }

.float-card .icon {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  font-size: 26px; margin-bottom: 18px;
}
.float-card.student .icon { background: linear-gradient(135deg, #e7f2fb, #d3e8fa); }
.float-card.teacher .icon { background: linear-gradient(135deg, #eaf8e4, #d8f2cf); }
.float-card h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.2px; }
.float-card .desc { color: var(--ink-2); font-size: 13.5px; line-height: 1.7; margin: 0 0 18px; min-height: 46px; }
.float-card .enter { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--blue-600); }
.float-card.teacher .enter { color: var(--green-dark); }
.float-card .enter svg { transition: transform .2s; }
.float-card:hover .enter svg { transform: translateX(4px); }
.float-card .tag { position: absolute; top: 18px; right: 18px; font-size: 11px; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: var(--ink-2); }

.hero-foot { position: relative; margin-top: 40px; text-align: center; color: var(--ink-3); font-size: 12.5px; line-height: 1.9; }
.hero-foot .kbd { display: inline-block; padding: 2px 7px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font-family: Consolas, monospace; }

/* ---------- 登录遮罩 ---------- */
.login-wrap {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(160deg, #eef6fc 0%, #f7fbfe 50%, #eef8ea 100%);
}
.login-card { width: min(430px, 100%); background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 34px 32px 28px; }
.login-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-card .brand .avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); color: #fff; font-weight: 800; }
.login-card h2 { margin: 12px 0 4px; font-size: 22px; }
.login-card .hint { color: var(--ink-3); font-size: 13px; margin: 0 0 22px; }
.login-card .notice {
  background: #fff8f0; border: 1px solid #f5e2c8; color: #8a5a00; border-radius: 10px;
  padding: 11px 13px; font-size: 12.5px; line-height: 1.65; margin-bottom: 18px;
}
.login-card .notice b { color: #b45309; }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 10px; }

/* ---------- 应用外壳 ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap; row-gap: 10px;
  padding: 12px 26px; background: rgba(255,255,255,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar > .btn, .topbar > .pill, .topbar > .countdown { flex: none; }
.topbar .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; }
.topbar .logo .dot { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--blue-600), var(--blue-500)); color: #fff; display: grid; place-items: center; font-size: 13px; }
.topbar .spacer { flex: 1; }
.topbar .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.topbar .who b { color: var(--ink); white-space: nowrap; }

.countdown {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-radius: 12px;
  background: linear-gradient(135deg, #10375c, #1c5d99); color: #fff; box-shadow: var(--shadow-sm);
  /* 顶栏挤的时候不许被压扁：以前「已结束」「待开考」会被压成竖排两行 */
  flex: none; white-space: nowrap;
}
.countdown .label { font-size: 11px; opacity: .75; letter-spacing: .5px; white-space: nowrap; }
.countdown .time { font-family: Consolas, monospace; font-size: 19px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.countdown.warn { background: linear-gradient(135deg, #9a3412, #c2410c); }
.countdown.idle { background: linear-gradient(135deg, #475569, #64748b); }

.wrap { width: min(1280px, 100%); margin: 0 auto; padding: 24px 26px 60px; flex: 1; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
@media (max-width: 1040px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 题目卡 ---------- */
.problem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.problem-card {
  position: relative; padding: 16px 16px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
  cursor: pointer; transition: all .18s ease; display: flex; flex-direction: column; gap: 8px;
}
.problem-card:hover { border-color: #b9d8ef; box-shadow: var(--shadow); transform: translateY(-2px); }
.problem-card .top { display: flex; align-items: center; gap: 8px; }
.problem-card .pid { font-weight: 800; color: var(--blue-700); font-size: 13px; }
.problem-card .name { font-weight: 700; font-size: 15px; line-height: 1.45; }
.problem-card .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.problem-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.problem-card .score { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.problem-card.done { border-color: #cdebc0; background: linear-gradient(180deg, #fbfef9, #fff); }
.problem-card .ribbon {
  position: absolute; top: 0; right: 12px; padding: 2px 8px 3px; border-radius: 0 0 6px 6px;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--green);
}
.difficulty { font-size: 11px; padding: 1px 7px; border-radius: 5px; font-weight: 700; }
.diff-1 { background: #fff1f0; color: #cf1322; }
.diff-2 { background: #fff7e6; color: #d46b08; }
.diff-3 { background: #feffe6; color: #7cb305; }
.diff-4 { background: #f0f5ff; color: #2f54eb; }
.diff-5 { background: #f9f0ff; color: #531dab; }

/* ---------- 侧栏 ---------- */
.side-card { margin-bottom: 18px; }
.ide-list { display: flex; flex-direction: column; gap: 9px; }
.ide-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: #fbfdff;
}
.ide-item .badge { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: var(--blue-600); flex: none; }
.ide-item .nm { flex: 1; min-width: 0; }
.ide-item .nm b { display: block; font-size: 13px; }
.ide-item .nm span { display: block; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rec-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.rec-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.rec-item:hover { background: var(--blue-50); }
.rec-item .t { flex: 1; min-width: 0; }
.rec-item .t b { font-size: 13px; }
.rec-item .t span { display: block; font-size: 11px; color: var(--ink-3); }
.empty { padding: 22px 10px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; max-height: calc(100vh - 250px); }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; table-layout: auto; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
/* 固定列宽 + 末尾 filler 吃掉多余空白，避免「姓名」列被拉得很宽 */
table.data .w-rank { width: 58px; }
table.data .w-sid { width: 128px; }
table.data .w-name { width: 118px; }
table.data .w-prob { width: 92px; }
table.data .w-total { width: 66px; }
table.data .w-num { width: 58px; }
table.data .w-time { width: 88px; }
table.data .filler { width: auto; padding: 0; }
table.data thead tr.g th.w-rank { left: 0; }
table.data thead tr.g th.w-sid { left: 58px; }
table.data thead tr.g th.w-name { left: 186px; }
table.data tbody td.w-rank { left: 0; }
table.data tbody td.w-sid { left: 58px; }
table.data tbody td.w-name { left: 186px; }
table.data thead th {
  position: sticky; top: 0; z-index: 3; background: #f6fbfe; color: var(--ink-2);
  font-weight: 700; font-size: 12.5px; text-align: center; border-bottom: 1px solid var(--line);
}
table.data thead tr.g th { top: 0; height: 34px; }
table.data thead tr.s th { top: 34px; font-weight: 600; color: var(--ink-3); font-size: 11.5px; }
table.data tbody tr:hover td { background: #f9fcff; }
table.data tbody tr.me td { background: #fffbe6; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: Consolas, monospace; }
table.data td.c { text-align: center; }
table.data .sticky-l { position: sticky; left: 0; background: #fff; z-index: 2; }
table.data thead .sticky-l { z-index: 4; background: #f6fbfe; }
.cell-score { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 2px 6px; border-radius: 6px; font-weight: 700; cursor: pointer; }
.cell-AC { background: var(--green-bg); color: var(--green-dark); }
.cell-bad { background: #fdecec; color: var(--red); }
.cell-none { color: #c3cfda; }
.rank-1 { color: #b8860b; font-weight: 800; }
.rank-2 { color: #8a94a6; font-weight: 800; }
.rank-3 { color: #a9713b; font-weight: 800; }

/* ---------- 教师端 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--blue-600); }
.tab.active { color: var(--blue-700); border-bottom-color: var(--blue-600); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--ink-3); }
.stat .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }

.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 150px; margin-bottom: 0; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--blue-50); border: 1px solid var(--line); font-size: 12.5px; }
.chip b { font-weight: 700; }
.chip button { border: none; background: none; color: var(--ink-3); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.chip button:hover { color: var(--red); }

/* ---------- 记录详情（对齐洛谷页面） ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 35, 55, .42); backdrop-filter: blur(2px); z-index: 200; display: grid; place-items: start center; overflow: auto; padding: 40px 18px; }
.modal-mask.hidden { display: none; }
.record-modal { width: min(1180px, 100%); background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.985) translateY(6px); } to { opacity: 1; transform: none; } }
.rm-head { padding: 22px 26px 0; background: linear-gradient(135deg, #f7fbff, #eef6fd); border-bottom: 1px solid var(--line); }
.rm-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.rm-title { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.2px; }
.rm-meta { display: flex; gap: 26px; text-align: center; }
.rm-meta .m .k { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.rm-meta .m .v { font-size: 14px; font-weight: 700; }
.rm-tabs { display: flex; gap: 26px; margin-top: 18px; }
.rm-tab { padding: 10px 2px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; cursor: pointer; }
.rm-tab.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.rm-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; padding: 22px 26px 26px; }
@media (max-width: 900px) { .rm-body { grid-template-columns: 1fr; } }
.rm-panel-title { font-size: 15px; font-weight: 800; margin: 0 0 14px; }
.tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.tc {
  border-radius: 6px; padding: 12px 10px 10px; text-align: center; color: #fff;
  background: var(--green); min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.tc .no { position: relative; font-size: 12px; opacity: .95; align-self: flex-start; margin: -4px 0 0 -2px; font-weight: 700; }
.tc .st { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.tc .res { font-size: 11.5px; opacity: .95; font-family: Consolas, monospace; }
.tc.WA, .tc.RE, .tc.CE { background: #e5484d; }
.tc.TLE, .tc.MLE, .tc.OLE { background: #d48806; }
.tc.PE { background: #7c8db5; }
.rm-info .row-i { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #e8eff6; }
.rm-info .row-i:last-child { border-bottom: none; }
.rm-info .k { font-size: 14px; font-weight: 700; color: var(--ink); }
.rm-info .v { font-size: 14px; text-align: right; }
.rm-user { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.rm-user .av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #cfe6f8, #a8d0ee); display: grid; place-items: center; color: #fff; font-weight: 800; }
.rm-user .nm { font-weight: 700; color: var(--blue-600); font-size: 15px; }
.rm-code { background: #0f1b26; color: #d7e6f2; border-radius: 10px; padding: 16px; font-family: Consolas, monospace; font-size: 13px; line-height: 1.7; min-height: 260px; overflow: auto; white-space: pre-wrap; }
.rm-close { position: sticky; top: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 0 26px 22px; }

/* ---------- IDE 模式 ---------- */
.ide-modal { width: min(1180px, 100%); }
.ide-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; padding: 20px 24px 24px; }
@media (max-width: 900px) { .ide-body { grid-template-columns: 1fr; } }
.editor-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.editor-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #f3f8fc; border-bottom: 1px solid var(--line); }
.editor-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.editor-bar .dot.y { background: #febc2e; }
.editor-bar .dot.g { background: #28c840; }
.editor-bar select { margin-left: auto; border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px; font-size: 12px; background: #fff; }
.editor { width: 100%; min-height: 380px; border: none; outline: none; resize: vertical; padding: 14px; font-family: Consolas, "JetBrains Mono", monospace; font-size: 13.5px; line-height: 1.65; color: #e6f0f8; background: #0f1b26; tab-size: 4; }
.ide-side .box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; background: #fbfdff; }
.ide-side .box h4 { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.steps { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfe0ee; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b6cee2; background-clip: padding-box; }

.hide { display: none !important; }
.flex { display: flex; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; }
.mb16 { margin-bottom: 16px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
/* 入口页底部：局域网地址 + 根证书下载 */
.lan-box {
  max-width: 720px; margin: 0 auto 14px; padding: 14px 18px 15px;
  background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 6px 20px rgba(31,72,120,.06); text-align: left;
}
.lan-title { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: #1f4a75; }
.lan-title svg { color: var(--blue); flex: none; }
.lan-urls { display: flex; flex-wrap: wrap; gap: 8px; margin: 9px 0 8px; }
.lan-url {
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; font-weight: 600;
  color: #1b5c9a; background: #eaf4fe; border: 1px solid #cfe4f8; border-radius: 8px;
  padding: 5px 10px; cursor: pointer; transition: background .15s, transform .12s;
}
.lan-url:hover { background: #dcecfd; transform: translateY(-1px); }
/* 「免装证书」是主推入口：绿色；https 那条是次选：灰一点 */
.lan-url { display: inline-flex; align-items: center; gap: 7px; background: #e9f8ef; border-color: #c3e9d2; color: #12703a; }
.lan-url:hover { background: #dbf3e6; }
.lan-url.ghost { background: #eef3fb; border-color: #d8e3f2; color: #365b86; }
.lan-url.ghost:hover { background: #e2ebf8; }
/* 公网地址：蓝色强调，排在最前面 */
.lan-url.pub { background: #e8f1ff; border-color: #b9d4f7; color: #10457f; }
.lan-url.pub:hover { background: #d9e8fd; }
.lan-url.pub .lan-tag { background: #10457f; color: #fff; }
.lan-tag { font-family: inherit; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.75); }
.lan-tip { font-size: 11.5px; line-height: 1.75; color: var(--muted); }
.lan-link { color: var(--blue); font-weight: 700; text-decoration: none; border-bottom: 1px dashed currentColor; }

.lan-alt { font-size: 11.5px; line-height: 1.8; color: var(--muted); margin: 0 0 6px; }
.lan-alt .lan-link { font-family: ui-monospace, Consolas, monospace; }
