/* =========================================================
   渔研工坊 FishLab Studio — 水域感主题
   浅蓝白底 + 湖蓝主色 + 水绿辅色，标题与正文同为无衬线
   配色取自水面本身：清晨的浅蓝白、正午的湖蓝、浅滩的水绿，
   整体清爽、干净、透气，长时间盯着数据也不累眼
   所有颜色走 CSS 变量，改一处即可换肤

   字体说明：全站不引入任何外部资源（这是「不收集数据」的一部分），
   所以不加载 Google Fonts。字体栈优先命中用户本机已装的
   Inter / Noto Sans SC，都没装时退回系统自带的中文字体
   （PingFang SC / 微软雅黑 UI）；数字与公式统一走等宽字体。
   ========================================================= */

:root {
  /* 背景与 surface：浅蓝白与更淡的水色 */
  --bg: #f3f9fc;
  --bg-alt: #e8f3f9;
  --surface: #ffffff;
  --surface-2: #f8fcfe;
  --surface-3: #e7f1f7;

  /* 边框：偏冷的浅蓝灰 */
  --border: #dceaf1;
  --border-strong: #c1d8e4;

  /* 文字：深蓝灰，不用纯黑 */
  --text: #22333d;
  --text-soft: #4d6673;
  --muted: #7d95a2;

  /* 强调色：湖蓝为主，水绿为辅 */
  --primary: #1f7fa8;
  --primary-dark: #17678b;
  --primary-soft: rgba(31, 127, 168, .12);
  --accent: #17a08a;
  --accent-dark: #11826f;
  --accent-soft: rgba(23, 160, 138, .14);

  /* 状态色 */
  --ok: #2f8f6f;
  --ok-soft: #e8f6f0;
  --warn: #b07a1a;
  --warn-soft: #fdf4e3;
  --err: #c2554f;
  --err-soft: #fceeed;

  /* 圆角与阴影：中圆角 + 轻阴影，是「清爽感」的主要来源 */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(24, 74, 100, .05);
  --shadow: 0 4px 16px rgba(24, 74, 100, .07);
  --shadow-lg: 0 14px 34px rgba(24, 74, 100, .12);

  /* 字体：标题与正文同一套无衬线栈，数字走等宽 */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC',
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', system-ui, sans-serif;
  --font-round: var(--font-sans);
  --font-body: var(--font-sans);
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;

  /* 版心 */
  --container: 1160px;
  --gap: 20px;

  /* 页头高度：面包屑与锚点定位都要用到 */
  --header-h: 66px;
}

/* =========================================================
   1. 基础重置
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 页脚五列在窄屏堆叠后可能比视口高，避免出现横向滚动条 */
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-round);
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 .5em;
  color: var(--text);
  letter-spacing: .01em;
}

p { margin: 0 0 1em; }

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }

img, svg { max-width: 100%; }

code, pre, kbd { font-family: var(--font-mono); }

hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

/* 键盘聚焦：圆角描边，不用浏览器默认的方框 */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 跳到主要内容：只在键盘聚焦时出现 */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top .18s ease;
}
.skip-link:focus { top: 0; color: #fff; text-decoration: none; }

/* =========================================================
   2. 版心与区块
   ========================================================= */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 22px;
}

.section { padding: 64px 0; }
.section-tight { padding: 30px 0 12px; }

/* 交替底色：浅粉米白，用来分隔相邻区块 */
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin: 0 auto 34px;
  text-align: center;
}
.section-head h2 { font-size: clamp(22px, 2.6vw, 30px); margin-bottom: .45em; }
.section-head p { color: var(--text-soft); margin: 0; }

/* 小标签：湖蓝胶囊，用在区块标题上方 */
.eyebrow {
  display: inline-block;
  font-family: var(--font-round);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  margin-bottom: 14px;
}

/* 居中的一行按钮（首页区块底部的「查看全部」） */
.center-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* 窄栏：FAQ 列表这类一行读起来更舒服的内容 */
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }

/* =========================================================
   3. 页头
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(243, 249, 252, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-round);
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { color: var(--primary-dark); text-decoration: none; }

/* 站标：湖蓝圆角方块 + 鱼形图标 */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  flex: 0 0 auto;
}
.brand-mark svg { width: 22px; height: 22px; }

.brand-sub {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--muted);
  margin-top: -3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav > a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 8px 13px;
  border-radius: var(--r-pill);
  transition: background .16s ease, color .16s ease;
}
.nav > a:hover { background: var(--surface-3); color: var(--primary-dark); text-decoration: none; }
.nav > a.active { background: var(--primary-soft); color: var(--primary-dark); }
/* 导航里的「开始准备」按钮：实心湖蓝底，白色文字由 .btn 给出，
   layout.js 里带了内联的 color:#fff 作为兜底 */
