/* ============================================================
   BYB云 · 企业级设计系统（蓝白扁平风）
   主色 #0052d9 · 白底 · 4px 圆角 · 微软雅黑
   ============================================================ */
:root {
  --primary: #0052d9;
  --primary-hover: #0346b8;
  --primary-active: #003ea6;
  --primary-light: #e8f1ff;
  --primary-lighter: #f2f7ff;
  --text: #181818;
  --text-body: #333333;
  --text-muted: #666666;
  --text-light: #999999;
  --bg: #ffffff;
  --bg-gray: #f5f6f7;
  --bg-blue: #f0f6ff;
  --border: #e5e6eb;
  --border-hover: #0052d9;
  --price: #ff4d4f;
  --success: #00a870;
  --warning: #ed7b2f;
  --danger: #d54941;
  --radius: 4px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 2px 8px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .12);
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  --nav-height: 62px;
  --maxw: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; vertical-align: middle; }
a { color: var(--text-body); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary); }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5 { font-weight: 600; color: var(--text); line-height: 1.4; }
::selection { background: rgba(0, 82, 217, .12); }

/* ---------- 容器 ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 22px; font-size: 14px; font-weight: 400;
  border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: all .15s; white-space: nowrap; font-family: var(--font); line-height: 1;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-primary:active { background: var(--primary-active); }
.btn-outline { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-lighter); color: var(--primary); }
.btn-plain { background: #fff; border-color: var(--border); color: var(--text-body); }
.btn-plain:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: #fff1f0; }
.btn-sm { height: 30px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 32px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-body); margin-bottom: 6px; }
.field .req { color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; font-size: 14px; font-family: var(--font);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--text-body); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 100px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 82, 217, .1); }
.input-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }

/* ---------- 提示条 ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; border: 1px solid; line-height: 1.5; }
.alert-success { background: #e8f8f2; border-color: #b3e8d1; color: #007a54; }
.alert-error { background: #fdeceb; border-color: #f5c2c0; color: #c04037; }
.alert-warning { background: #fef3e6; border-color: #f9d9b0; color: #b4641f; }
.alert-info { background: var(--primary-lighter); border-color: #c6dcf7; color: var(--primary); }

/* ---------- 徽章 ---------- */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 2px; font-size: 12px; font-weight: 400; line-height: 1; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-accent { background: #fff1f0; color: var(--price); }
.badge-success { background: #e8f8f2; color: var(--success); }
.badge-warning { background: #fef3e6; color: var(--warning); }
.badge-danger { background: #fdeceb; color: var(--danger); }
.badge-gray { background: var(--bg-gray); color: var(--text-muted); }

/* ---------- 卡片 ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card-body { padding: 20px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { background: var(--bg-gray); font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.table tr:hover td { background: var(--primary-lighter); }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 顶部导航 ---------- */
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: #fff; border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; height: var(--nav-height); gap: 36px; }
.logo { display: flex; align-items: center; gap: 9px; flex: none; }
.logo img { height: 32px; width: auto; }
.logo .logo-text { font-size: 19px; font-weight: 700; color: var(--text); white-space: nowrap; letter-spacing: .5px; }
.logo .logo-text b { color: var(--primary); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; height: 100%; }
.nav > a { display: flex; align-items: center; height: 100%; padding: 0 16px; color: var(--text-body); font-size: 14px; border-bottom: 2px solid transparent; }
.nav > a:hover, .nav > a.active { color: var(--primary); border-bottom-color: var(--primary); }
.nav .dropdown { position: relative; height: 100%; display: flex; align-items: center; }
.nav .dropdown-menu { position: absolute; top: 100%; left: 0; min-width: 180px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 50; }
.nav .dropdown:hover .dropdown-menu { display: block; }
.nav .dropdown-menu a { display: block; padding: 9px 12px; border-radius: var(--radius); font-size: 13px; }
.nav .dropdown-menu a:hover { background: var(--primary-lighter); color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.header-actions .cart-badge { position: relative; }
.header-actions .cart-badge .count { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; font-size: 11px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 1px; transition: .2s; }

/* ---------- 内容区（避开固定导航） ---------- */
main { padding-top: var(--nav-height); min-height: 60vh; }

/* ---------- 页脚 ---------- */
.footer { background: #fff; border-top: 1px solid var(--border); margin-top: 48px; }
.footer-top { padding: 40px 0 28px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { font-size: 14px; margin-bottom: 14px; color: var(--text); }
.footer a { color: var(--text-muted); display: block; padding: 5px 0; font-size: 13px; }
.footer a:hover { color: var(--primary); }
.footer .brand-desc { color: var(--text-muted); font-size: 13px; margin-top: 10px; max-width: 320px; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; font-size: 12px; color: var(--text-light); text-align: center; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, #f0f6ff 0%, #ffffff 100%); padding: 84px 0 56px; }
.hero .hero-inner { display: flex; align-items: center; gap: 48px; }
.hero-left { flex: 1; }
.hero h1 { font-size: 40px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.hero h1 .hl { color: var(--primary); }
.hero p { font-size: 16px; color: var(--text-muted); max-width: 560px; margin-bottom: 28px; line-height: 1.7; }
.hero .hero-btns { display: flex; gap: 12px; margin-bottom: 24px; }
.hero .hero-points { display: flex; gap: 28px; flex-wrap: wrap; }
.hero .hero-points span { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.hero .hero-points i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.hero-right { flex: none; width: 380px; }
.hero-right .hero-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }

/* ---------- 区块 ---------- */
.section { padding: 48px 0; }
.section-head { text-align: center; margin-bottom: 32px; }
.section-head h2 { font-size: 28px; margin-bottom: 10px; }
.section-head p { color: var(--text-muted); font-size: 14px; }

/* ---------- 网格 ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 产品卡片 ---------- */
.product-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: all .2s; display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card .pc-head { padding: 16px 18px 12px; }
.product-card .pc-name { font-size: 15px; font-weight: 600; color: var(--text); }
.product-card .pc-tag { margin-left: 6px; vertical-align: middle; }
.product-card .pc-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.product-card .pc-specs { padding: 6px 18px 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; flex: 1; }
.product-card .pc-spec { font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: baseline; overflow: hidden; white-space: nowrap; }
.product-card .pc-spec .k { color: var(--text-light); flex: none; }
.product-card .pc-spec .v { overflow: hidden; text-overflow: ellipsis; }
.product-card .pc-foot { padding: 12px 18px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-card .price { font-size: 20px; font-weight: 700; color: var(--price); }
.product-card .price small { font-size: 12px; color: var(--text-light); font-weight: 400; }
.product-card .price .cur { font-size: 13px; }

/* ---------- 特性卡片 ---------- */
.feature-card { text-align: center; padding: 28px 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); transition: .2s; }
.feature-card:hover { box-shadow: var(--shadow); }
.feature-card .icon { width: 44px; height: 44px; border-radius: var(--radius-lg); background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 22px; }
.feature-card h3 { font-size: 16px; margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text-muted); }

/* ---------- 面包屑 ---------- */
.breadcrumb { padding: 14px 0; font-size: 13px; color: var(--text-light); background: #fff; border-bottom: 1px solid var(--border); }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 8px; color: #ccc; }

/* ---------- 详情页 ---------- */
.detail-wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.spec-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.spec-item { padding: 12px 14px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.spec-item:nth-child(2n) { border-right: none; }
.spec-item:nth-last-child(-n+2) { border-bottom: none; }
.spec-item .k { font-size: 12px; color: var(--text-light); }
.spec-item .v { font-size: 14px; color: var(--text); margin-top: 2px; }
.price-panel { position: sticky; top: 82px; }
.price-panel .big { font-size: 30px; font-weight: 700; color: var(--price); }
.price-panel .big small { font-size: 14px; color: var(--text-light); font-weight: 400; }

/* ---------- 仪表盘布局 ---------- */
.dashboard { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 24px 0; align-items: start; }
.sidebar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; position: sticky; top: 82px; }
.sidebar .side-head { padding: 16px; background: var(--primary); color: #fff; }
.sidebar .side-head .name { font-weight: 600; font-size: 15px; }
.sidebar .side-head .sub { font-size: 12px; opacity: .85; }
.sidebar .side-menu { padding: 8px; }
.sidebar .side-menu a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius); color: var(--text-body); font-size: 13px; }
.sidebar .side-menu a:hover { background: var(--bg-gray); }
.sidebar .side-menu a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.main-col { min-width: 0; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--text); }
.stat-card .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-card .icon { float: right; width: 36px; height: 36px; border-radius: var(--radius-lg); background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* ---------- 认证页 ---------- */
.auth-wrap { max-width: 420px; margin: 32px auto; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head h1 { font-size: 22px; }
.auth-head p { color: var(--text-muted); font-size: 13px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-light); }
.empty .icon { font-size: 40px; margin-bottom: 12px; }

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .detail-wrap { grid-template-columns: 1fr; }
  .hero .hero-inner { flex-direction: column; }
  .hero-right { width: 100%; }
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar .side-menu { display: flex; flex-wrap: wrap; gap: 4px; }
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: var(--nav-height); left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 8px 16px; display: none; box-shadow: var(--shadow-lg); height: auto; }
  .nav.open { display: flex; }
  .nav > a { padding: 12px 0; height: auto; border-bottom: none; }
  .nav .dropdown-menu { position: static; display: block; box-shadow: none; border: none; padding: 0 0 0 12px; }
  .header-actions .btn-login { display: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 28px; }
  .section-head h2 { font-size: 22px; }
  .spec-list { grid-template-columns: 1fr; }
  .spec-item:nth-child(2n) { border-right: 1px solid var(--border); }
  .footer-top { grid-template-columns: 1fr; }
  .header-inner { gap: 16px; }
}

/* 工具类 */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-between { display: flex; align-items: center; justify-content: space-between; } .items-center { align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.w-full { width: 100%; }
