/* style.css — MiniCPM 部署向导 · 扁平化 / 护眼暖白×琥珀 / 响应式 */
:root {
  /* 护眼配色：暖白底 + 柔和琥珀（不刺眼） */
  --bg: #fbfaf5;
  --bg-2: #f6f3ea;
  --panel: #ffffff;
  --panel-2: #fffdf6;
  --line: #ece5d6;
  --line-soft: #f2ede2;
  --text: #2e2a24;
  --text-dim: #6a6355;
  --text-mute: #9a917f;

  /* 琥珀（主色，柔和） */
  --accent: #d99a17;
  --accent-2: #b9782a;
  --accent-soft: #f4e4b8;
  --accent-bg: #fdf6e3;

  /* 状态色（护眼低饱和） */
  --good: #4f9d69;
  --good-bg: #e7f3ec;
  --ok: #d99a17;
  --ok-bg: #fdf6e3;
  --tight: #d98a3d;
  --tight-bg: #fbeee0;
  --no: #cf6f63;
  --no-bg: #f7e6e3;
  --rec: #d99a17;
  --alt: #8a7a5a;

  --code-bg: #f3efe4;
  --code-text: #4a4438;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, "Segoe UI", "Noto Sans SC", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(74, 68, 56, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 头部（扁平） ---------- */
.hero { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.hero { padding: 16px 18px; }
.hero-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent-2);
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
  border: 1px solid #e9d59e;
}
.brand h1 { margin: 0; font-size: clamp(17px, 2.4vw, 20px); letter-spacing: .2px; font-weight: 800; }
.brand .sub { margin: 2px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.4; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; }
.lg { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-dim);
  background: var(--panel); border: 1px solid var(--line); padding: 6px 11px; border-radius: 999px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-1 { background: var(--accent); }
.dot-2 { background: var(--good); }
.dot-3 { background: var(--accent-2); }

/* ---------- 布局 ---------- */
.app { max-width: 1120px; margin: 0 auto; padding: 20px 18px 44px; }
section { margin: 22px 0; }
h2 { font-size: clamp(16px, 2.4vw, 19px); margin: 0 0 12px; letter-spacing: .1px; font-weight: 800; }

