* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:#F7F5FB; --bg-soft:#EFEBF5; --card:#FFFFFF;
  --border:#E2DCF0; --border-soft:#EFEAF8;
  --ink:#1F1B2E; --ink-2:#4A4260; --ink-3:#8A82A0;
  --accent:#6B5B95; --accent-deep:#4C3F73;
  --accent-soft:#D8CEF0; --accent-pale:#F0EBFA;
  --max:920px;
}

html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", sans-serif;
  font-size: 15.5px; line-height: 1.85; color: var(--ink-2);
  background: var(--bg); -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 245, 251, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; position: relative;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.brand-name {
  font-family: "Noto Serif SC", serif; font-size: 16.5px; font-weight: 600;
  color: var(--ink); letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  font-size: 14px; color: var(--ink-2);
  padding: 7px 13px; border-radius: 6px;
  transition: color .18s, background .18s;
}
.site-nav a:hover, .site-nav a.active { color: var(--accent-deep); background: var(--accent-pale); }
.menu-btn {
  display: none; background: none; border: none;
  padding: 8px; cursor: pointer; color: var(--ink); border-radius: 8px;
}
.menu-btn:hover { background: var(--accent-pale); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

.crumb { padding: 22px 0 6px; font-size: 13px; color: var(--ink-3); }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--accent-deep); }
.crumb .sep { margin: 0 8px; color: var(--border); }
.crumb .now { color: var(--ink-2); }

.hero { padding: 72px 0 40px; }
.hero-hi { font-size: 14px; color: var(--accent); letter-spacing: 0.1em; margin-bottom: 20px; }
.hero h1 {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(26px, 4.2vw, 40px); font-weight: 700; color: var(--ink);
  line-height: 1.45; letter-spacing: 0.02em; margin-bottom: 24px;
}
.hero-desc { font-size: 15.5px; line-height: 2; color: var(--ink-2); max-width: 620px; }

.page-head { padding: 52px 0 12px; }
.page-head h1 {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(24px, 3.6vw, 34px); font-weight: 700;
  color: var(--ink); line-height: 1.5; margin-bottom: 14px;
}
.page-head .lead { font-size: 15px; color: var(--ink-3); line-height: 1.9; max-width: 620px; }

.section { padding: 44px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; padding-bottom: 14px;
  border-bottom: 1px solid var(--border); margin-bottom: 22px;
}
.section-head h2 {
  font-family: "Noto Serif SC", serif; font-size: 18px;
  font-weight: 600; color: var(--ink); letter-spacing: 0.06em;
}
.section-head a.more { font-size: 13px; color: var(--accent-deep); }
.section-head a.more:hover { text-decoration: underline; }

.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px;
}
.tool-card {
  display: block; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 22px 24px; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.tool-card:hover {
  border-color: var(--accent-soft); transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(107, 91, 149, 0.1);
}
.tool-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.tool-head h3 { font-family: "Noto Serif SC", serif; font-size: 16.5px; font-weight: 600; color: var(--ink); }
.tool-head .idx { font-size: 12px; color: var(--accent); letter-spacing: 0.08em; }
.tool-desc { font-size: 13.5px; color: var(--ink-3); line-height: 1.8; }
.tool-go { margin-top: 12px; font-size: 13px; color: var(--accent-deep); display: inline-block; font-weight: 500; }
.tool-card:hover .tool-go { text-decoration: underline; }

.tool-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 26px 28px; margin-bottom: 26px;
}
.tool-body { font-size: 14px; }
.tool-body textarea, .tool-body input[type="text"] {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  background: #FBFAFE; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  transition: border-color .18s; outline: none;
  appearance: none; -webkit-appearance: none;
}
.tool-body textarea { resize: vertical; min-height: 110px; line-height: 1.7; }
.tool-body textarea:focus, .tool-body input:focus { border-color: var(--accent); background: #fff; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 10px 22px; font-family: inherit; font-size: 14px;
  font-weight: 500; color: #fff; background: var(--accent); border: none;
  border-radius: 8px; cursor: pointer; transition: background .18s;
}
.btn:hover { background: var(--accent-deep); }
.btn-ghost { background: var(--accent-pale); color: var(--accent-deep); }
.btn-ghost:hover { background: var(--accent-soft); }

