/* 18步法工具样式 —— 由工具站 styles.css 转换而来，全部选择器限定在 .tool-scope 内，
   以避免与站点博客样式冲突。勿手工调整前缀。 */

.tool-scope {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1f2733;
  --ink-soft: #5b6675;
  --ink-faint: #8a94a6;
  --line: #e7ebf2;
  --primary: #1f6feb;
  --primary-soft: #eaf2ff;
  --pass: #15a05a;
  --pass-soft: #e6f7ee;
  --fail: #e2483d;
  --fail-soft: #fdecea;
  --warn: #e8920c;
  --warn-soft: #fdf3e3;
  --shadow: 0 4px 18px rgba(31, 39, 51, .06);
  --radius: 14px;
}

.tool-scope *, .tool-scope *::before, .tool-scope *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

.tool-scope {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

.tool-scope .app-header {
  background: linear-gradient(135deg, #1f6feb 0%, #2b4fd6 100%);
  color: #fff;
  padding: 18px 16px 16px;
}

.tool-scope .app-header .brand { display: flex; align-items: center; gap: 12px; max-width: 960px; margin: 0 auto; }

.tool-scope .app-header .logo {
  width: 46px; height: 46px; border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; letter-spacing: -1px;
}

.tool-scope .app-header h1 { font-size: 18px; margin: 0; font-weight: 700; }

.tool-scope .app-header p { margin: 2px 0 0; font-size: 12.5px; opacity: .85; }

.tool-scope .container { max-width: 960px; margin: 0 auto; padding: 16px; }

/* 搜索卡定宽 804px 居中（2026-09-19 Hugo 指定，以标注红框长度为准）。
   注意：此处必须给显式宽度。此前卡片靠块级默认宽度撑满，但 main 被 body 的纵向 flex
   收缩包裹后（详见 style.css 中 main 的说明），卡片跟着塌成了内容宽度（475px）。
   max-width:100% 保证窄屏不溢出：窄屏下 100% 小于 804px 时自动退化为通栏。 */
.tool-scope .search-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 16px;
  width: 804px; max-width: 100%;
  margin-left: auto; margin-right: auto;
}

/* 首页已移除品牌 Hero 横幅，搜索卡片上方补足间距。
   构成：main.padding-top(28) + .tool-scope.margin-top(22) = 50px 总间距，与原视觉相当 */
main.no-hero { padding-top: 28px; }

/* align-items:center 让定高按钮与输入框垂直居中（否则按钮偏上） */
.tool-scope .search-row { display: flex; gap: 10px; align-items: center; }

/* min-width:0 不可删：flex 子项默认 min-width:auto，输入框会被自身的
   「内容最小宽度」（input 默认 size=20 的宽度）卡住不再收缩，
   窄屏下整行会顶出卡片形成横向滚动。置 0 后可按可用空间正常收窄。
   实测：卡片内容宽 280px 时，无此行 → 行溢出；有此行 → 无溢出。 */
.tool-scope .search-row input {
  flex: 1; min-width: 0;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 15px; outline: none; background: #fbfcfe;
}

.tool-scope .search-row input:focus { border-color: var(--primary); background: #fff; }

.tool-scope .search-row button {
  border: none; background: var(--primary); color: #fff; font-weight: 600;
  /* 定尺：宽 106 / 高 40（2026-09-15 Hugo 指定） */
  width: 106px; height: 40px; flex: 0 0 106px;
  padding: 0; border-radius: 8px; font-size: 14px;
  letter-spacing: 0.02em; line-height: 1; cursor: pointer;
}

.tool-scope .search-row button:active { transform: scale(.97); }

.tool-scope .search-results { margin-top: 10px; display: none; flex-direction: column; gap: 6px; }

.tool-scope .search-results.show { display: flex; }

.tool-scope .result-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; background: #fff;
}

.tool-scope .result-item:hover { border-color: var(--primary); background: var(--primary-soft); }

.tool-scope .result-item .nm { font-weight: 600; }

.tool-scope .result-item .cd { color: var(--ink-faint); font-size: 13px; }

.tool-scope .quick { margin-top: 12px; font-size: 13px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.tool-scope .chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  padding: 5px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
}

.tool-scope .chip:active { background: var(--primary-soft); border-color: var(--primary); }

.tool-scope .loading { text-align: center; padding: 40px 16px; color: var(--ink-soft); }

.tool-scope .spinner {
  width: 42px; height: 42px; border: 4px solid var(--primary-soft);
  border-top-color: var(--primary); border-radius: 50%;
  margin: 0 auto 14px; animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.tool-scope .stepper { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 18px; }

.tool-scope .stepper .dot { width: 22px; height: 22px; border-radius: 6px; background: var(--line); color: var(--ink-faint); font-size: 11px; display: flex; align-items: center; justify-content: center; }

.tool-scope .stepper .dot.done { background: var(--pass); color: #fff; }

.tool-scope .conclusion { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }

.tool-scope .concl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

.tool-scope .concl-title { font-size: 20px; font-weight: 800; }

.tool-scope .concl-sub { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.tool-scope .badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 600; }

.tool-scope .badge.live { background: var(--pass-soft); color: var(--pass); }

.tool-scope .badge.demo { background: var(--warn-soft); color: var(--warn); }

.tool-scope .grade-badge {
  text-align: center; background: var(--primary-soft); color: var(--primary);
  border-radius: 12px; padding: 10px 16px; min-width: 92px;
}

.tool-scope .grade-badge .g { font-size: 26px; font-weight: 800; line-height: 1; }

.tool-scope .grade-badge .l { font-size: 12px; margin-top: 4px; }

.tool-scope .metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }

.tool-scope .metric { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

.tool-scope .metric .k { font-size: 12px; color: var(--ink-faint); }

.tool-scope .metric .v { font-size: 17px; font-weight: 700; margin-top: 2px; }

.tool-scope .metric .v small { font-size: 12px; color: var(--ink-soft); font-weight: 500; }

.tool-scope .summary-charts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }

.tool-scope .mini-chart { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }

.tool-scope .mini-chart h4 { margin: 0 0 8px; font-size: 14px; }

.tool-scope .mini-chart .latest { float: right; font-size: 13px; color: var(--ink-soft); font-weight: 600; }

.tool-scope .section-title { font-size: 17px; font-weight: 700; margin: 4px 2px 12px; }

.tool-scope .steps { display: flex; flex-direction: column; gap: 12px; }

.tool-scope .step-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

.tool-scope .step-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; }

.tool-scope .step-num {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--primary); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}

