/* ============================================================
   亿起算（杭州）科技有限公司 — 官网全局样式
   统一品牌头 / 主导航 / 页脚，电商与信息模块共用
   ============================================================ */
:root {
  --brand: #d93a2b;
  --brand-2: #f0584a;
  --brand-bg: #fff2f0;
  --blue: #2b6cd9;
  --blue-2: #4a86f0;
  --text-1: #1a1a1a;
  --text-2: #555;
  --text-3: #999;
  --border: #e8eaed;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
}

/* ---------- 全站品牌顶栏 ---------- */
.site-topbar { background: #23262b; color: #c4c9d0; font-size: 12px; }
.site-topbar .inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 36px;
  display: flex; align-items: center; justify-content: space-between; }
.site-topbar .left { display: flex; gap: 16px; align-items: center; }
.site-topbar a { color: #c4c9d0; }
.site-topbar a:hover { color: #fff; }
.site-topbar .right { display: flex; gap: 14px; align-items: center; }

/* ---------- 全站品牌头 ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.site-header .inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 88px;
  display: flex; align-items: center; gap: 20px; }
.site-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-logo .mark { width: 48px; height: 48px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 24px; font-weight: 800; }
.site-logo .txt b { display: block; font-size: 19px; letter-spacing: 1px; color: var(--text-1); }
.site-logo .txt small { color: var(--text-3); font-size: 12px; letter-spacing: .5px; }
.site-header .search { flex: 1; max-width: 520px; margin-left: 10px; }
.site-header .search .box { display: flex; height: 42px; border: 2px solid var(--brand); border-radius: 22px; overflow: hidden; }
.site-header .search input { flex: 1; border: 0; outline: none; padding: 0 18px; font-size: 14px; font-family: inherit; }
.site-header .search button { border: 0; background: var(--brand); color: #fff; padding: 0 26px;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.site-header .search button:hover { background: var(--brand-2); }
.site-header .actions { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; }
.site-header .actions a { color: var(--text-2); }
.site-header .actions a:hover { color: var(--brand); }
.site-header .cart-btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 16px;
  border: 1px solid var(--border); border-radius: 22px; color: var(--text-1) !important; }
.site-header .cart-btn:hover { border-color: var(--brand); color: var(--brand) !important; }
.site-header .cart-btn .badge { background: var(--brand); color: #fff; border-radius: 10px;
  font-size: 11px; padding: 1px 6px; }

/* ---------- 全站主导航（核心：模块即栏目） ---------- */
.site-nav { background: #fff; border-bottom: 2px solid var(--brand); }
.site-nav .inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 4px; }
.site-nav a { padding: 14px 22px; font-size: 15px; color: var(--text-1); text-decoration: none;
  position: relative; transition: .15s; white-space: nowrap; }
.site-nav a:hover { color: var(--brand); }
.site-nav a.on { color: var(--brand); font-weight: 700; }
.site-nav a.on::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 3px; background: var(--brand); border-radius: 2px 2px 0 0; }
.site-nav .spacer { flex: 1; }
.site-nav .nav-sub { display: flex; gap: 2px; overflow-x: auto; }
.site-nav .nav-sub a { font-size: 14px; color: var(--text-2); padding: 14px 16px; }

/* 二级分类条（模块内） */
.subcats { background: #fafbfc; border-bottom: 1px solid var(--border); }
.subcats .inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; gap: 2px; overflow-x: auto; }
.subcats a { padding: 12px 16px; font-size: 14px; color: var(--text-2); white-space: nowrap; }
.subcats a:hover, .subcats a.on { color: var(--brand); }

/* ---------- 通用页脚 ---------- */
.site-footer { background: #23262b; color: #9aa0a8; margin-top: 50px; font-size: 13px; }
.site-footer .cols { max-width: 1200px; margin: 0 auto; padding: 44px 20px 30px;
  display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.1fr 1fr; gap: 28px; }
.site-footer h4 { color: #fff; font-size: 14px; margin-bottom: 16px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #9aa0a8; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .brand p { line-height: 1.9; }
.site-footer .brand .contact { margin-top: 12px; font-size: 13px; }
.site-footer .brand .contact span { display: block; margin-bottom: 4px; }
.site-footer .bottom { border-top: 1px solid #33373e; text-align: center; padding: 20px;
  font-size: 12px; color: #7d838b; line-height: 2; }
.site-footer .bottom a { color: #a8aeb6; }

@media (max-width: 900px) {
  .site-header .inner { flex-wrap: wrap; height: auto; padding: 14px 16px; gap: 12px; }
  .site-header .search { order: 3; width: 100%; max-width: none; margin-left: 0; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  /* 主导航：横向滑动，隐藏滚动条，去掉占位 spacer */
  .site-nav .inner { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .site-nav .inner::-webkit-scrollbar { display: none; }
  .site-nav .spacer { display: none; }
  .site-nav .nav-sub:empty { display: none; }
  .subcats .inner { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .subcats .inner::-webkit-scrollbar { display: none; }
}

@media (max-width: 768px) {
  /* 顶栏：手机上隐藏左侧地址/公司名，账户区右对齐且禁止拆行 */
  .site-topbar .inner { height: auto; min-height: 34px; padding: 5px 14px; }
  .site-topbar .left { display: none; }
  .site-topbar .right { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; row-gap: 2px; }
  .site-topbar a, .site-topbar span { white-space: nowrap; }
  /* 品牌头：logo 与购物车缩紧到同一行 */
  .site-logo { gap: 10px; }
  .site-logo .mark { width: 38px; height: 38px; border-radius: 10px; font-size: 19px; }
  .site-logo .txt b { font-size: 14px; letter-spacing: 0; white-space: nowrap; }
  .site-logo .txt small { font-size: 11px; }
  .site-header .actions { gap: 10px; flex: none; }
  .site-header .cart-btn { padding: 7px 12px; }
  /* 主导航：紧凑化，尽量一屏放下 */
  .site-nav a { padding: 12px 13px; font-size: 14px; }
  .site-nav a.on::after { left: 13px; right: 13px; }
  .subcats a { padding: 10px 13px; font-size: 13px; }
}
@media (max-width: 560px) {
  .site-footer .cols { grid-template-columns: 1fr; }
}

/* ---------- 图片上传组件 img-picker ---------- */
.img-picker { margin-top: 6px; }
.img-picker .ip-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.img-picker .ip-item { position: relative; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border, #e3e6ea); background: #f7f8fa; }
.img-picker .ip-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-picker .ip-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; line-height: 1; border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.img-picker .ip-del:hover { background: rgba(0,0,0,.8); }
.img-picker .ip-add { display: flex; align-items: center; justify-content: center; width: 92px; height: 92px; border: 1.5px dashed #cfd4da; border-radius: 8px; color: var(--text-3, #8a9099); font-size: 13px; cursor: pointer; background: #fafbfc; transition: .15s; }
.img-picker .ip-add:hover { border-color: var(--primary, #e1251b); color: var(--primary, #e1251b); background: #fff6f5; }
.img-picker .ip-hint { font-size: 12px; color: var(--text-3, #9aa0a8); margin-top: 8px; }

/* 后台表单通用 */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--text-2, #4a5058); margin-bottom: 7px; font-weight: 600; }
.form-row input[type=text], .form-row input[type=number], .form-row select, .form-row textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border, #e3e6ea); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; box-sizing: border-box; }
.form-row textarea { min-height: 96px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--primary, #e1251b); }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.btn-primary { background: var(--primary, #e1251b); color: #fff; border: none; padding: 10px 22px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-ghost { background: #fff; color: var(--text-2, #4a5058); border: 1px solid var(--border, #e3e6ea); padding: 10px 22px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 999; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; padding: 24px 26px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.modal-box .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .modal-box .grid2 { grid-template-columns: 1fr; } }
