/* fatfish — 大肥鱼桌宠故障排查站 */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-code: #f4f5f7;
  --text: #1a1d21;
  --text-2: #5a6069;
  --text-3: #8b919b;
  --line: #e4e7ec;
  --brand: #2563eb;
  --brand-soft: #eff4ff;
  --warn-bg: #fff8ed;
  --warn-line: #f5c26b;
  --warn-text: #8a5300;
  --ok-bg: #f0fdf4;
  --ok-line: #86d99b;
  --ok-text: #166534;
  --err-bg: #fef2f2;
  --err-line: #f5a3a3;
  --err-text: #991b1b;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}

/* 布局 */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

header.site {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo span { color: var(--brand); }

nav.top {
  display: flex;
  gap: 22px;
}

nav.top a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
}

nav.top a:hover { color: var(--brand); }

main {
  padding: 40px 0 80px;
}

/* 面包屑 */
.crumb {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 16px;
}

.crumb a { color: var(--text-3); text-decoration: none; }
.crumb a:hover { color: var(--brand); }
.crumb span { margin: 0 6px; }

/* 标题 */
h1 {
  font-size: 28px;
  line-height: 1.35;
  font-weight: 650;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 26px 0 10px;
}

p { margin: 0 0 14px; }

.lead {
  font-size: 17px;
  color: var(--text-2);
  margin-bottom: 28px;
}

a { color: var(--brand); }

/* 提示框 */
.box {
  border-left: 3px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 15px;
}

.box p:last-child { margin-bottom: 0; }

.box.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.box.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); }
.box.err { background: var(--err-bg); border-color: var(--err-line); color: var(--err-text); }
.box.info { background: var(--brand-soft); border-color: var(--brand); color: #1e40af; }

.box strong { font-weight: 600; }

/* 代码 */
code {
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  color: #b91c1c;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 13.5px;
}

/* 步骤 */
ol.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 22px;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

ol.steps > li > strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

/* 相关链接 */
.related {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 44px;
}

.related h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text-2);
}

.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related li { margin-bottom: 8px; }

.related li:last-child { margin-bottom: 0; }

.related a { text-decoration: none; }

.related a:hover { text-decoration: underline; }

/* 首页 */
.hero {
  padding: 20px 0 36px;
}

.hero h1 {
  font-size: 34px;
  line-height: 1.3;
  margin-bottom: 16px;
}

.hero .lead {
  font-size: 18px;
  max-width: 620px;
}

/* 卡片网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 24px 0;
}

@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 23px; }
  .hero h1 { font-size: 26px; }
  nav.top { gap: 14px; }
  nav.top a { font-size: 13px; }
}

.card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}

.card:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.card .t {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text);
}

.card .d {
  font-size: 13.5px;
  color: var(--text-3);
  line-height: 1.6;
}

/* 配置生成器 */
.generator {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin: 28px 0;
  background: var(--bg);
}

.field {
  margin-bottom: 20px;
}

.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field .hint {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 8px;
  line-height: 1.5;
}

.field input[type=range] {
  width: 100%;
  accent-color: var(--brand);
}

.field .val {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 13px;
  color: var(--brand);
  font-weight: 600;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.switch-row:last-child { border-bottom: none; }

.switch-row .lbl { font-size: 14px; }

.switch-row .sub {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch .slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 22px;
  cursor: pointer;
  transition: background .15s;
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform .15s;
}

.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.output {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.output pre {
  margin-bottom: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { background: #1d4ed8; }

.btn.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--line);
}

.btn.ghost:hover { background: var(--brand-soft); border-color: var(--brand); }

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14.5px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 600;
  color: var(--text-2);
  font-size: 13.5px;
  background: var(--bg-soft);
}

/* 页脚 */
footer.site {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  font-size: 13px;
  color: var(--text-3);
}

footer.site a { color: var(--text-3); text-decoration: none; }
footer.site a:hover { color: var(--brand); }

/* 列表 */
ul.plain {
  padding-left: 20px;
  margin: 14px 0;
}

ul.plain li { margin-bottom: 8px; }

/* Article navigation and narrow screens */
.article-meta { font-size: 13px; color: var(--text-2); }
.quick-answer { background: var(--brand-soft); padding: 16px; border-radius: 8px; margin: 18px 0; }
.quick-answer p { margin-bottom: 0; }
.toc { margin: 16px 0; }
.toc summary { cursor: pointer; }
.crumb ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumb li + li::before { content: '/'; margin-right: 6px; }
.crumb span { margin: 0; }
h2[id] { scroll-margin-top: 100px; }
main { overflow-wrap: anywhere; }
pre { overflow-wrap: normal; }
table { table-layout: fixed; }
th, td { overflow-wrap: anywhere; }
.switch input:focus-visible + .slider { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (max-width: 560px) {
  header.site .wrap { height: auto; min-height: 60px; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  nav.top { flex-wrap: wrap; gap: 16px; }
  main { padding-top: 24px; }
  h1 { font-size: 25px; }
  th, td { padding: 8px 5px; font-size: 13px; }
}