.tool-scope .step-titles { flex: 1; min-width: 0; }

.tool-scope .step-titles .t { font-weight: 700; font-size: 15px; }

.tool-scope .step-titles .d { font-size: 12px; color: var(--ink-faint); margin-top: 1px; }

.tool-scope .step-verdict { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }

.tool-scope .verdict-pass { background: var(--pass-soft); color: var(--pass); }

.tool-scope .verdict-partial { background: var(--warn-soft); color: var(--warn); }

.tool-scope .verdict-fail { background: var(--fail-soft); color: var(--fail); }

.tool-scope .step-arrow { color: var(--ink-faint); transition: transform .2s; flex: none; }

.tool-scope .step-card.open .step-arrow { transform: rotate(90deg); }

.tool-scope .step-body { display: none; padding: 0 16px 16px; border-top: 1px solid var(--line); }

.tool-scope .step-card.open .step-body { display: block; }

.tool-scope .step-purpose { font-size: 13px; color: var(--ink-soft); margin: 12px 0 6px; }

.tool-scope .step-threshold { font-size: 12.5px; color: var(--primary); background: var(--primary-soft); padding: 8px 10px; border-radius: 8px; margin-bottom: 10px; }

.tool-scope .step-chart { margin: 6px 0 10px; }

.tool-scope .tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }

