/* ==========================================================================
   帮个忙 bgm.wang — 前台样式（暖橙品牌色）
   ========================================================================== */

:root {
  --brand: #ff6b2c;
  --brand-2: #ff9a3d;
  --brand-deep: #e8541a;
  --brand-soft: #fff2e8;
  --brand-soft-2: #ffe2cd;
  --brand-glow: rgba(255, 107, 44, .18);

  --ink: #1b1e24;
  --ink-2: #4b525b;
  --ink-3: #8b9199;
  --ink-4: #a9aeb5;

  --line: #eee8e1;
  --line-2: #f6f1eb;
  --bg: #fffcf9;
  --card: #fff;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(60, 40, 20, .04);
  --shadow-2: 0 10px 28px rgba(255, 107, 44, .14);
  --shadow-3: 0 18px 44px rgba(60, 40, 20, .10);

  --wrap: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; border: 0; }
button, input, textarea, select { font: inherit; color: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================ 顶部 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 252, 249, .88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; }

.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--brand-2), var(--brand) 55%, var(--brand-deep));
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 6px 14px var(--brand-glow);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 18px; letter-spacing: .5px; }
.brand-text em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--ink-4);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.search-form {
  flex: 1 1 auto;
  max-width: 480px;
  margin-left: auto;
  position: relative;
}

.search-form input {
  width: 100%;
  height: 40px;
  padding: 0 92px 0 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.search-form input::placeholder { color: var(--ink-4); }
.search-form input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.search-form .s-ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-4); pointer-events: none;
}
.search-form button {
  position: absolute; right: 4px; top: 4px;
  height: 32px; padding: 0 16px;
  border: 0; border-radius: 999px;
  background: linear-gradient(145deg, var(--brand-2), var(--brand));
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: filter .18s, transform .18s;
}
.search-form button:hover { filter: brightness(1.05); }

.header-links { display: flex; align-items: center; gap: 8px; flex: none; }
.header-links a {
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: 9px;
  transition: background .16s, color .16s;
  white-space: nowrap;
}
.header-links a:hover { background: var(--brand-soft); color: var(--brand-deep); }

/* 分类导航 */
.cat-nav {
  border-top: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .5);
}
.cat-nav-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav-inner a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 13px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: background .16s, color .16s;
}
.cat-nav-inner a:hover { background: var(--brand-soft); color: var(--brand-deep); }
.cat-nav-inner a.is-on {
  background: linear-gradient(145deg, var(--brand-2), var(--brand));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px var(--brand-glow);
}

/* ============================================================ Hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: 38px 0 26px;
}
.hero::before {
  content: "";
  position: absolute;
  top: -160px; right: -80px;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(255, 154, 61, .22), transparent 66%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -200px; left: -120px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(255, 107, 44, .10), transparent 68%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -.4px;
  font-weight: 700;
}
.hero h1 .hl {
  background: linear-gradient(100deg, var(--brand-deep), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.hero p b { color: var(--brand-deep); font-variant-numeric: tabular-nums; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.stat-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  box-shadow: var(--shadow-1);
}
.stat-pill b {
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ============================================================ 区块标题 */

.section { padding-bottom: 44px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 16px;
}
.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-head h2::before {
  content: "";
  width: 4px; height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
}
.section-head .more { font-size: 13px; color: var(--ink-3); }
.section-head .more:hover { color: var(--brand-deep); }

/* ============================================================ 工具卡片 */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 14px;
}

.tool-grid.is-dense {
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
}

.tool-card {
  position: relative;
  display: block;
  padding: 16px 18px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .2s,
              border-color .2s;
}
.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-soft-2);
  box-shadow: var(--shadow-2);
}
.tool-card:active { transform: translateY(-1px); }

.tc-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ico {
  width: 42px; height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(155deg, #fff6ee, #ffe5d1);
  border: 1px solid #ffeada;
  overflow: hidden;
  font-size: 21px;
  line-height: 1;
}
.ico i { font-style: normal; }
.ico img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ico.is-lg {
  width: 60px; height: 60px;
  border-radius: 16px;
  font-size: 30px;
}

.tc-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.1px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-card:hover .tc-name { color: var(--brand-deep); }

.tc-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.tc-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-4);
}

