/* ==========================================================================
   京蓝科技 · 电脑租赁官网 —— 基础样式与设计令牌
   设计基调：专业、干净、可信赖；主色取京东红，辅以深红强调行动点
   ========================================================================== */

:root {
  /* 主色 —— 京东红 */
  --brand: #e1251b;
  --brand-dark: #c81623;
  --brand-light: #f6655c;
  --brand-50: #fff1f0;
  --brand-100: #ffe0dd;

  /* 强调色 —— 深红（询价 / 行动按钮） */
  --accent: #c81623;
  --accent-dark: #a5121c;
  --accent-50: #fff1f0;

  /* 功能色 */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #e1251b;

  /* 中性 */
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --line: #e2e8f0;
  --line-2: #f1f5f9;
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;

  /* 尺寸 */
  --radius: 10px;
  --radius-lg: 16px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
  --maxw: 1240px;
  --header-h: 68px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
          "Hiragino Sans GB", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   重置
   ------------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

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

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

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.35; color: var(--text); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* --------------------------------------------------------------------------
   布局
   ------------------------------------------------------------------------ */

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 900px; margin: 0 auto; padding: 0 20px; }

.row { display: flex; }
.row-center { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.flex-1 { flex: 1; } .flex-wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.hide { display: none !important; }

/* --------------------------------------------------------------------------
   顶部导航
   ------------------------------------------------------------------------ */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar {
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  height: 34px;
  display: flex; align-items: center;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; }
.topbar a { color: rgba(255, 255, 255, .9); }
.topbar a:hover { color: #fff; }
.topbar-links { display: flex; gap: 18px; }

.header-main {
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-img {
  width: 42px; height: 42px; object-fit: contain;
  flex-shrink: 0; display: block;
}
.logo-mark {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--brand);
  color: #fff; font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -.5px;
}
.logo-text b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.logo-text span { display: block; font-size: 11px; color: var(--text-3); letter-spacing: 1.2px; }
.footer-logo .logo-img { width: 46px; height: 46px; }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav a {
  position: relative;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 500; color: var(--text-2);
  transition: all .16s;
  white-space: nowrap;
}
.nav a:hover { color: var(--brand); background: var(--brand-50); }
.nav a.active { color: var(--brand); font-weight: 600; }
.nav a.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--brand);
}

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* 移动端抽屉 */
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: 8px; font-size: 20px; }
.menu-toggle:hover { background: var(--bg-3); }

/* --------------------------------------------------------------------------
   按钮
   ------------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; line-height: 1.4;
  transition: all .16s; white-space: nowrap;
  border: 1px solid transparent;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: 0 4px 12px rgba(225, 37, 27, .28); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); box-shadow: 0 4px 12px rgba(200, 22, 35, .3); }

.btn-outline { border-color: var(--line); color: var(--text-2); background: #fff; }
.btn-outline:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }

.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-3); color: var(--text); }

.btn-lg { padding: 13px 30px; font-size: 16px; border-radius: 8px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   表单
   ------------------------------------------------------------------------ */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field label .req { color: var(--danger); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; font-size: 14px; transition: all .16s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(225, 37, 27, .1);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* --------------------------------------------------------------------------
   卡片 / 区块
   ------------------------------------------------------------------------ */

.section { padding: 64px 0; }
.section-alt { background: var(--bg-2); }

.section-head { text-align: center; margin-bottom: 44px; }
.section-head .eyebrow {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  background: var(--brand-50); color: var(--brand);
  font-size: 12px; font-weight: 700; letter-spacing: .6px; margin-bottom: 12px;
}
.section-head h2 { font-size: 30px; letter-spacing: -.5px; }
.section-head p { margin-top: 10px; color: var(--text-2); font-size: 15px; }

.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all .22s;
}
.card-hover:hover { border-color: var(--brand-100); box-shadow: var(--shadow-lg); transform: translateY(-3px); }

