/* =========================================================
   大浩标书工具箱 · 设计系统 v2
   暖灰/骨白底 · 炭黑正文 · 低饱和 Teal 强调 · 等宽数值
   卡片圆角 <= 8px · 阴影近不可见 · 细边框分层 · 无装饰渐变
   ========================================================= */

:root {
  /* 底色与表面 */
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #FBFBFA;
  --surface-3: #F1EFEA;

  /* 文字 */
  --text: #2F3437;
  --text-strong: #111111;
  --text-sub: #6E757B;
  --text-faint: #8A9096;

  /* 边框 */
  --border: #E3E0DA;
  --border-strong: #C9C5BD;

  /* 语义强调（低饱和 Teal）：选中态 / 关键数值 / 主要操作 */
  --accent: #2C6E6A;
  --accent-dark: #245754;
  --accent-bg: #EDF3F2;
  --accent-border: #CFDFDD;

  /* 语义警示（低饱和琥珀/陶土） */
  --warn: #A85B2B;
  --warn-bg: #F7EFE6;
  --warn-border: #E5D5C0;

  /* 错误（低饱和陶土红） */
  --danger: #9C3D2E;
  --danger-bg: #F7ECE8;
  --danger-border: #E5CBC2;

  /* 形状与深度 */
  --radius: 6px;
  --radius-s: 4px;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.04);

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    "PingFang SC", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- 页头 ---------- */
.site-header {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.logo { font-size: 17px; font-weight: 700; color: var(--text-strong); text-decoration: none; letter-spacing: .01em; }
.logo:hover { text-decoration: none; color: var(--text-strong); }
.logo::before {
  content: ""; display: inline-block; width: 9px; height: 9px;
  background: var(--accent); margin-right: 9px; transform: translateY(-1px);
}
.logo .sub { font-size: 12px; font-weight: 400; color: var(--text-sub); margin-left: 10px; }
.site-nav a { color: var(--text-sub); margin-left: 18px; font-size: 14px; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- 首屏工作台信息条（非营销位） ---------- */
.workbench-bar {
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center;
  margin: 20px 0 6px; padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-faint); font-family: var(--font-mono);
}

/* ---------- 分类标题 ---------- */
.category { margin: 34px 0 8px; display: flex; align-items: baseline; gap: 12px; }
.category h2 { font-size: 15px; font-weight: 600; color: var(--text-strong); letter-spacing: .04em; }
.category .line { flex: 1; height: 1px; background: var(--border); }

/* ---------- 工具卡片（纯文字，细边框，无图标装饰） ---------- */
.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px; margin: 14px 0 8px;
}
.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: block; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.tool-card h3 { font-size: 15px; font-weight: 600; color: var(--text-strong); margin-bottom: 5px; }
.tool-card p { font-size: 13px; color: var(--text-sub); line-height: 1.55; }

.coming {
  background: transparent; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 16px 18px; color: var(--text-faint); font-size: 13px;
}
.coming b { color: var(--text-sub); font-weight: 600; }

/* ---------- 工具页 ---------- */
.tool-page { padding: 26px 0 40px; }
.breadcrumb { font-size: 12px; color: var(--text-faint); margin-bottom: 14px; }
.breadcrumb a { color: var(--text-sub); }
.breadcrumb a:hover { color: var(--accent); }
.tool-head h1 { font-size: 22px; font-weight: 600; color: var(--text-strong); margin-bottom: 6px; letter-spacing: -.01em; }
.tool-head .desc { color: var(--text-sub); font-size: 14px; margin-bottom: 18px; max-width: 760px; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 14px;
}