.tool-result {
  margin-top: 14px; padding: 12px 14px;
  background: var(--accent-pale); border-radius: 8px;
  font-size: 14.5px; color: var(--ink); line-height: 1.75;
  white-space: pre-wrap; word-break: break-all; min-height: 42px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.tool-result.empty { color: var(--ink-3); background: var(--bg-soft); font-family: inherit; }

.tool-note { font-size: 14px; color: var(--ink-2); line-height: 1.95; margin-bottom: 14px; }
.tool-note:last-child { margin-bottom: 0; }
.tool-note h2 {
  font-family: "Noto Serif SC", serif; font-size: 16px;
  color: var(--ink); margin-bottom: 10px; letter-spacing: 0.04em;
}

.rel-list { display: flex; flex-direction: column; }
.rel-item { padding: 14px 0; border-bottom: 1px solid var(--border-soft); display: block; }
.rel-item:last-child { border-bottom: none; }
.rel-item .t {
  font-family: "Noto Serif SC", serif; font-size: 15px;
  color: var(--ink); margin-bottom: 4px; font-weight: 600;
}
.rel-item .d { font-size: 13.5px; color: var(--ink-3); line-height: 1.75; }
.rel-item:hover .t { color: var(--accent-deep); }

.article-wrap { padding: 12px 0 40px; }
.article-body { font-size: 15.5px; line-height: 2.05; color: var(--ink-2); max-width: 660px; }
.article-body p { margin-bottom: 18px; }
.article-body p:last-child { margin-bottom: 0; }
.article-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13.5px; background: var(--accent-pale); color: var(--accent-deep);
  padding: 1px 6px; border-radius: 4px;
}

.plain { padding: 12px 0 40px; max-width: 660px; }
.plain p { font-size: 15px; line-height: 2.05; color: var(--ink-2); margin-bottom: 16px; }
.plain p:last-child { margin-bottom: 0; }
.plain h2 {
  font-family: "Noto Serif SC", serif; font-size: 17px;
  color: var(--ink); margin: 26px 0 14px; letter-spacing: 0.04em;
}
.plain h2:first-child { margin-top: 0; }

.site-footer {
  margin-top: 40px;
  padding: 40px 0 calc(40px + env(safe-area-inset-bottom));
  text-align: center; font-size: 13px; color: var(--ink-3);
  line-height: 2.1; border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
}
.foot-line {
  font-family: "Noto Serif SC", serif; font-size: 14px;
  color: var(--ink-2); letter-spacing: 0.06em; margin-bottom: 6px;
}
.foot-beian {
  display: inline-block; color: var(--ink-3);
  border-bottom: 1px dashed var(--border); padding-bottom: 1px;
  transition: color .18s, border-color .18s;
}
.foot-beian:hover { color: var(--accent-deep); border-color: var(--accent); }
.foot-links { font-size: 12.5px; margin-top: 4px; }
.foot-links a { color: var(--ink-3); transition: color .18s; }
.foot-links a:hover { color: var(--accent-deep); }
.foot-links .sep { margin: 0 8px; color: var(--border); }
.foot-copy { font-size: 12.5px; margin-top: 4px; }

@media (max-width: 720px) {
  .header-inner { padding: 0 18px; }
  .menu-btn { display: block; }
  .site-nav {
    display: none; position: absolute; top: 64px;
    left: 0; right: 0; background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column; gap: 2px; padding: 8px 12px 14px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 14px; font-size: 15px; }
  .wrap, .header-inner { padding: 0 18px; }
  .hero { padding: 44px 0 24px; }
  .page-head { padding: 32px 0 8px; }
  .section { padding: 30px 0; }
  .tools-grid { grid-template-columns: 1fr; gap: 14px; }
  .tool-panel { padding: 20px 20px; }
}
