/* =========================================================
   论文格式工具箱 — 全局样式
   纯手写，无框架，无外部依赖
   ========================================================= */

:root {
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f8fafc;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --ok: #059669;
  --warn: #b45309;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --maxw: 1080px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: #fff;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.35;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 页头 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
  color: var(--brand);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav a:hover {
  background: var(--soft);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

/* ---------- 首页 hero ---------- */

.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.hero .lead {
  font-size: 1.06rem;
  color: var(--ink-2);
  max-width: 620px;
  margin-bottom: 20px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.85rem;
}

.badge.accent {
  background: var(--brand-soft);
  border-color: #bfdbfe;
  color: var(--brand-dark);
}

/* ---------- 卡片网格 ---------- */

.section {
  padding: 40px 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title span {
  color: var(--muted);
  font-size: 0.88rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.card:hover {
  text-decoration: none;
  border-color: #c7d2fe;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card .icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.card h3 {
  margin-bottom: 6px;
}

.card p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.card .more {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--brand);
  font-weight: 600;
}

/* ---------- 工具页布局 ---------- */

.page-head {
  padding: 36px 0 8px;
}

.page-head h1 {
  font-size: 1.9rem;
}

.page-head .lead {
  color: var(--muted);
  max-width: 720px;
  margin-bottom: 0;
}

.crumb {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.tool {
  padding: 28px 0 40px;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 20px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-2);
}

.panel-title .hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- 表单 ---------- */

.field {
  margin-bottom: 14px;
}

.field > label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
}

.field .sub {
  font-weight: 400;
  color: var(--muted);
}

.row {
  display: grid;
  gap: 12px;
}

.row-2 {
  grid-template-columns: 1fr 1fr;
}

.row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

input[type="text"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.94rem;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.8;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--ink-2);
  cursor: pointer;
}

.check input {
  margin-top: 4px;
  accent-color: var(--brand);
  flex: none;
}

/* ---------- 按钮 ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  background: var(--brand-dark);
}

.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
}

.btn.ghost:hover {
  border-color: #cbd5e1;
  background: var(--soft);
  text-decoration: none;
}

.btn.small {
  padding: 5px 10px;
  font-size: 0.84rem;
  border-radius: 7px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- 输出区 ---------- */

.output {
  min-height: 120px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: var(--soft);
  font-size: 0.94rem;
  line-height: 1.9;
  word-break: break-word;
  white-space: pre-wrap;
}

.output.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.output .placeholder {
  color: #94a3b8;
}

.ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: ref;
}

.ref-list li {
  position: relative;
  padding: 10px 36px 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.8;
  word-break: break-word;
}

.ref-list li:last-child {
  border-bottom: none;
}