/* --------------------------------------------------------------------------
   徽章 / 标签
   ------------------------------------------------------------------------ */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; line-height: 1.7;
}
.badge-brand { background: var(--brand-50); color: var(--brand); }
.badge-accent { background: var(--accent-50); color: var(--accent-dark); }
.badge-success { background: #ecfdf5; color: #047857; }
.badge-warning { background: #fffbeb; color: #b45309; }
.badge-danger { background: #fef2f2; color: #b91c1c; }
.badge-gray { background: var(--bg-3); color: var(--text-2); }

.chip {
  display: inline-flex; align-items: center;
  padding: 5px 13px; border-radius: 20px;
  border: 1px solid var(--line); background: #fff;
  font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .16s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* --------------------------------------------------------------------------
   价格
   ------------------------------------------------------------------------ */

.price { color: var(--accent-dark); font-weight: 800; letter-spacing: -.5px; }
.price .cur { font-size: .62em; margin-right: 1px; }
.price .unit { font-size: .52em; font-weight: 500; color: var(--text-3); margin-left: 2px; letter-spacing: 0; }

/* --------------------------------------------------------------------------
   空态 / 加载
   ------------------------------------------------------------------------ */

.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty .icon { font-size: 46px; margin-bottom: 12px; opacity: .5; }
.empty p { font-size: 14px; }

.spinner {
  width: 26px; height: 26px; margin: 0 auto;
  border: 3px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--line-2) 37%, var(--bg-3) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* --------------------------------------------------------------------------
   提示条
   ------------------------------------------------------------------------ */

.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; display: flex; align-items: flex-start; gap: 9px;
  border: 1px solid transparent; line-height: 1.6;
}
.alert-info { background: var(--brand-50); color: var(--brand-dark); border-color: var(--brand-100); }
.alert-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.alert-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* 轻提示 */
.toast-wrap {
  position: fixed; top: 84px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 11px 20px; border-radius: var(--radius);
  background: rgba(15, 23, 42, .93); color: #fff;
  font-size: 14px; box-shadow: var(--shadow-lg);
  animation: toastIn .26s cubic-bezier(.16, 1, .3, 1);
  max-width: 90vw;
}
.toast.ok { background: #047857; }
.toast.err { background: #b91c1c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   弹层
   ------------------------------------------------------------------------ */

.modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn .18s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  box-shadow: var(--shadow-lg); animation: modalIn .24s cubic-bezier(.16, 1, .3, 1);
}
.modal-lg { max-width: 860px; }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }

.modal-head {
  padding: 20px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 24px; }
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px; background: var(--bg-2);
}
.modal-close { width: 32px; height: 32px; border-radius: 8px; font-size: 20px; color: var(--text-3); }
.modal-close:hover { background: var(--bg-3); color: var(--text); }

/* --------------------------------------------------------------------------
   工具类
   ------------------------------------------------------------------------ */

.divider { height: 1px; background: var(--line); }
.muted { color: var(--text-3); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.fw-600 { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ellipsis-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   页脚
   ------------------------------------------------------------------------ */

.site-footer { background: #0f172a; color: #cbd5e1; padding: 52px 0 0; margin-top: 0; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px; padding-bottom: 40px;
}
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.footer-logo .logo-mark { background: #e1251b; }
.footer-logo b { color: #fff; font-size: 17px; font-weight: 800; }
.footer-desc { font-size: 13px; line-height: 1.9; color: #94a3b8; }
.footer-links { display: flex; flex-direction: column; gap: 11px; font-size: 14px; }
.footer-links a { color: #cbd5e1; transition: color .16s; }
.footer-contact { display: flex; flex-direction: column; gap: 13px; font-size: 14px; }
.footer-contact .item { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .ico { color: #e1251b; flex-shrink: 0; font-size: 15px; }
.footer-tel { font-size: 21px; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.footer-bottom {
  border-top: 1px solid #1e293b; padding: 20px 0;
  font-size: 13px; color: #64748b;
}
.footer-bottom .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
.footer-bottom .beian { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-bottom .beian .sep { color: #334155; }
.footer-bottom a { color: #94a3b8; transition: color .16s; }
.footer-bottom a:hover { color: #e1251b; }

/* --------------------------------------------------------------------------
   响应式
   ------------------------------------------------------------------------ */

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .section { padding: 52px 0; }
  .section-head h2 { font-size: 26px; }
}

@media (max-width: 820px) {
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px; box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .nav a.active::after { display: none; }
  .nav a.active { background: var(--brand-50); }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .header-actions .btn span.lbl { display: none; }
  .header-actions .btn { padding: 8px 12px; }
  .topbar-links { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap, .wrap-narrow { padding: 0 16px; }
  .section { padding: 40px 0; }
  .section-head { margin-bottom: 28px; }
  .section-head h2 { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .logo-text span { display: none; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
}

/* ========================================================================
   商品卡片组件（首页热租 / 商品列表页共用；原在 home.css，列表页不引 home 故迁移至此）
   ======================================================================== */
.pd-card {
  display: flex; flex-direction: column; height: 100%;
  border-radius: 14px; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pd-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .10), 0 3px 10px rgba(15, 23, 42, .05);
  border-color: #fecaca;
}
/* 固定高度替代 aspect-ratio：旧内核（360 极速等）不支持 aspect-ratio 会塌陷 */
.pd-img {
  position: relative; height: 205px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.pd-img img {
  width: 100%; height: 100%; object-fit: contain; padding: 16px;
  transition: transform .25s ease;
}
.pd-card:hover .pd-img img { transform: scale(1.045); }
/* 无主图占位：浅品牌底 + 设备线性图标 + 品牌名 */
.pd-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; width: 100%; height: 100%;
  background: linear-gradient(160deg, #fff5f4 0%, #fdeceb 55%, #fbdeda 100%);
  user-select: none;
}
.pd-placeholder svg { width: 58px; height: 58px; color: #e69a93; }
.pd-placeholder .pb-brand { font-size: 13px; font-weight: 600; color: #c96f68; letter-spacing: 1px; }
.pd-badges {
  position: absolute; top: 10px; left: 10px; right: 10px;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start;
}
.pd-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.pd-name { font-size: 15px; font-weight: 600; line-height: 1.5; min-height: 44px; color: var(--text); }
.pd-spec { font-size: 12.5px; color: var(--text-3); margin-top: 7px; }
.pd-foot {
  margin-top: auto; padding-top: 15px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
}
.pd-price .price { font-size: 23px; }
.pd-btn {
  font-size: 13px; font-weight: 600; color: var(--brand);
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: var(--brand-50); transition: all .16s; white-space: nowrap;
}
.pd-card:hover .pd-btn { background: var(--brand); color: #fff; }
