/* ---------- 主题变量 ---------- */
:root {
  --bg: #0e1116;
  --bg-soft: #141922;
  --surface: #171d27;
  --surface-2: #1e2531;
  --border: #28313f;
  --text: #e7ebf2;
  --muted: #93a0b4;
  --accent: #5b9cff;
  --accent-soft: rgba(91, 156, 255, .12);
  --ok: #47d19a;
  --err: #ff6b6b;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --border: #dfe5ee;
  --text: #1b2330;
  --muted: #5d6b80;
  --accent: #2f6fed;
  --accent-soft: rgba(47, 111, 237, .1);
  --ok: #12996a;
  --err: #d64545;
  --shadow: 0 8px 24px rgba(19, 31, 51, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
main { min-height: 70vh; padding: 2.5rem 0 4rem; outline: none; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; height: 60px; min-width: 0; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 700; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.15rem; }
.nav { display: flex; gap: .25rem; margin-left: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; }
.nav a {
  color: var(--muted); padding: .4rem .75rem; border-radius: 9px;
  font-size: .925rem; transition: background .15s, color .15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.icon-btn {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; cursor: pointer; font-size: 1rem; line-height: 1;
}
.icon-btn:hover { border-color: var(--accent); }

/* ---------- 首页 ---------- */
.hero { padding: 2.5rem 0 1rem; }
.hero h1 { font-size: clamp(1.85rem, 4.6vw, 2.7rem); line-height: 1.25; margin: 0 0 .75rem; letter-spacing: -.02em; }
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 46ch; margin: 0 0 1.5rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.stats { display: flex; gap: 2rem; margin: 2.25rem 0 0; flex-wrap: wrap; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }

.section { margin-top: 3rem; }
.section-head { display: flex; align-items: baseline; gap: .75rem; margin-bottom: 1rem; }
.section-head h2 { font-size: 1.2rem; margin: 0; }
.section-head a { font-size: .875rem; margin-left: auto; }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1.05rem 1.1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-top { display: flex; align-items: center; gap: .6rem; }
.card-icon {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: .9rem; font-weight: 700;
}
.card-title { font-weight: 650; font-size: 1rem; }
.card-desc { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.card-meta { color: var(--muted); font-size: .78rem; display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .15rem; }

/* ---------- 工具页 ---------- */
.back { display: inline-flex; align-items: center; gap: .35rem; font-size: .875rem; color: var(--muted); margin-bottom: 1rem; }
.back:hover { color: var(--accent); text-decoration: none; }
.tool-head h1 { font-size: 1.5rem; margin: 0 0 .35rem; }
.tool-head p { color: var(--muted); margin: 0 0 1.5rem; font-size: .95rem; }
.tool-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; display: grid; gap: 1rem;
}
.field { display: grid; gap: .4rem; }
.field-label { font-size: .82rem; color: var(--muted); }
textarea.editor, input.input, select.select {
  width: 100%; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: .7rem .8rem; font: inherit; font-size: .9rem;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input.input, select.select { padding: .55rem .7rem; }
textarea.editor { font-family: var(--mono); line-height: 1.6; resize: vertical; min-height: 150px; }
textarea.editor:focus, input.input:focus, select.select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.out {
  margin: 0; padding: .8rem .9rem; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--mono); font-size: .86rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; overflow-x: auto; min-height: 2.6rem;
}
.out:empty::before { content: "结果会显示在这里"; color: var(--muted); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn {
  appearance: none; cursor: pointer; font: inherit; font-size: .875rem;
  padding: .5rem .9rem; border-radius: 9px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { color: #fff; filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--border); color: var(--text); filter: none; }
.btn-primary:disabled:hover { color: #fff; }
.status { font-size: .85rem; font-family: var(--mono); color: var(--muted); min-height: 1.2em; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.row { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kv { display: grid; gap: .35rem; }
.kv-row {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: .75rem;
  align-items: baseline; padding: .45rem .1rem; border-bottom: 1px dashed var(--border);
  font-size: .9rem;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row dt { color: var(--muted); font-size: .82rem; }
.kv-row dd { margin: 0; font-family: var(--mono); word-break: break-all; }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; }
.swatch {
  width: 74px; height: 54px; border-radius: 9px; border: 1px solid var(--border);
  display: flex; align-items: flex-end; justify-content: center;
  font-family: var(--mono); font-size: .66rem; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.65); cursor: pointer;
}
mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 .1em; }
.result-list { display: grid; gap: .4rem; font-family: var(--mono); font-size: .85rem; }
.result-list div { padding: .4rem .6rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; word-break: break-all; }

/* ---------- 笔记 ---------- */
.notes-layout { display: grid; gap: 2rem; grid-template-columns: 250px minmax(0, 1fr); align-items: start; }
.note-side { position: sticky; top: 78px; }
.note-search { margin-bottom: .75rem; }
.note-list { display: grid; gap: .3rem; }
.note-list a {
  display: block; padding: .5rem .65rem; border-radius: 9px;
  color: var(--text); font-size: .9rem; border: 1px solid transparent;
}
.note-list a:hover { background: var(--surface-2); text-decoration: none; }
.note-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.note-list .nl-date { display: block; color: var(--muted); font-size: .75rem; }
.note-empty { color: var(--muted); font-size: .875rem; padding: .5rem .65rem; }

.prose { max-width: 72ch; min-width: 0; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: 1.7rem; line-height: 1.3; margin: 0 0 1.1rem; letter-spacing: -.015em; }
.prose h2 { font-size: 1.25rem; margin: 2rem 0 .75rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.prose ul, .prose ol { padding-left: 1.35rem; }
.prose li { margin: .25rem 0; }
.prose blockquote {
  margin: 1rem 0; padding: .6rem 1rem; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 9px 9px 0; color: var(--muted);
}
.prose code {
  font-family: var(--mono); font-size: .86em; padding: .12em .38em;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
}
.prose pre {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 11px;
  padding: .9rem 1rem; overflow-x: auto; max-width: 100%;
  font-size: .85rem; line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 1rem 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: .45rem .7rem; text-align: left; }
.prose th { background: var(--surface-2); }
.prose img { display: block; max-width: 100%; margin: 1.15rem auto; border-radius: 10px; }
.prose p > em:only-child { color: var(--muted); font-size: .84rem; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.note-meta { color: var(--muted); font-size: .82rem; display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.note-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: .9rem; }

/* ---------- 页脚 / 提示 ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: .82rem; }
.footer-inner { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.dot { opacity: .5; }
.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 1rem);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  padding: .55rem 1rem; border-radius: 999px; font-size: .875rem;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.notice { padding: .8rem 1rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: .9rem; }

@media (max-width: 760px) {
  .notes-layout { grid-template-columns: 1fr; }
  .note-side { position: static; }
  .note-list { max-height: none; }
  .header-inner { gap: .5rem; }
  .brand-text { display: none; }
  .nav a { padding: .4rem .55rem; font-size: .875rem; }
  .kv-row { grid-template-columns: 1fr; gap: .1rem; }
}

/* ---------- 阅读进度条 ---------- */
.progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: var(--accent); transition: width .1s linear;
}

/* ---------- 首页 / 页面标题 ---------- */
.eyebrow {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 .8rem;
}
.page-head { margin-bottom: 1.75rem; }
.page-title { font-size: 1.9rem; margin: 0 0 .4rem; letter-spacing: -.02em; }
.page-sub { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- 标签 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .2rem;
  padding: .22rem .6rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); font-size: .8rem; line-height: 1.5;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.chip-active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.chip-sm { padding: .1rem .5rem; font-size: .72rem; }

/* ---------- 笔记载体 ---------- */
.note-rows { display: grid; gap: .15rem; }
.note-row {
  display: grid; grid-template-columns: 1fr; gap: 1.25rem;
  padding: 1rem .6rem; border-radius: 12px; color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.note-row:hover { background: var(--surface); text-decoration: none; }
.note-row:hover .nr-title { color: var(--accent); }
.nr-title { font-weight: 600; font-size: 1.05rem; line-height: 1.45; }
.nr-summary { color: var(--muted); font-size: .9rem; margin: .3rem 0 .45rem; line-height: 1.6; }
.nr-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.nr-time { color: var(--muted); font-size: .74rem; }

.notes-toolbar { display: grid; gap: .85rem; margin-bottom: .75rem; }
.search-input { font-size: .95rem; padding: .65rem .9rem; }
.note-empty { color: var(--muted); padding: 1.5rem .6rem; }

/* ---------- 笔记详情 ---------- */
.note-header { margin-bottom: 1.75rem; }
.note-title { font-size: clamp(1.6rem, 3.6vw, 2.1rem); line-height: 1.35; margin: 0 0 .6rem; letter-spacing: -.02em; }
.note-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 3rem; align-items: start; }
.prose h2, .prose h3 { scroll-margin-top: 84px; }
.toc { position: sticky; top: 80px; font-size: .84rem; max-height: calc(100vh - 110px); overflow: auto; }
.toc-title { color: var(--muted); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .55rem; }
.toc-link {
  display: block; padding: .22rem .5rem; color: var(--muted);
  border-left: 2px solid var(--border); line-height: 1.5;
}
.toc-link:hover { color: var(--text); text-decoration: none; border-left-color: var(--accent); }
.toc-l3 { padding-left: 1.1rem; font-size: .8rem; }
.toc-active { color: var(--accent); border-left-color: var(--accent); }

.notice-error { border-color: color-mix(in srgb, var(--err) 45%, var(--border)); }.notice code, .about code { font-family: var(--mono); font-size: .86em; }
.about { max-width: 68ch; }

@media (max-width: 860px) {
  .note-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .toc { position: static; max-height: none; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .note-row { grid-template-columns: 1fr; gap: .25rem; }
  .nr-date { font-size: .78rem; }
  .page-title { font-size: 1.6rem; }
}


/* ---------- 数学公式（KaTeX） ---------- */
.math-display {
  margin: 1rem 0; padding: .35rem 0;
  overflow-x: auto; overflow-y: hidden;
  text-align: center;
}
.math-raw { font-family: var(--mono); font-size: .9em; color: var(--muted); }
.prose .katex { font-size: 1.04em; }
.prose .katex-display { margin: .75rem 0; overflow-x: auto; overflow-y: hidden; padding: .1rem 0; }
td .katex, th .katex { white-space: nowrap; }

/* ---------- 资料（试卷 PDF） ---------- */
.stat-line {
  display: inline-block; margin: .1rem 0 1.5rem; padding: .3rem .7rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); font-size: .8rem; color: var(--muted);
}
.course-block { margin-top: 2.5rem; }
.course-block:first-of-type { margin-top: 1rem; }
.course-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .45rem; }
.course-head h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.01em; }
.course-desc { color: var(--muted); font-size: .9rem; line-height: 1.65; margin: 0 0 1.1rem; max-width: 72ch; }
.grid-files { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.file-card {
  display: flex; flex-direction: column; gap: .6rem;
  padding: 1.05rem 1.15rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.file-top { display: flex; align-items: center; gap: .7rem; }
.file-icon {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 9px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: .62rem; font-weight: 700; letter-spacing: .02em;
}
.file-head { min-width: 0; }
.file-title { font-weight: 650; font-size: .98rem; line-height: 1.4; }
.file-meta { color: var(--muted); font-size: .76rem; font-family: var(--mono); margin-top: .1rem; }
.file-desc { color: var(--muted); font-size: .86rem; line-height: 1.6; margin: 0; }
.file-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .35rem; }
.file-actions .btn { font-size: .82rem; padding: .4rem .8rem; }

/* ---------- 联系方式 ---------- */
.contact-list { display: grid; gap: .5rem; margin: 1rem 0 .75rem; max-width: 34rem; }
.contact-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .85rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
}
.contact-label { flex: none; width: 5.5rem; color: var(--muted); font-size: .85rem; }
.contact-value { font-family: var(--mono); font-size: .9rem; word-break: break-all; }
.contact-item .btn { margin-left: auto; flex: none; }
.btn-mini { font-size: .78rem; padding: .28rem .6rem; }

/* ---------- 代码块一键复制 ---------- */
.code-wrap { position: relative; }
.code-wrap > pre { margin-bottom: 1rem; padding-right: 3.4rem; }
.code-copy {
  position: absolute; top: .5rem; right: .5rem; z-index: 2;
  font: inherit; font-size: .72rem; line-height: 1.4;
  padding: .18rem .55rem; border-radius: 7px; cursor: pointer;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border);
  opacity: 0; transition: opacity .15s, color .15s, border-color .15s;
}
.code-wrap:hover .code-copy,
.code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: var(--accent); border-color: var(--accent); }
.code-copy:active { transform: translateY(1px); }
@media (hover: none) { .code-copy { opacity: 1; } }

/* 长代码折叠 */
.code-wrap.has-toggle > pre { margin-bottom: 0; border-radius: 11px 11px 0 0; }
.code-wrap.is-collapsed > pre {
  max-height: 360px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
}
.code-toggle {
  display: block; width: 100%; font: inherit; font-size: .78rem;
  padding: .45rem; margin: 0 0 1rem; cursor: pointer;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 11px 11px;
  transition: color .15s, background .15s;
}
.code-toggle:hover { color: var(--accent); background: var(--accent-soft); }
@media print {
  .code-wrap.is-collapsed > pre { max-height: none; mask-image: none; -webkit-mask-image: none; }
  .code-toggle { display: none; }
  /* 打印时按纸宽折行，避免长行被裁掉 */
  .prose pre { white-space: pre-wrap; word-break: break-word; overflow: visible; }
}
.contact-note { color: var(--muted); font-size: .84rem; }

/* ---------- 工具：PDF 工具 ---------- */
.tabs {
  display: flex; gap: .3rem; padding: .25rem;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 11px;
}
.tab {
  flex: 1; font: inherit; font-size: .88rem; line-height: 1.6;
  padding: .45rem .8rem; border-radius: 9px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  transition: color .15s, background .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); border-color: var(--border); color: var(--accent); }
.pdf-panel { display: grid; gap: 1rem; }
.pdf-panel[hidden] { display: none; }

.dropzone {
  display: grid; justify-items: center; gap: .3rem;
  padding: 1.8rem 1rem; text-align: center; cursor: pointer;
  border: 2px dashed var(--border); border-radius: 14px;
  color: var(--muted); transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone-icon { font-size: 1.5rem; line-height: 1; }
.dropzone strong { color: var(--text); }
.dropzone-hint { font-size: .78rem; }

.file-list { display: grid; gap: .45rem; }
.file-row {
  position: relative;
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .6rem .5rem .55rem; font-size: .88rem;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  cursor: grab;
}
.file-row:active { cursor: grabbing; }
.file-row.is-dragging { opacity: .4; }
.file-row-grip { flex: none; color: var(--muted); font-size: .95rem; line-height: 1; letter-spacing: -1px; user-select: none; }
.file-row.drop-before::before,
.file-row.drop-after::after {
  content: ""; position: absolute; left: .35rem; right: .35rem; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.file-row.drop-before::before { top: -3px; }
.file-row.drop-after::after { bottom: -3px; }
.file-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-meta { flex: none; color: var(--muted); font-size: .76rem; font-family: var(--mono); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; font-size: .8rem; }
.icon-btn.sm:disabled { opacity: .35; cursor: default; }
.icon-btn.sm:disabled:hover { border-color: var(--border); }

/* ---------- 工具：模逆元 ---------- */
.inv-result {
  display: grid; gap: .35rem; padding: .9rem 1rem;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
}
.inv-value {
  font-family: var(--mono); font-size: 1.15rem; line-height: 1.5;
  word-break: break-all; color: var(--accent);
}
.steps { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .8rem; margin-top: .5rem; }
.steps th, .steps td { border: 1px solid var(--border); padding: .32rem .5rem; text-align: right; }
.steps th { background: var(--surface-2); color: var(--muted); font-weight: 500; text-align: right; }
.steps tbody tr:last-child td { color: var(--muted); }
.steps .steps-last td { color: var(--muted); font-style: italic; }