.tool-scope .tbl th, .tool-scope .tbl td { border: 1px solid var(--line); padding: 6px 8px; text-align: right; white-space: nowrap; }

.tool-scope .tbl th { background: #f8fafc; color: var(--ink-soft); font-weight: 600; }

.tool-scope .tbl td.yr { text-align: center; color: var(--ink-soft); font-weight: 600; }

.tool-scope .tbl td.eval-pass { color: var(--pass); font-weight: 700; background: var(--pass-soft); }

.tool-scope .tbl td.eval-fail { color: var(--fail); font-weight: 700; background: var(--fail-soft); }

.tool-scope .tbl td.eval-na { color: var(--ink-faint); }

.tool-scope .step-analysis { font-size: 13.5px; color: var(--ink); margin-top: 10px; background: #f8fafc; border-left: 3px solid var(--primary); padding: 10px 12px; border-radius: 0 8px 8px 0; }

.tool-scope .disclaimer { margin: 18px 2px 8px; font-size: 12px; color: var(--ink-faint); line-height: 1.7; border-top: 1px dashed var(--line); padding-top: 12px; }

.tool-scope .error-box { background: var(--fail-soft); color: var(--fail); border-radius: var(--radius); padding: 16px; font-size: 14px; }

.tool-scope .hidden { display: none !important; }

@media (min-width: 760px) {
  .tool-scope .metrics { grid-template-columns: repeat(6, 1fr); }
  .tool-scope .summary-charts { grid-template-columns: repeat(4, 1fr); }
  .tool-scope .app-header h1 { font-size: 20px; }
}

/* ============================================================
   手机版适配（2026-09-19 Hugo 指定：字体样式 / 版面 / 适当调整，总体整洁美观）
   全部限定在 760px 断点内，桌面端零影响。
   集中放在文件末尾，确保对上方同特异性声明形成覆盖。
   ============================================================ */
@media (max-width: 760px) {

  /* ---------- 搜索卡 ---------- */
  /* 手机上一屏只有这一张卡，内边距略放大，透气比紧凑更耐看 */
  .tool-scope .search-card { padding: 18px 16px; border-radius: 16px; }

  /* 搜索行：按钮收窄，把宽度让给输入框。
     原状：按钮定宽 106 → 输入框只剩 202px，placeholder 被截断成「输入公司名或股票代码，如：贵」。
     现在：按钮 84 → 输入框 224px，配合缩短后的文案可完整显示。 */
  .tool-scope .search-row { gap: 8px; }
  .tool-scope .search-row button {
    width: 84px; flex: 0 0 84px;
    height: 44px;                 /* 与输入框等高，触控目标 ≥44px */
    font-size: 15px; border-radius: 10px;
  }
  /* ★ 16px 是 iOS Safari 的分水岭：输入框字号 <16px 时，聚焦会触发整页自动放大。
     桌面端维持 15px 不动，手机端单独提到 16px。 */
  .tool-scope .search-row input {
    font-size: 16px; padding: 12px 14px; border-radius: 10px;
  }
  .tool-scope .search-row input:focus { box-shadow: 0 0 0 3px var(--primary-soft); }

  /* ---------- 示例标签 ---------- */
  /* 原布局里「示例：」占首行行首，标签换行后从行首重新排，
     导致第二行比第一行左移一截（实测首行起点 x83、次行 x36），视觉不齐。
     改为标题独占一行，两行标签齐头左对齐。 */
  .tool-scope .quick { margin-top: 14px; gap: 8px; }
  .tool-scope .quick > span { flex: 0 0 100%; font-size: 12.5px; line-height: 1.2; }
  /* chip 高度做到 33px 左右，达到移动端触控最小可点区域 */
  .tool-scope .chip { padding: 7px 14px; font-size: 13px; border-radius: 999px; }
}