.nav > a.btn { margin-left: 10px; }

/* 汉堡按钮：默认隐藏，窄屏出现 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text-soft);
}

/* =========================================================
   4. 面包屑
   ========================================================= */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 16px 0 0;
}
.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--primary-dark); }
.breadcrumb span[aria-current] { color: var(--muted); }
.breadcrumb > span:not([aria-current]) { color: var(--border-strong); }

/* =========================================================
   5. 按钮
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-round);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .16s ease, transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
  /* 「悬停有亮度变化」：提亮 + 轻微上浮 */
  filter: brightness(1.06);
  box-shadow: 0 8px 20px rgba(31, 127, 168, .26);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

.btn-lg { font-size: 16.5px; padding: 15px 28px; }
.btn-sm { font-size: 13.5px; padding: 8px 15px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-block { display: flex; width: 100%; }

/* 描边按钮：雾霾蓝描边，悬停填充浅蓝 */
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--accent-dark);
}
.btn-ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: none;
}

/* 雾霾蓝实心按钮（备用强调） */
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); box-shadow: 0 8px 20px rgba(23, 160, 138, .26); }

/* =========================================================
   6. Hero
   ========================================================= */

.hero {
  position: relative;
  padding: 66px 0 58px;
  text-align: center;
  background:
    radial-gradient(900px 380px at 50% -8%, var(--primary-soft), transparent 70%),
    radial-gradient(620px 300px at 88% 8%, var(--accent-soft), transparent 72%);
}
.hero .container { max-width: 860px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 7px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.hero-badge svg { width: 16px; height: 16px; }

/* 大号无衬线标题 */
.hero h1 {
  font-size: clamp(29px, 4.6vw, 46px);
  line-height: 1.24;
  letter-spacing: .005em;
  margin-bottom: 18px;
}
/* 标题里的强调片段：湖蓝 + 手绘感下划线 */
.hero h1 em {
  font-style: normal;
  color: var(--primary);
  background: linear-gradient(transparent 62%, var(--primary-soft) 62%);
  padding: 0 2px;
}

.hero-sub {
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--text-soft);
  max-width: 660px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* 标题下的一排小勾选项 */
.hero-note {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 26px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note svg { width: 15px; height: 15px; color: var(--ok); }

/* =========================================================
   7. 卡片与网格
   ========================================================= */

/* 栅格：1fr 等价于 minmax(auto, 1fr)，子项的 min-width:auto 会被
   「nowrap 的长示例文字」撑到 min-content，列就再也收不回去，整页横向溢出。
   写 minmax(0, 1fr) 才能真正收缩，里面的换行与省略号才会生效。 */
.grid {
  display: grid;
  gap: var(--gap);
}
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
/* 悬停上浮 */
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
  text-decoration: none;
}
.card h3 { font-size: 17.5px; margin: 14px 0 8px; }
.card p { color: var(--text-soft); font-size: 14.5px; margin: 0; }

.card-link {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-round);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--primary);
}

/* 工具卡片 */
.tool-card { display: flex; flex-direction: column; }
.tool-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* 序号：右下角淡淡的大数字 */
.tool-index {
  font-family: var(--font-round);
  font-size: 26px;
  font-weight: 800;
  color: var(--surface-3);
  line-height: 1;
  letter-spacing: .02em;
}
.tool-card h3 { margin-top: 16px; }
.tool-card p { flex: 1 1 auto; }

/* 工具/人群图标：圆角方块，湖蓝与水绿交替 */
.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 15px;
  background: var(--primary-soft);
  color: var(--primary);
}
.tool-icon svg { width: 25px; height: 25px; }
.tool-icon.alt { background: var(--accent-soft); color: var(--accent); }