/* ---------- 文件投递区 ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 34px 20px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-bg); }
.dropzone p { color: var(--text-sub); font-size: 14px; }
.dropzone input[type="file"] { display: none; }

/* ---------- 按钮（直角 4px，无胶囊） ---------- */
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-s); padding: 9px 18px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .15s; font-family: inherit; line-height: 1.5;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { background: #C2C9C7; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent); }
.btn.accent { background: var(--warn); }
.btn.accent:hover { background: #8F4E24; }
.btn.mini { padding: 4px 10px; font-size: 12px; border-radius: 3px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- 文件列表 ---------- */
.file-list { list-style: none; margin-top: 14px; }
.file-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-s);
  margin-bottom: 6px; font-size: 14px;
}
.file-list .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .size { color: var(--text-sub); font-size: 12px; font-family: var(--font-mono); }
.file-list .move { border: 1px solid var(--border); background: var(--surface); cursor: pointer; border-radius: 3px; padding: 3px 8px; font-size: 12px; }
.file-list .move:hover { border-color: var(--accent); color: var(--accent); }
.file-list .remove { color: var(--danger); border: 1px solid var(--danger-border); background: var(--surface); }
.file-list .remove:hover { background: var(--danger-bg); }

/* ---------- 状态行（等宽：常含数值/百分比） ---------- */
.status { margin-top: 14px; font-size: 13px; color: var(--text-sub); min-height: 20px; font-family: var(--font-mono); }
.status.error { color: var(--danger); }
.status.ok { color: var(--accent); }

.chip { font-size: 12px; font-family: var(--font-mono); margin-left: 6px; }

/* ---------- 输入 ---------- */
textarea.tool-text {
  width: 100%; min-height: 260px; border: 1px solid var(--border-strong); border-radius: var(--radius-s);
  padding: 12px 14px; font-size: 14px; font-family: var(--font-sans); resize: vertical;
  background: var(--surface); color: var(--text);
}
textarea.tool-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-border); }

.result-html {
  border: 1px solid var(--border); border-radius: var(--radius-s); padding: 18px;
  max-height: 420px; overflow: auto; background: var(--surface); font-size: 14px;
}
.result-html h1, .result-html h2, .result-html h3 { margin: 12px 0 8px; color: var(--text-strong); }
.result-html table { border-collapse: collapse; margin: 10px 0; }
.result-html td, .result-html th { border: 1px solid var(--border); padding: 6px 10px; }

.options { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0; }
.options label { font-size: 14px; color: var(--text-sub); display: flex; align-items: center; gap: 8px; }
.options input[type="number"], .options input[type="text"], .options select {
  border: 1px solid var(--border-strong); border-radius: var(--radius-s); padding: 7px 10px;
  font-size: 14px; font-family: var(--font-mono); background: var(--surface); color: var(--text);
}
input[type="range"] { accent-color: var(--accent); }

/* ---------- FAQ ---------- */
.faq { margin-top: 30px; }
.faq h2 { font-size: 15px; font-weight: 600; color: var(--text-strong); margin-bottom: 12px; letter-spacing: .04em; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 13px 18px; margin-bottom: 8px; }
.faq summary { font-weight: 600; cursor: pointer; font-size: 14px; color: var(--text-strong); }
.faq details p { margin-top: 10px; font-size: 14px; color: var(--text-sub); }

/* ---------- 本地处理提示（Teal 细左边线，不大面积铺色） ---------- */
.privacy-note {
  background: var(--surface-2); border: 1px solid var(--border); border-left: 2px solid var(--accent);
  color: var(--text-sub); border-radius: var(--radius-s); padding: 10px 14px; font-size: 13px; margin-bottom: 18px;
}

/* ---------- 相关工具 ---------- */
.related { margin-top: 26px; }
.related h2 { font-size: 15px; font-weight: 600; color: var(--text-strong); margin-bottom: 10px; letter-spacing: .04em; }
.related a {
  display: inline-block; margin: 0 12px 8px 0; font-size: 13px;
  color: var(--text-sub); border: 1px solid var(--border); border-radius: 3px; padding: 4px 12px;
}
.related a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 44px; padding: 20px 0 32px; color: var(--text-faint); font-size: 12px; text-align: center; }

/* ---------- 等宽数值：尺寸 / 坐标 / 得分 / 进度计数 ---------- */
.num, .sizes, .coord-hint, .progress-text, .score-table td.num, .mk-table td,
.std-table td input, .options input[type="number"], .calc-row input[type="number"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