.loading { text-align: center; padding: 56px 0; color: var(--text-dim); }
.spinner {
  width: 38px; height: 38px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 环境检测（扁平卡片） ---------- */
.env {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.env-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.env-title-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.env.is-scanning .chips, .env.is-scanning .fit-bar, .env.is-scanning .scan-meta { opacity: .35; transition: opacity .25s; }
.env.is-scanning .fit-meter .tick { animation: tickscan .5s ease-in-out infinite; }
@keyframes tickscan { 0%,100%{opacity:.4} 50%{opacity:1} }
.pulse { width: 11px; height: 11px; border-radius: 50%; background: var(--good); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(79,157,105,.5); animation: pulse 1.8s infinite; }
.pulse.scanning { background: var(--accent); box-shadow: 0 0 0 0 rgba(217,154,23,.5); animation: spin .9s linear infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(79,157,105,.5);} 70%{box-shadow:0 0 0 10px rgba(79,157,105,0);} }
.scan-meta { margin-top: 12px; font-size: 12px; color: var(--text-mute); }
.scan-meta::before { content: "🕐 "; }

/* 重新检测按钮 */
.btn-scan {
  position: relative; background: var(--accent); border: none; color: #fff;
  font: 700 13px/1 var(--sans); padding: 10px 18px; border-radius: 9px; cursor: pointer;
  white-space: nowrap; transition: background .15s;
}
.btn-scan:hover { background: var(--accent-2); }
.btn-scan.is-busy { opacity: .75; cursor: wait; }
.btn-scan.is-busy::after { content: ""; position: absolute; inset: -3px; border-radius: 12px;
  border: 2px solid transparent; border-top-color: var(--accent); animation: spin .7s linear infinite; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 14px);
  background: var(--text); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; transition: all .3s; z-index: 60; box-shadow: var(--shadow);
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-changed::before { content: "🔄 "; }
.toast-same::before { content: "✓ "; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; gap: 7px; align-items: center; min-width: 0;
  background: var(--accent-bg); border: 1px solid #f0e2bd;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--text);
}
.chip-k { color: var(--text-mute); font-weight: 600; }
.fit-bar { margin-top: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fit-meter { display: flex; gap: 5px; flex-shrink: 0; }
.tick { width: 26px; height: 8px; border-radius: 4px; background: var(--line); }
.tick--on.no { background: var(--no); }
.tick--on.tight { background: var(--tight); }
.tick--on.ok { background: var(--ok); }
.tick--on.good { background: var(--good); }
.fit-label { font-size: 13px; color: var(--text-dim); }
.fit-label b { color: var(--text); font-weight: 700; }

/* ---------- limitations ---------- */
.limits { margin-top: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.limits summary { cursor: pointer; font-size: 13px; color: var(--text-dim); font-weight: 600; user-select: none; }
.limits summary:hover { color: var(--text); }
.limit-list { margin: 10px 0 4px; padding-left: 18px; font-size: 12px; color: var(--text-dim);
  display: flex; flex-direction: column; gap: 4px; line-height: 1.5; }

/* ---------- vibe coding ---------- */
.vibe {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-top: 16px; box-shadow: var(--shadow);
}
.vibe-good { border-color: var(--good); }
.vibe-ok { border-color: var(--ok); }
.vibe-no { border-color: var(--no); }
.vibe-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vibe-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  font-size: 20px; background: var(--accent-soft); border: 1px solid #e9d59e; flex-shrink: 0; }
.vibe-title { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vibe-title b { font-size: 15px; }
.vibe-title small { font-size: 12px; color: var(--text-mute); }
.vibe-badge { font-size: 13px; font-weight: 800; padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.vibe-badge.vc-good { background: var(--good-bg); color: var(--good); border: 1px solid #cfe7d6; }
.vibe-badge.vc-ok { background: var(--ok-bg); color: var(--accent-2); border: 1px solid var(--accent-soft); }
.vibe-badge.vc-no { background: var(--no-bg); color: var(--no); border: 1px solid #eccac5; }
.vibe-verdict { margin: 14px 0 12px; font-size: 14px; color: var(--text); font-weight: 500; }
.vibe-metrics .vm { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-dim); margin-bottom: 14px; }
.vibe-metrics .vm span { min-width: 54px; }
.vibe-metrics .bar { flex: 1; height: 8px; background: var(--line); border-radius: 5px; overflow: hidden; min-width: 0; }
.vibe-metrics .bar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.vibe-metrics .vm b { min-width: 30px; text-align: right; color: var(--text); }
.vibe-configs { display: flex; flex-direction: column; gap: 8px; }
.vc-row { display: flex; gap: 12px; align-items: baseline; font-size: 13px; flex-wrap: wrap; }
.vc-k { flex-shrink: 0; font-weight: 700; min-width: 70px; }
.vc-k.vc-good { color: var(--good); }
.vc-k.vc-ok { color: var(--accent-2); }
.vc-k.vc-no { color: var(--no); }
.vc-v { color: var(--text-dim); }

/* ---------- 推荐卡片 ---------- */
.rec-block { margin-top: 22px; }
.rec-title { display: flex; align-items: center; gap: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  transition: border-color .15s;
}
.card:hover { border-color: var(--accent); }
.card--rec { border-color: var(--accent); background: var(--accent-bg); }
.card-badge { position: absolute; top: -10px; left: 14px; }
.card-badge.badge-rec { background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px; letter-spacing: .4px; }
.card-badge.badge-alt { background: var(--alt); color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-family { font-size: 11px; color: var(--accent-2); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.card-name { margin: 2px 0 0; font-size: 17px; font-weight: 800; }
.card-metric { text-align: right; flex-shrink: 0; }
.card-metric b { font-size: 22px; display: block; font-weight: 800; }
.card-metric span { font-size: 11px; color: var(--text-mute); }
.card-spec { display: flex; gap: 14px; margin: 12px 0; font-size: 12px; color: var(--text-dim); flex-wrap: wrap; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--accent-bg);
  color: var(--accent-2); border: 1px solid #f0e2bd; }
.tag.sm { padding: 1px 6px; }
.card-best { font-size: 13px; color: var(--text-dim); margin: 0 0 12px; min-height: 38px; }
.card-links { display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--line-soft); padding-top: 12px; }
.card-links a { color: var(--accent-2); font-size: 12px; text-decoration: none; font-weight: 600; }
.card-links a:hover { text-decoration: underline; }
.btn-mini {
  background: var(--accent-bg); border: 1px solid #f0e2bd; color: var(--accent-2);
  font: 12px/1 var(--sans); font-weight: 600; padding: 5px 10px; border-radius: 7px; cursor: pointer;
}
.btn-mini:hover { background: var(--accent-soft); }

/* ---------- 部署指导 ---------- */
.deploy-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn {
  background: var(--accent); border: none; color: #fff; font: 600 13px/1 var(--sans);
  padding: 10px 18px; border-radius: 9px; cursor: pointer;
}
.btn:hover { background: var(--accent-2); }
.rt-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.rt {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.rt[data-rt="ollama"] { border-top: 3px solid var(--accent); }
.rt[data-rt="llamacpp"] { border-top: 3px solid var(--good); }
.rt[data-rt="vllm"] { border-top: 3px solid var(--accent-2); }
.rt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rt-label { font-weight: 700; font-size: 15px; }
.rt-diff { font-size: 12px; color: var(--text-mute); }
.rt-desc { color: var(--text-dim); font-size: 13px; margin: 6px 0 14px; }
.steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 12px; list-style: none; counter-reset: s; }
.steps .step { counter-increment: s; }
.steps .step::before { content: counter(s); display: inline-grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); font-size: 11px; font-weight: 800;
  margin-right: 8px; vertical-align: text-bottom; }
.step-h { font-size: 12px; color: var(--text-dim); margin-bottom: 5px; font-weight: 600; }
.step-cmd {
  display: block; font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; color: var(--code-text); white-space: pre-wrap; word-break: break-word;
  cursor: copy; position: relative;
}
.step-cmd:hover { border-color: var(--accent); }
.tips { margin-top: 16px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; }
.tip-list { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 13px;
  display: flex; flex-direction: column; gap: 7px; }
.tip-list b { color: var(--text); }

/* ---------- 按场景选型 ---------- */
.task-lead { color: var(--text-dim); font-size: 13px; margin: 0 0 16px; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.task-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow);
}
.task-head { display: flex; gap: 12px; align-items: flex-start; }
.task-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 19px;
  background: var(--accent-soft); border: 1px solid #e9d59e; flex-shrink: 0; }
.task-head b { font-size: 15px; }
.task-head small { display: block; color: var(--text-dim); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.task-models { display: flex; flex-direction: column; gap: 8px; }
.task-row { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line-soft); }
.task-model { font-size: 13px; font-weight: 700; color: var(--text); }
.task-model i { font-style: normal; color: var(--accent-2); font-weight: 800; margin-left: 4px; }
.task-role { display: inline-block; font-size: 11px; font-weight: 700; color: var(--good); }
.task-note { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.task-best { font-size: 13px; color: var(--text); background: var(--accent-bg);
  border: 1px solid #f0e2bd; border-radius: 9px; padding: 9px 12px; }
.task-note-all { font-size: 12px; color: var(--text-dim); }
.task-limit { font-size: 12px; color: var(--text); background: var(--tight-bg);
  border-left: 3px solid var(--tight); padding: 8px 11px; border-radius: 7px; line-height: 1.4; }

/* ---------- 全家族详解 ---------- */
.fam-lead { color: var(--text-dim); font-size: 13px; margin: 0 0 16px; }
.fam-group { margin: 16px 0; }
.fam-h { font-size: 15px; margin: 0 0 12px; color: var(--text); font-weight: 800; }
.fam-h::before { content: "▸ "; color: var(--accent); }
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.fam-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; display: flex; flex-direction: column; gap: 7px; box-shadow: var(--shadow);
  transition: border-color .15s;
}
.fam-card:hover { border-color: var(--accent); }
.fam-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.fam-name { font-weight: 700; font-size: 14px; }
.fam-params { font-size: 13px; font-weight: 800; color: var(--accent-2); flex-shrink: 0; }
.fam-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 11px; color: var(--text-dim); }
.fam-meta span { background: var(--accent-bg); border: 1px solid #f0e2bd; padding: 2px 7px; border-radius: 6px; }
.fam-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin: 2px 0; }
.fam-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.matrix-lead { color: var(--text-mute); font-size: 12px; margin: 0 0 10px; }

/* ---------- 速览表 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line);
  border-radius: var(--radius); }
.all-models .matrix { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.matrix th, .matrix td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.matrix th { color: var(--text-mute); font-weight: 700; font-size: 11px; text-transform: uppercase;
  letter-spacing: .4px; background: var(--panel-2); }
.matrix .c-name { font-weight: 700; color: var(--text); }
.matrix tbody tr:hover { background: var(--panel-2); }
.matrix tbody tr:last-child td { border-bottom: none; }
.src { color: var(--text-mute); font-size: 12px; margin-top: 14px; }

.foot { text-align: center; color: var(--text-mute); font-size: 12px; padding: 22px 16px 38px;
  border-top: 1px solid var(--line); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .app { padding: 16px 14px 36px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 640px) {
  .hero-inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .legend { justify-content: flex-start; }
  .lg { flex: 1; justify-content: center; }
  .cards, .rt-cols, .task-grid, .fam-grid { grid-template-columns: 1fr; }
  .env-title { flex-direction: column; align-items: flex-start; gap: 12px; }
  .btn-scan { width: 100%; text-align: center; }
  .vibe-head { flex-direction: column; align-items: flex-start; }
  .vibe-badge { align-self: flex-start; }
  .task-head { flex-direction: column; gap: 8px; }
  .fit-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .vc-row { flex-direction: column; gap: 2px; }
  .vc-k { min-width: 0; }
}
@media (max-width: 380px) {
  .card-spec { flex-direction: column; gap: 6px; }
  .brand-logo { width: 38px; height: 38px; font-size: 18px; }
}