/* 卡片里的示例：等宽字，一行放不下就省略，鼠标悬停看完整 */
.tool-example {
  display: block;
  margin-top: 16px;
  padding: 10px 13px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 人群卡片 */
.audience-card { text-align: center; }
.audience-card .tool-icon { margin: 0 auto; }
.audience-card h3 { font-size: 16.5px; }
.audience-card p { margin: 0; }

/* 笔记卡片 */
.post-card { display: flex; flex-direction: column; }
.post-card h3 { font-size: 17px; margin: 10px 0 8px; }
.post-excerpt { flex: 1 1 auto; }
.post-meta {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .02em;
}
.post-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

/* =========================================================
   8. 页面标题（工具页 / 内容页共用）
   ========================================================= */

.page-head {
  max-width: 820px;
  padding: 30px 0 26px;
}
.page-head h1 {
  font-size: clamp(24px, 3.1vw, 34px);
  margin-bottom: 12px;
}
.page-lead {
  font-size: 16px;
  color: var(--text-soft);
  margin: 0;
}
.page-head .post-meta { margin-top: 12px; }

/* =========================================================
   9. 工具页：左侧白色输入面板 + 右侧浅色结果面板
   ========================================================= */

.tool-layout {
  display: grid;
  /* 左窄右宽：输入面板要放得下「中粗线 · 180 m/100 g · 4.5–5.5 mm」这种长选项 */
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
  padding-bottom: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  min-width: 0;
}
/* 结果面板用浅粉底，和输入面板的纯白拉开层次 */
.panel-out {
  background: var(--surface-2);
  padding: 22px 24px 26px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-round);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.panel-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex: 0 0 auto;
}
.panel-out .panel-title .dot { background: var(--accent); }
/* 面板标题右侧的补充说明，靠右排 */
.io-meta {
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: right;
  min-width: 0;
}

/* ---------------- 表单 ---------------- */

#tool-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 15px;
}

/* 分组小标题：占满一行，起视觉分隔 */
.field-group {
  font-family: var(--font-round);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--muted);
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}
.field-group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

.field { min-width: 0; }
.field > label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 7px;
}

.input, .select {
  width: 100%;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  padding: 11px 13px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input:hover, .select:hover { border-color: var(--primary); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  /* 内联 SVG 箭头，避免外部图片请求 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5l5-5' fill='none' stroke='%239c8a90' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

/* 数字输入 + 单位后缀 */
.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.input-row .input { flex: 1 1 auto; }
.io-meta.unit {
  margin-left: 0;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  min-width: 26px;
  text-align: left;
}

/* 分段选择器：等宽胶囊按钮组 */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--surface-3);
  border-radius: var(--r);
}
.segmented button {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-round);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.segmented button:hover { color: var(--primary-dark); }
.segmented button.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.hint {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
}

/* 常用花样预设按钮 */
.preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}
.preset-label {
  font-size: 12.5px;
  color: var(--muted);
}
.preset-btn {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 5px 12px;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.preset-btn:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

/* ---------------- 结果区 ---------------- */

/* 结论条：ok / warn / err 三态 */
.status {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 14.5px;
  border-radius: var(--r);
  padding: 13px 16px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.status b {
  font-family: var(--font-round);
  font-size: 17px;
  font-weight: 800;
}
.status span { color: var(--text-soft); font-size: 13.5px; }
.status.ok { background: var(--ok-soft); border-color: rgba(47, 143, 111, .24); color: var(--ok); }
.status.warn { background: var(--warn-soft); border-color: rgba(176, 122, 26, .24); color: var(--warn); }
.status.err { background: var(--err-soft); border-color: rgba(194, 85, 79, .24); color: var(--err); }
/* info：中性提示（例如「起始与目标相同，无需调整」） */
.status.info { background: var(--surface-3); border-color: var(--border-strong); color: var(--text-soft); }
.status.ok span, .status.warn span, .status.err span { color: var(--text-soft); }
.status.info b { color: var(--text); }

/* 大号汇总数字：工具页最醒目的部分 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 15px 16px 16px;
  min-width: 0;
}
.stat-box.highlight {
  border-color: var(--primary);
  background: linear-gradient(160deg, var(--primary-soft), var(--surface) 72%);
}
.stat-label {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat-num {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--font-round);
  font-size: clamp(24px, 2.7vw, 31px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary-dark);
  /* 长数字（例如 1234.5）在窄卡片里也要收得住 */
  overflow-wrap: anywhere;
}
.stat-unit {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.stat-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

.sub-title {
  font-family: var(--font-round);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  margin: 24px 0 10px;
  padding-left: 11px;
  border-left: 3px solid var(--primary);
}

/* 表格：浅色表头 + 斑马纹 + 数字右对齐 */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table th, table td {
  padding: 10px 13px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table thead th {
  background: var(--surface-3);
  font-family: var(--font-round);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-soft);
  white-space: nowrap;
}
table tbody tr:nth-child(even) { background: var(--surface-2); }
table tbody tr:last-child td { border-bottom: 0; }
/* 数字右对齐：等宽字让小数点在一条竖线上 */
table th.num, table td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

/* 提示框 */
.note-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--r);
  padding: 13px 16px;
  font-size: 14px;
  color: var(--text-soft);
  margin: 0 0 14px;
}
.note-box strong { color: var(--text); }
.note-box.warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}
.note-box.warn strong { color: var(--warn); }
.note-box p:last-child { margin-bottom: 0; }