.badge {
  position: absolute;
  top: 13px; right: 13px;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.7;
  letter-spacing: .2px;
}
.b-hot  { color: #d92b2b; background: #ffecec; }
.b-new  { color: #0f8f5f; background: #e7f8f0; }
.b-rec  { color: #8b5cf6; background: #f2ecff; }
.b-free { color: #0b7fd4; background: #e8f4ff; }

/* ============================================================ 空态 */

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-3);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty .e-ico { font-size: 34px; margin-bottom: 8px; }
.empty p { margin: 0 0 4px; font-size: 14px; }
.empty small { color: var(--ink-4); }

/* ============================================================ 面包屑 */

.crumb {
  padding: 16px 0 0;
  font-size: 12.5px;
  color: var(--ink-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.crumb a:hover { color: var(--brand-deep); }
.crumb .sep { color: #d8d2ca; }

/* ============================================================ 工具详情页 */

.tool-hero {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.tool-hero .th-main { flex: 1 1 auto; min-width: 0; }
.tool-hero h1 {
  margin: 0 0 6px;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tool-hero h1 .badge { position: static; }
.tool-hero .th-desc {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}
.tool-hero .th-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12.5px;
  color: var(--ink-4);
}
.tool-hero .th-actions { flex: none; display: flex; gap: 8px; padding-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
}
.btn:hover { border-color: var(--brand-soft-2); color: var(--brand-deep); }
.btn-primary {
  border: 0;
  background: linear-gradient(145deg, var(--brand-2), var(--brand));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px var(--brand-glow);
}
.btn-primary:hover { color: #fff; filter: brightness(1.05); box-shadow: 0 8px 22px var(--brand-glow); }

/* 工具承载区 */
.tool-stage {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.tool-stage .stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-2);
  background: #fffdfb;
  font-size: 12.5px;
  color: var(--ink-4);
}
.tool-stage iframe {
  display: block;
  width: 100%;
  height: min(72vh, 780px);
  min-height: 520px;
  border: 0;
  background: #fff;
}

.stage-placeholder {
  padding: 70px 24px;
  text-align: center;
}
.stage-placeholder .sp-ico {
  font-size: 40px;
  margin-bottom: 12px;
  filter: saturate(.9);
}
.stage-placeholder h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 650;
}
.stage-placeholder p {
  margin: 0 auto 18px;
  max-width: 460px;
  color: var(--ink-3);
  font-size: 13.5px;
}

/* 详情补充文字 */
.prose {
  margin-top: 22px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.85;
}
.prose h2 { font-size: 16px; margin: 0 0 10px; color: var(--ink); }
.prose h3 { font-size: 14.5px; margin: 18px 0 8px; color: var(--ink); }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 20px; }
.prose a { color: var(--brand-deep); text-decoration: underline; text-underline-offset: 2px; }
.prose code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 12.5px;
}

/* ============================================================ 搜索页 */

.search-hero {
  padding: 34px 0 8px;
  text-align: center;
}
.search-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
}
.search-big {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.search-big input {
  width: 100%;
  height: 48px;
  padding: 0 118px 0 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  outline: none;
  box-shadow: var(--shadow-1);
  transition: border-color .18s, box-shadow .18s;
}
.search-big input:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 5px var(--brand-soft);
}
.search-big .s-ico {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--ink-4);
}
.search-big button {
  position: absolute; right: 5px; top: 5px;
  height: 38px; padding: 0 22px;
  border: 0; border-radius: 999px;
  background: linear-gradient(145deg, var(--brand-2), var(--brand));
  color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.search-result-tip {
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
  margin: 14px 0 22px;
}
.search-result-tip b { color: var(--brand-deep); }
.hot-words {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.hot-words a {
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
}
.hot-words a:hover { border-color: var(--brand-soft-2); color: var(--brand-deep); }

/* ============================================================ 分页 */

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 30px 0 10px;
}
.pager .pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
  transition: all .16s;
}
.pager a.pg:hover { border-color: var(--brand-soft-2); color: var(--brand-deep); }
.pager .is-cur {
  background: linear-gradient(145deg, var(--brand-2), var(--brand));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.pager .is-dis, .pager .is-gap {
  color: var(--ink-4);
  background: transparent;
  border-color: transparent;
}

/* ============================================================ 表单（反馈页） */

.form-card {
  max-width: 620px;
  margin: 0 auto;
  padding: 26px 28px 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.field label .req { color: var(--brand); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.field .hint { margin-top: 5px; font-size: 12px; color: var(--ink-4); }

.alert {
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-ok { color: #0f7a4f; background: #eafaf2; border-color: #c6efdd; }
.alert-err { color: #b42318; background: #fff1f0; border-color: #ffd5d0; }

/* ============================================================ 页脚 */

.site-footer {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdfb, #fff7f0);
}
.footer-main {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  padding: 34px 0 26px;
}
.footer-main h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: .3px;
}
.footer-main p {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
}
.footer-links { display: flex; flex-direction: column; gap: 7px; }
.footer-links a { font-size: 12.5px; color: var(--ink-3); }
.footer-links a:hover { color: var(--brand-deep); }
.footer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.footer-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
.footer-brand strong { font-size: 15px; }

.footer-bar {
  border-top: 1px solid var(--line-2);
  padding: 14px 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-4);
}
.footer-bar a { color: var(--ink-4); }
.footer-bar a:hover { color: var(--brand-deep); }

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  color: var(--ink-2);
  box-shadow: var(--shadow-3);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all .22s;
  z-index: 40;
}
.to-top.is-show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--brand-deep); border-color: var(--brand-soft-2); }

/* ============================================================ 404 */

.err-page {
  padding: 90px 20px;
  text-align: center;
}
.err-page .code {
  font-size: clamp(64px, 12vw, 110px);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(145deg, var(--brand-2), var(--brand-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -4px;
}
.err-page h1 { margin: 10px 0 8px; font-size: 20px; }
.err-page p { margin: 0 0 22px; color: var(--ink-3); font-size: 14px; }

/* ============================================================ 响应式 */

@media (max-width: 900px) {
  .footer-main { grid-template-columns: 1fr 1fr; }
  .header-links .hide-sm { display: none; }
}

@media (max-width: 720px) {
  .header-inner {
    height: auto;
    padding: 12px 0 10px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .brand-text em { display: none; }
  .search-form {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }
  .header-links { margin-left: auto; }
  .header-links a { padding: 6px 9px; font-size: 13px; }
  .cat-nav-inner { height: 42px; }
  .hero { padding: 26px 0 18px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(46%, 1fr)); gap: 10px; }
  .tool-card { padding: 13px 14px 15px; }
  .ico { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
  .tc-name { font-size: 14px; }
  .tc-desc { font-size: 12px; min-height: 38px; }
  .tool-hero { flex-wrap: wrap; }
  .tool-hero .th-actions { width: 100%; padding-top: 0; }
  .tool-stage iframe { min-height: 420px; height: 60vh; }
  .footer-main { grid-template-columns: 1fr; gap: 18px; padding: 26px 0 18px; }
  .form-card { padding: 20px 18px 24px; }
  .prose { padding: 16px 16px; }
}

@media (max-width: 420px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .wrap { padding: 0 14px; }
}
