/* ============================================================
   亿起算（杭州）科技有限公司 - 主样式
   ============================================================ */
:root {
  --primary: #1a5fb4;
  --primary-light: #2b7fe0;
  --primary-dark: #134a8c;
  --primary-bg: #eef4fc;
  --text: #1a1a1a;
  --text-2: #666;
  --text-3: #999;
  --border: #e8e8e8;
  --bg: #f5f6f8;
  --white: #fff;
  --danger: #e63946;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.10);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei","PingFang SC","Noto Sans SC",-apple-system,sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== 顶部条 ===== */
.topbar { background: #f0f2f5; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.topbar a:hover { color: var(--primary); }
.topbar .left span { margin-right: 16px; }
.topbar .right a { margin-left: 16px; }
.topbar .right .who { color: var(--primary); font-weight: 600; }

/* ===== 头部 ===== */
header { background: var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.04); position: sticky; top: 0; z-index: 100; }
header .wrap { display: flex; align-items: center; gap: 28px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo .mark {
  width: 42px; height: 42px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700;
}
.logo .txt b { font-size: 19px; color: var(--primary); letter-spacing: .5px; display: block; line-height: 1.1; }
.logo .txt small { font-size: 11px; color: var(--text-3); letter-spacing: 1px; }

.searchbox { flex: 1; display: flex; max-width: 560px; }
.searchbox input {
  flex: 1; height: 42px; border: 2px solid var(--primary); border-right: none;
  border-radius: 8px 0 0 8px; padding: 0 16px; font-size: 14px; outline: none;
}
.searchbox input::placeholder { color: #bbb; }
.searchbox button {
  height: 42px; padding: 0 28px; background: var(--primary); color: #fff; border: none;
  border-radius: 0 8px 8px 0; font-size: 15px; cursor: pointer; font-weight: 600;
}
.searchbox button:hover { background: var(--primary-dark); }

.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.btn {
  height: 40px; padding: 0 20px; border-radius: 8px; font-size: 14px; cursor: pointer;
  border: none; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-ghost { background: #fff; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--text-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 6px; }

/* ===== 分类导航 ===== */
nav.cats { background: var(--white); border-bottom: 1px solid var(--border); }
nav.cats .wrap { display: flex; gap: 4px; height: 48px; align-items: center; overflow-x: auto; }
nav.cats a {
  padding: 0 18px; height: 34px; line-height: 34px; border-radius: 17px;
  color: var(--text-2); white-space: nowrap; font-size: 14px; transition: .15s;
}
nav.cats a:hover { background: var(--primary-bg); color: var(--primary); }
nav.cats a.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ===== 主区 ===== */
main { padding: 24px 0 60px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 18px; }
.section-title h2 { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title h2::before { content: ""; width: 4px; height: 20px; background: var(--primary); border-radius: 2px; }
.section-title .more { color: var(--text-3); font-size: 13px; }
.section-title .more:hover { color: var(--primary); }

/* 分类宫格 */
.cat-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; margin-bottom: 36px; }
.cat-card {
  background: var(--white); border-radius: var(--radius); padding: 20px 8px; text-align: center;
  cursor: pointer; transition: .2s; border: 1px solid transparent;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-bg); }
.cat-card .ico {
  width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 14px;
  background: var(--primary-bg); display: flex; align-items: center; justify-content: center;
  font-size: 24px; transition: .2s;
}
.cat-card:hover .ico { background: var(--primary); filter: brightness(1.1); }
.cat-card b { font-size: 13px; font-weight: 600; color: var(--text); }
.cat-card small { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* 信息卡片 */
.list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.item {
  background: var(--white); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: .2s; border: 1px solid transparent;
}
.item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-bg); }
.item .thumb {
  height: 150px; background: linear-gradient(135deg, #dbe7f7, #eef4fc);
  display: flex; align-items: center; justify-content: center; color: #a8bfe0; font-size: 13px; position: relative;
}
.item .thumb .tag {
  position: absolute; top: 10px; left: 10px; background: var(--primary); color: #fff;
  font-size: 11px; padding: 3px 9px; border-radius: 5px; font-weight: 600;
}
.item .body { padding: 14px 16px; }
.item .body h3 {
  font-size: 15px; font-weight: 600; line-height: 1.45; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 43px;
}
.item .body .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-3); }
.item .price { color: var(--danger); font-weight: 700; font-size: 16px; }
.item .price small { font-size: 12px; }
.item .loc { display: flex; align-items: center; gap: 3px; }

/* 分页 */
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 36px; }
.pager a, .pager span {
  min-width: 36px; height: 36px; line-height: 34px; text-align: center; border-radius: 8px;
  background: #fff; border: 1px solid var(--border); color: var(--text-2); padding: 0 10px; cursor: pointer;
}
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }

/* ===== 卡片通用 ===== */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; margin-bottom: 20px; }

/* ===== 页脚 ===== */
footer { background: #2b2f36; color: #9aa0a8; padding: 40px 0 24px; font-size: 13px; }
footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
footer h4 { color: #fff; font-size: 14px; margin-bottom: 14px; }
footer ul { list-style: none; }
footer li { margin-bottom: 8px; }
footer a:hover { color: #fff; }
footer .brand p { line-height: 1.9; color: #868d96; margin-top: 10px; }
footer .bottom { border-top: 1px solid #3a3f47; padding-top: 20px; text-align: center; color: #6f767e; font-size: 12px; line-height: 1.9; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.form-group label .req { color: var(--danger); margin-left: 3px; }
.form-group label small { color: var(--text-3); font-weight: 400; margin-left: 8px; font-size: 12px; }
.form-control {
  width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 14px; font-size: 14px; font-family: inherit; outline: none; transition: .15s; background: #fafbfc;
}
.form-control:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-bg); }
textarea.form-control { height: 130px; padding: 12px 14px; resize: vertical; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ===== 通用提示 ===== */
.toast {
  position: fixed; top: 90px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.82); color: #fff; padding: 12px 26px; border-radius: 8px;
  font-size: 14px; z-index: 9999; opacity: 0; transition: .25s; pointer-events: none;
}
.toast.show { opacity: 1; top: 100px; }
.toast.err { background: rgba(200,40,50,.92); }
.toast.ok { background: rgba(30,140,70,.92); }

.empty { text-align: center; padding: 60px 0; color: var(--text-3); }
.empty .ico { font-size: 48px; margin-bottom: 12px; }

/* ===== 响应式 ===== */
@media (max-width: 1000px) {
  .list { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  header .wrap { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
  .searchbox { max-width: 100%; order: 3; width: 100%; }
  .list { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  footer .cols { grid-template-columns: 1fr; }
  nav.cats .wrap { height: auto; flex-wrap: nowrap; overflow-x: auto; padding: 8px 0; }
}