/* 示意图：SVG 里写死了深色墨，所以底板必须是浅色 */
.tile-figure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 14px 4px;
  margin: 0 0 18px;
  overflow: hidden;
}
.tile-figure svg { display: block; width: 100%; height: auto; }
.figure-cap {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: 6px 2px 12px;
}

/* 占比条：鱼种构成 / 钓点构成这类比例 */
.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 9px;
}
.share-track {
  flex: 1 1 auto;
  min-width: 0;
  height: 11px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.share-fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--primary);
}
.share-label {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-soft);
  min-width: 92px;
  text-align: right;
}

/* =========================================================
   10. 内容页：正文 + 侧栏目录
   ========================================================= */

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 258px);
  gap: 40px;
  align-items: start;
  padding-bottom: 40px;
}

.article {
  min-width: 0;
  font-size: 16px;
  color: var(--text-soft);
}
.article h2 {
  font-size: 21px;
  color: var(--text);
  margin: 34px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-soft);
  /* 点目录跳过来时，标题不要贴在吸顶页头下面 */
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.article h2:first-child { margin-top: 0; }
.article h3 {
  font-size: 17.5px;
  color: var(--text);
  margin: 26px 0 10px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.article h4 { font-size: 16px; color: var(--text); margin: 20px 0 8px; }
.article p { margin: 0 0 1.05em; }
.article strong { color: var(--text); }
.article ul, .article ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.article li { margin-bottom: .4em; }
.article li > ul, .article li > ol { margin-top: .4em; margin-bottom: 0; }
.article blockquote {
  margin: 0 0 1.1em;
  padding: 12px 18px;
  background: var(--surface-2);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--r) var(--r) 0;
}
.article blockquote p:last-child { margin-bottom: 0; }
.article code {
  background: var(--surface-3);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 13.5px;
  color: var(--primary-dark);
  /* 行内代码必须能断行：正文里会出现 `Proc.sinkerWeight({flow:'slow',…})`
     这种 60 多个字符、又没有空格的调用示例。等宽字体下它约 450px 宽，
     在 390px 屏上会把整页撑出横向滚动条（overflow.js 就是在 contact.html
     抓到这一条的）。overflow-wrap:anywhere 让它在任意字符处断开，
     而不是像 pre 那样靠横向滚动——行内代码夹在段落中间，横向滚动条
     会把整段文字一起拖走，比断行难读得多。 */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.article pre {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 1.1em;
}
/* 代码块里的代码不要断行：它有自己的 overflow-x: auto，横向滚动才是对的 */
.article pre code {
  background: none; padding: 0; color: var(--text); font-size: 13px;
  overflow-wrap: normal; word-break: normal;
}
.article img { border-radius: var(--r); }
.article > .table-wrap { margin-bottom: 1.2em; }

/* 正文表格：Markdown 生成的是裸 <table>，和工具页的 .data 共用一套皮 */
.article table { min-width: 460px; }

/* 侧栏目录 */
.toc { position: sticky; top: calc(var(--header-h) + 20px); }
.toc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  font-size: 13.5px;
}
.toc-box h4 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 10px;
}
.toc-box ol { margin: 0; padding-left: 1.25em; }
.toc-box li { margin-bottom: 6px; color: var(--text-soft); }
.toc-box a { color: var(--text-soft); }
.toc-box a:hover { color: var(--primary-dark); }
.toc-cta { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }

/* 延伸阅读 */
.related {
  margin-top: 36px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 14.5px;
}
.related h3 { font-size: 15.5px; margin-bottom: 10px; }
.related ul { margin: 0; padding-left: 1.2em; }
.related li { margin-bottom: .4em; }

/* 常见问题列表 */
.faq-group { margin-bottom: 34px; }
.faq-group h2 { font-size: 20px; margin-bottom: 14px; }
.faq-item {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 12px;
  min-width: 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.faq-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
  text-decoration: none;
}
.faq-item h3 {
  font-size: 16.5px;
  color: var(--text);
  margin: 0 0 8px;
}
.faq-item p { color: var(--text-soft); font-size: 14.5px; margin: 0; }

/* 指南总览页的筛选条 */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
}
.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.filter-row:last-of-type { margin-bottom: 0; }
.filter-label {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  min-width: 40px;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-family: var(--font-round);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-soft);
  background: var(--surface-3);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 6px 15px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.chip.active {
  background: var(--primary);
  color: #fff;
}
.filter-count {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.filter-empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 0;
  margin: 0;
}