.ref-list li .del {
  position: absolute;
  right: 4px;
  top: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.ref-list li .del:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* ---------- 统计 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.stat {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.stat .num {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat .label {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.stat.primary {
  border-color: #bfdbfe;
  background: var(--brand-soft);
}

.stat.primary .num {
  color: var(--brand-dark);
}

/* ---------- 提示 ---------- */

.note {
  padding: 12px 14px;
  border-left: 3px solid #bfdbfe;
  border-radius: 0 8px 8px 0;
  background: var(--soft);
  color: var(--ink-2);
  font-size: 0.88rem;
}

.note strong {
  color: var(--ink);
}

.note.warn {
  border-left-color: #fcd34d;
  background: #fffbeb;
}

/* ---------- 说明内容 ---------- */

.prose {
  /* 容器仍与页头同宽，正文块单独限宽，保证左对齐 */
}

.prose > * {
  max-width: 760px;
}

.prose h2 {
  margin-top: 32px;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 0.35em;
  color: var(--ink-2);
}

.prose code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
}

/* ---------- 服务入口 ---------- */

.service {
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fbff, #fff);
  padding: 24px;
}

.service h2 {
  margin-bottom: 6px;
}

.service p {
  color: var(--ink-2);
  margin-bottom: 10px;
}

.service-list {
  margin: 0 0 16px;
  padding-left: 1.2em;
  color: var(--ink-2);
  font-size: 0.92rem;
}

.service-list li {
  margin-bottom: 4px;
}

.contact-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px dashed #93c5fd;
  border-radius: 10px;
  background: #fff;
}

.contact-label {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.contact-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
}

.contact-value.placeholder {
  font-size: 0.92rem;
  font-weight: 500;
  color: #94a3b8;
}

.contact-qr {
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: 28px;
  padding: 14px 20px;
}

.contact-qr .contact-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.qr-img {
  flex: none;
  width: 120px;
  height: 120px;
  object-fit: contain;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

@media (max-width: 560px) {
  .qr-img {
    width: 88px;
    height: 88px;
  }
}

/* ---------- 页脚始终贴在页面底部 ---------- */

html,
body {
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
  width: 100%;
}

.site-footer {
  margin-top: auto;
  flex: none;
  width: 100%;
}
/* ---------- 导航页 ---------- */

.nav-hero {
  padding: 40px 0 8px;
}

.nav-hero h1 {
  font-size: 2.1rem;
  margin-bottom: 8px;
}

.nav-hero .lead {
  color: var(--ink-2);
  max-width: 640px;
  margin-bottom: 22px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-bar:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-bar .s-icon {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  padding: 11px 0;
  border: none;
  background: transparent;
  font-size: 1.02rem;
}

.search-bar input:focus {
  outline: none;
  box-shadow: none;
}

.search-bar .kbd {
  display: none;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

@media (min-width: 700px) {
  .search-bar .kbd {
    display: inline-block;
  }
}

.scopes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 4px;
}

.chip {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  border-color: #bfdbfe;
  color: var(--brand);
}

.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.nav-sec {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.nav-sec:first-of-type {
  border-top: none;
}

.nav-sec h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.nav-sec h2 .count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 10px;
}

.link-item {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.link-item:hover {
  border-color: #bfdbfe;
  background: var(--brand-soft);
  text-decoration: none;
  transform: translateY(-1px);
}

.link-item.mine {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff, #fff);
}

.link-name {
  display: block;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink);
}

.link-desc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.link-item mark {
  padding: 0 1px;
  border-radius: 3px;
  background: #fef08a;
  color: inherit;
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.empty-state h3 {
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--muted);
  font-size: 0.9rem;
}

.external {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

/* ---------- 搜索引擎选择 ---------- */

.search-bar .engine {
  flex: none;
  width: auto;
  appearance: none;
  padding: 7px 26px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.search-hint {
  margin: 9px 0 0;
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.82rem;
}

.search-hint b {
  color: var(--brand);
  font-weight: 600;
}

.theme-btn {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.theme-btn:hover {
  background: var(--soft);
}

/* ---------- 我的快捷方式 ---------- */

.quick-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px dashed #93c5fd;
  border-radius: 10px;
  background: var(--soft);
}

.quick-form input {
  flex: 1 1 180px;
}

.shortcut {
  position: relative;
  padding-right: 34px;
}

.shortcut .del {
  position: absolute;
  right: 6px;
  top: 8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.shortcut .del:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.shortcut-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.sec-head-btn {
  margin-left: auto;
  align-self: center;
}

/* ---------- 深色模式 ---------- */

[data-theme="dark"] {
  --ink: #e6edf6;
  --ink-2: #c3ccd9;
  --muted: #8b98a8;
  --line: #2a3441;
  --soft: #131a23;
  --brand: #4f8ef7;
  --brand-dark: #6ea4ff;
  --brand-soft: #16233a;
  color-scheme: dark;
}

[data-theme="dark"] body,
[data-theme="dark"] html {
  background: #0f141b;
}

[data-theme="dark"] .site-header {
  background: rgba(15, 20, 27, 0.9);
}

[data-theme="dark"] .card,
[data-theme="dark"] .panel,
[data-theme="dark"] .stat,
[data-theme="dark"] .link-item,
[data-theme="dark"] .search-bar,
[data-theme="dark"] .contact-box,
[data-theme="dark"] .chip,
[data-theme="dark"] .theme-btn {
  background: #151d27;
}

[data-theme="dark"] .search-bar .engine {
  background-color: #151d27;
}

[data-theme="dark"] .link-item.mine {
  background: linear-gradient(180deg, #172231, #151d27);
}

[data-theme="dark"] .service,
[data-theme="dark"] .quick-form {
  background: #131a23;
  border-color: #2a3441;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #151d27;
  color: var(--ink);
  border-color: var(--line);
}

[data-theme="dark"] .output,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .note {
  background: #131a23;
}

[data-theme="dark"] .note.warn {
  background: #221c10;
  border-left-color: #a16207;
}

[data-theme="dark"] .btn.ghost {
  background: #151d27;
  color: var(--ink-2);
}

[data-theme="dark"] .toast {
  background: #e6edf6;
  color: #0f141b;
}

[data-theme="dark"] mark {
  background: #7c5a12;
  color: #ffe9a8;
}

[data-theme="dark"] .ref-list li {
  border-color: var(--line);
}

[data-theme="dark"] .shortcut .del:hover {
  background: #43181c;
  color: #fca5a5;
}

/* ---------- 论文自查 ---------- */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: none;
  padding: 10px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--ink-2);
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.mark-dup {
  border-radius: 2px;
  background: #fee2e2;
  color: #991b1b;
  padding: 0 1px;
}

[data-theme="dark"] .mark-dup {
  background: #4c1d1d;
  color: #fca5a5;
}

.score-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.score {
  flex: 1 1 120px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.score .n {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.score .k {
  color: var(--muted);
  font-size: 0.78rem;
}

.result-box {
  max-height: 380px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  font-size: 0.88rem;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-list li {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.88rem;
  line-height: 1.75;
}

.result-list li:last-child {
  border-bottom: none;
}

.result-list .snippet {
  color: var(--ink-2);
}

.result-list .meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill.ok {
  background: #dcfce7;
  color: #166534;
}

.pill.warn {
  background: #fef3c7;
  color: #92400e;
}

.pill.bad {
  background: #fee2e2;
  color: #991b1b;
}

.pill.muted {
  background: #f1f5f9;
  color: #64748b;
}

[data-theme="dark"] .pill.muted {
  background: #1e2733;
  color: #94a3b8;
}

[data-theme="dark"] .pill.ok {
  background: #06301c;
  color: #4ade80;
}

[data-theme="dark"] .pill.warn {
  background: #2b2208;
  color: #fbbf24;
}

[data-theme="dark"] .pill.bad {
  background: #3b1214;
  color: #fca5a5;
}

[data-theme="dark"] .score {
  background: #151d27;
}

[data-theme="dark"] .result-box {
  background: #131a23;
}



/* ---------- 悬浮咨询 ---------- */

.float-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  transition: background 0.15s, transform 0.15s;
}

.float-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-2px);
}

.float-btn-2 {
  bottom: 76px;
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.12);
}

.float-btn-2:hover {
  background: var(--soft);
  color: var(--ink);
}

@media (max-width: 780px) {
  .float-btn-2 {
    bottom: 68px;
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.modal.show {
  display: grid;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 26px 22px 20px;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal-card h3 {
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.modal-qr {
  display: block;
  width: 200px;
  height: 200px;
  margin: 14px auto 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
}

.modal-id {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.modal-label {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.modal-num {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.modal-tip {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--soft);
  color: var(--ink);
}

[data-theme="dark"] .modal-card {
  background: #151d27;
}

[data-theme="dark"] .modal-qr {
  background: #fff;
}

/* ---------- 分栏页脚 ---------- */

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, minmax(105px, 1fr));
  gap: 24px;
  padding: 8px 0 28px;
}

.footer-brand p {
  margin: 12px 0 0;
  max-width: 300px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--ink);
}

.footer-col a {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-col a:hover {
  color: var(--brand);
  text-decoration: none;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  padding-top: 18px;
  padding-right: 150px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 780px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    padding-right: 0;
  }

  .site-footer {
    padding-bottom: 96px;
  }

  .float-btn {
    right: 16px;
    bottom: 16px;
    padding: 10px 15px;
  }
}

/* ---------- 顶部站内搜索 ---------- */

.header-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  margin-right: auto;
  margin-left: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.header-search:hover {
  border-color: #cbd5e1;
  background: var(--soft);
  color: var(--ink-2);
}

.header-search .hs-kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.7rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--muted);
}

@media (max-width: 900px) {
  .header-search .hs-text,
  .header-search .hs-kbd {
    display: none;
  }

  .header-search {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    margin-left: 4px;
  }
}

/* ---------- 搜索弹层 ---------- */

.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  padding: 12vh 16px 16px;
  background: rgba(15, 23, 42, 0.45);
}

.cmd-overlay.show {
  display: block;
}

.cmd {
  max-width: 560px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.cmd-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.cmd-input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
}

.cmd-input input:focus {
  outline: none;
  box-shadow: none;
}

.cmd-list {
  max-height: 52vh;
  overflow: auto;
  padding: 6px;
}

.cmd-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
}

.cmd-item:hover,
.cmd-item.active {
  background: var(--brand-soft);
  text-decoration: none;
}

.cmd-item .t {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.cmd-item .d {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.79rem;
}

.cmd-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

[data-theme="dark"] .cmd,
[data-theme="dark"] .header-search {
  background: #151d27;
}

.footer-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: auto;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* ---------- 复制提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 12px);
  padding: 9px 18px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 40px 0 32px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .page-head h1 {
    font-size: 1.55rem;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .wrap {
    padding: 0 16px;
  }

  .row-2,
  .row-3 {
    grid-template-columns: 1fr;
  }

  .header-inner {
    height: auto;
    padding: 10px 0;
    flex-wrap: wrap;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .panel {
    padding: 16px;
  }

  .btn {
    flex: 1 1 auto;
  }
}