/* 指南卡片：难度 / 类型标签 + 配套工具 */
.guide-card { display: flex; flex-direction: column; }
.guide-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: var(--r-pill);
  padding: 3px 11px;
}
.tag.alt { color: var(--accent-dark); background: var(--accent-soft); }
.guide-card h3 { margin-top: 12px; }
.guide-card p { flex: 1 1 auto; }
.guide-tool {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

/* =========================================================
   11. 页脚（五列 + 三行版权栏）
   ========================================================= */

.site-footer {
  margin-top: 60px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 48px 0 26px;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  /* 品牌列稍宽，其余四列等宽 */
  grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr));
  gap: 30px 26px;
}

.footer-col { min-width: 0; }
.footer-col h4 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--text);
  margin: 0 0 12px;
}
.footer-col ul { list-style: none; margin: 0 0 12px; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  color: var(--text-soft);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.footer-col a:hover { color: var(--primary-dark); }

.footer-brand {
  display: inline-block;
  font-family: var(--font-round);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}
.footer-brand:hover { color: var(--primary-dark); text-decoration: none; }

.footer-about {
  color: var(--text-soft);
  font-size: 13.5px;
  margin: 0 0 14px;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.footer-badges span {
  font-size: 12px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  padding: 4px 11px;
  white-space: nowrap;
}

/* 版权栏：三行，居中，逐字为需求书指定文案 */
.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
}
.footer-bottom p {
  margin: 0 0 5px;
  font-size: 12.5px;
  line-height: 1.7;
}
.footer-bottom p:last-child { margin-bottom: 0; }

/* =========================================================
   12. 响应式
   ========================================================= */

/* 工具页两栏：输入面板窄于 400px 时收成单栏，否则长选项会被截断 */
@media (max-width: 1080px) {
  .tool-layout { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
  .content-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 30px; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-col:first-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-layout { grid-template-columns: minmax(0, 1fr); }
  .content-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .toc { position: static; order: -1; }
  .toc-box ol { columns: 2; column-gap: 24px; }
  .hero { padding: 48px 0 44px; }
  .section { padding: 48px 0; }
}

/* 页头在 820px 以下切到汉堡菜单：导航 5 项 + 按钮放不下了 */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 22px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav > a { padding: 12px 14px; border-radius: var(--r); }
  .nav > a.btn { margin-left: 0; margin-top: 8px; }
  /* 页头保持 sticky：sticky 元素本身就是「已定位」的，
     绝对定位的下拉导航会以它为包含块，不需要再改成 relative。 */
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .container { padding: 0 18px; }
  .grid-3, .post-list { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head { margin-bottom: 26px; }

  /* 宽表格在窄屏横向滚动，而不是把列压到看不清。
     min-width 一给，里面的文字就保持自然宽度，.table-wrap 负责滚动。 */
  table.data { min-width: 560px; }
  .article table { min-width: 520px; }
  .tile-figure { padding: 10px 10px 2px; }
  .toc-box ol { columns: 1; }
}

@media (max-width: 560px) {
  .hero-actions .btn { width: 100%; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .form-actions .btn { width: 100%; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .share-label { min-width: 74px; }
}

/* 窄屏下工具页的图不要留太多内边距，SVG 会自己缩放 */
@media (max-width: 420px) {
  .panel, .panel-out { padding: 18px 15px; }
  .card { padding: 20px; }
}

/* 尊重系统的「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  .card-hover:hover, .faq-item:hover { transform: none; }
}

/* =========================================================
   13. 打印：去掉交互装饰，只留内容
   ========================================================= */

@media print {
  .site-header, .nav-toggle, .toc, .related, .skip-link,
  .form-actions, .hero-actions, .footer-badges, .breadcrumb { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .card, .panel, .faq-item, .note-box, .tile-figure { box-shadow: none; border-color: #ddd; }
  .tool-layout, .content-layout, .grid, .footer-grid { display: block; }
  .article h2 { page-break-after: avoid; }
  table { page-break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}

/* =========================================================
   14. 渔获记录：表格里的行内操作按钮
   删除是低频、且不可撤销的操作，所以用文字按钮而不是实心按钮——
   视觉重量轻，但保留可点击的矩形区域（内边距）以免误触旁边的单元格。
   ========================================================= */

.link-btn {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  color: var(--err);
  background: none;
  border: 0;
  padding: 3px 7px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.link-btn:hover { background: var(--err-soft); text-decoration: underline; }
