/* ==========================================================================
   修龙科技 · 元器件商城  前台主题样式
   ========================================================================== */

:root {
    --brand: #1d4ed8;
    --brand-2: #2f6bff;
    --brand-dark: #16389c;
    --brand-soft: #eef3ff;
    --accent: #ff6a00;
    --accent-soft: #fff3e8;
    --danger: #e5484d;
    --success: #16a34a;
    --warn: #d97706;
    --text: #1f2937;
    --text-2: #4b5563;
    --muted: #8b95a5;
    --line: #e6e9ef;
    --line-2: #f0f2f6;
    --bg: #f4f6f9;
    --white: #fff;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 4px 16px rgba(16, 24, 40, .08);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
    --wrap: 1240px;
    --header-h: 108px;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a { color: inherit; text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; color: var(--text); }
p { margin: 0 0 10px; }
ul, ol { margin: 0; padding-left: 20px; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap24 { gap: 24px; }
.grow { flex: 1; }

/* ------------------------------------------------------------------ 顶栏 */
.topbar {
    background: #101828;
    color: #cbd5e1;
    font-size: 12px;
    height: 34px;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 34px; }
.topbar a { color: #cbd5e1; }
.topbar a:hover { color: #fff; }
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar .sep { color: #334155; }
.topbar .hot { color: #ffb020; }

/* ------------------------------------------------------------------ 头部 */
.header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-main { display: flex; align-items: center; gap: 24px; padding: 16px 0; }
.logo { flex: 0 0 auto; }
.logo img { height: 46px; width: auto; }

.search-box { flex: 1; max-width: 680px; position: relative; }
.search-form {
    display: flex;
    border: 2px solid var(--brand);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    height: 44px;
}
.search-form select {
    border: 0; background: #f8fafc; color: var(--text-2);
    padding: 0 10px; outline: none; max-width: 120px;
    border-right: 1px solid var(--line);
    cursor: pointer;
}
.search-form input[type=text] {
    flex: 1; border: 0; outline: none; padding: 0 14px; height: 100%;
}
.search-form button {
    border: 0; background: var(--brand); color: #fff;
    padding: 0 28px; font-weight: 700; cursor: pointer; font-size: 15px;
    transition: background .18s;
}
.search-form button:hover { background: var(--brand-dark); }

.search-hot { display: flex; gap: 12px; padding: 6px 2px 0; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.search-hot a { color: var(--muted); }
.search-hot a:hover { color: var(--brand); }

.suggest-panel {
    position: absolute; top: 50px; left: 0; right: 0;
    background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    z-index: 60; max-height: 420px; overflow-y: auto; display: none;
}
.suggest-panel.open { display: block; }
.suggest-group-title { padding: 8px 14px; font-size: 12px; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line-2); }
.suggest-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-2); }
.suggest-item:hover { background: var(--brand-soft); }
.suggest-item .pn { font-weight: 700; color: var(--text); }
.suggest-item .br { color: var(--muted); font-size: 12px; }
.suggest-item .pr { margin-left: auto; color: var(--accent); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.cart-btn {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--line); border-radius: 8px;
    padding: 8px 14px; background: #fff; position: relative;
    transition: all .18s;
}
.cart-btn:hover { border-color: var(--brand); color: var(--brand); }
.cart-btn .cart-count {
    position: absolute; top: -8px; right: -8px;
    background: var(--accent); color: #fff;
    min-width: 20px; height: 20px; border-radius: 10px;
    font-size: 11px; display: flex; align-items: center; justify-content: center;
    padding: 0 5px; font-weight: 700;
}
.btn-bom {
    background: linear-gradient(135deg, #ff7a18, #ff5a00);
    color: #fff; border-radius: 8px; padding: 10px 18px;
    font-weight: 700; display: flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 106, 0, .28);
}
.btn-bom:hover { color: #fff; filter: brightness(1.05); }

/* ------------------------------------------------------------------ 导航 */
.nav { background: var(--white); border-bottom: 2px solid var(--brand); position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: stretch; height: 46px; position: relative; }
.nav-all {
    width: 210px; background: var(--brand); color: #fff;
    display: flex; align-items: center; gap: 8px; padding: 0 18px;
    font-weight: 700; cursor: pointer; flex: 0 0 auto;
}
.nav-links { display: flex; align-items: stretch; flex: 1; }
.nav-links a {
    display: flex; align-items: center; padding: 0 20px;
    font-size: 15px; font-weight: 500; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--brand); }
.nav-links a.active::after {
    content: ""; position: absolute; left: 20px; right: 20px; bottom: -2px;
    height: 2px; background: var(--brand);
}
.nav-links a .tag-new {
    background: var(--accent); color: #fff; font-size: 10px;
    padding: 1px 5px; border-radius: 3px; margin-left: 5px; font-weight: 700;
}

/* 巨型菜单 */
.mega {
    position: absolute; top: 46px; left: 0;
    width: 1020px; max-width: calc(100vw - 32px);
    background: #fff; border: 1px solid var(--line);
    border-top: 0; box-shadow: var(--shadow-lg);
    display: none; z-index: 55; border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}
.mega.open { display: flex; }
.mega-cats { width: 210px; background: #fafbfd; border-right: 1px solid var(--line); max-height: 520px; overflow-y: auto; }
.mega-cat { padding: 9px 16px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.mega-cat:hover, .mega-cat.on { background: #fff; color: var(--brand); font-weight: 700; }
.mega-cat .arrow { color: var(--muted); font-size: 12px; }
.mega-body { flex: 1; padding: 16px 20px; max-height: 520px; overflow-y: auto; }
.mega-group { margin-bottom: 14px; }
.mega-group h5 { font-size: 13px; color: var(--brand); margin-bottom: 8px; border-left: 3px solid var(--brand); padding-left: 8px; }
.mega-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mega-chips a {
    font-size: 12px; color: var(--text-2); background: #f5f7fa;
    padding: 4px 10px; border-radius: 4px; border: 1px solid transparent;
}
.mega-chips a:hover { background: var(--brand-soft); color: var(--brand); border-color: #c7d7ff; }

/* ------------------------------------------------------------------ 通用块 */
.page { padding: 18px 0 40px; }
.section { background: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.section-title .bar { width: 4px; height: 20px; background: var(--brand); border-radius: 2px; }
.section-title small { font-size: 13px; color: var(--muted); font-weight: 400; }
.section-more { font-size: 13px; color: var(--muted); }
.section-more:hover { color: var(--brand); }

.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-2); padding-bottom: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 16px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 12px 0; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sp { color: #cbd5e1; }

/* ------------------------------------------------------------------ 按钮 */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
    cursor: pointer; font-weight: 600; transition: all .18s; background: #fff; color: var(--text);
    line-height: 1.4;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #e85f00; color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #cf3b40; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-weight: 600; }

/* ------------------------------------------------------------------ 表单 */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.form-row label .req { color: var(--danger); margin-left: 3px; }
.input, select.input, textarea.input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); outline: none; transition: border .18s; background: #fff;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .1); }
textarea.input { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

.radio-cards { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-card {
    border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 16px;
    cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all .18s; background: #fff;
}
.radio-card:hover { border-color: var(--brand); }
.radio-card.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.radio-card input { accent-color: var(--brand); }

/* ------------------------------------------------------------------ 商品卡 */
.product-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.product-grid.col4 { grid-template-columns: repeat(4, 1fr); }
.product-grid.col3 { grid-template-columns: repeat(3, 1fr); }
.product-grid.col2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.pcard {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    position: relative;
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #c7d7ff; }
.pcard-img { position: relative; aspect-ratio: 1/1; background: #fafbfc; display: flex; align-items: center; justify-content: center; padding: 10px; }
.pcard-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s ease; }
.pcard:hover .pcard-img img { transform: scale(1.06); }
.pcard-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pcard-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.pcard-pn { font-size: 14px; font-weight: 700; color: var(--text); word-break: break-all; line-height: 1.35; height: 38px; overflow: hidden; }
.pcard-pn:hover { color: var(--brand); }
.pcard-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.pcard-specs { font-size: 12px; color: var(--text-2); margin-top: 6px; height: 34px; overflow: hidden; }
.pcard-price { margin-top: auto; padding-top: 10px; display: flex; align-items: flex-end; justify-content: space-between; }
.price { color: var(--accent); font-weight: 700; font-size: 19px; }
.price small { font-size: 12px; font-weight: 400; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 12px; margin-left: 6px; }
.pcard-stock { font-size: 12px; color: var(--muted); }
.pcard-stock b { color: var(--success); }
.pcard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pcard-actions .btn { white-space: nowrap; }

.badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 3px; font-weight: 600; line-height: 1.7; }
.badge-hot { background: #fff1f0; color: #d4380d; }
.badge-new { background: #e6f4ff; color: #0958d9; }
.badge-self { background: #f6ffed; color: #389e0d; }
.badge-domestic { background: #fff7e6; color: #d46b08; }
.badge-gray { background: #f1f3f5; color: var(--text-2); }
.badge-blue { background: var(--brand-soft); color: var(--brand); }
.badge-red { background: #fff1f0; color: #cf1322; }
.badge-green { background: #f6ffed; color: #389e0d; }
.badge-orange { background: #fff7e6; color: #d46b08; }

/* ------------------------------------------------------------------ 首页 */
.hero { display: grid; grid-template-columns: 240px 1fr 260px; gap: 14px; margin-bottom: 18px; }
.hero-side { background: #fff; border-radius: var(--radius); padding: 12px 0; box-shadow: var(--shadow-sm); }
.hero-side h4 { font-size: 14px; padding: 0 16px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.hero-side ul { list-style: none; padding: 0; margin: 0; }
.hero-side li a { display: flex; align-items: center; justify-content: space-between; padding: 6px 16px; font-size: 13px; color: var(--text-2); }
.hero-side li a:hover { background: var(--brand-soft); color: var(--brand); }
.hero-side li a span { color: var(--muted); font-size: 12px; }

.hero-slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); background: #0b3d91; }
.hero-slide { display: none; }
.hero-slide.on { display: block; }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; }
.hero-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.hero-dots i { width: 24px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .45); cursor: pointer; display: block; }
.hero-dots i.on { background: #fff; }
.hero-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 56px;
    background: rgba(0, 0, 0, .28); color: #fff; border: 0; cursor: pointer; z-index: 3;
    font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.hero-arrow:hover { background: rgba(0, 0, 0, .45); }
.hero-arrow.prev { left: 0; border-radius: 0 6px 6px 0; }
.hero-arrow.next { right: 0; border-radius: 6px 0 0 6px; }

.hero-right { display: flex; flex-direction: column; gap: 14px; }
.hero-user { background: linear-gradient(135deg, #fff, #f7f9ff); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); text-align: center; }
.hero-user .avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--brand-soft); margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; color: var(--brand); font-size: 22px; font-weight: 700; }
.hero-user .uname { font-weight: 700; }
.hero-user .uact { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.hero-user .uact a { flex: 1; border: 1px solid var(--line); border-radius: 6px; padding: 6px 0; font-size: 12px; }
.hero-user .uact a:hover { border-color: var(--brand); color: var(--brand); }

.hero-notice { background: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); flex: 1; }
.hero-notice h4 { font-size: 14px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.hero-notice h4 a { font-size: 12px; color: var(--muted); font-weight: 400; }
.hero-notice ul { list-style: none; padding: 0; margin: 0; }
.hero-notice li { font-size: 13px; padding: 5px 0; display: flex; gap: 6px; }
.hero-notice li::before { content: "·"; color: var(--brand); font-weight: 700; }
.hero-notice li a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.promise { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.promise-item { background: #fff; border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm); }
.promise-item .ico { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.promise-item h5 { font-size: 14px; }
.promise-item p { font-size: 12px; color: var(--muted); margin: 2px 0 0; }

.cat-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.cat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; transition: all .2s; }
.cat-card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-3px); }
.cat-card .ico { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.cat-card .nm { font-size: 13px; font-weight: 600; }
.cat-card .sub { font-size: 11px; color: var(--muted); margin-top: 2px; height: 30px; overflow: hidden; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: linear-gradient(135deg, #1d4ed8, #0ea5e9); color: #fff; border-radius: var(--radius); padding: 22px; text-align: center; }
.stat .v { font-size: 34px; font-weight: 800; line-height: 1.1; }
.stat .l { font-size: 13px; opacity: .9; margin-top: 6px; }

.brand-wall { display: grid; grid-template-columns: repeat(10, 1fr); gap: 10px; }
.brand-item {
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
    height: 62px; display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--text-2); font-size: 13px; transition: all .2s; padding: 6px;
    text-align: center; word-break: break-word;
}
.brand-item:hover { border-color: var(--brand); color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-2px); }

.bom-cta { background: linear-gradient(120deg, #0f766e, #14b8a6); border-radius: var(--radius); padding: 28px 32px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.bom-cta h3 { color: #fff; font-size: 24px; }
.bom-cta p { color: rgba(255, 255, 255, .9); margin: 6px 0 0; }
.bom-cta .btn { background: #fff; color: #0f766e; font-weight: 700; }

/* ------------------------------------------------------------------ 列表/筛选 */
.list-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.filter-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.filter-block { border-bottom: 1px solid var(--line-2); padding: 14px 16px; }
.filter-block:last-child { border-bottom: 0; }
.filter-block h5 { font-size: 13px; margin-bottom: 10px; }
.filter-block .opts { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.filter-block .opts.row { flex-direction: row; flex-wrap: wrap; }
.filter-block .opts.row label { width: 46%; }
.filter-block label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.filter-block label:hover { color: var(--brand); }
.filter-block input[type=checkbox], .filter-block input[type=radio] { accent-color: var(--brand); }
.filter-block .cnt { color: var(--muted); font-size: 12px; margin-left: auto; }

.toolbar { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 10px 16px; display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .sorts { display: flex; gap: 4px; }
.toolbar .sorts a { padding: 5px 12px; border-radius: 4px; font-size: 13px; color: var(--text-2); }
.toolbar .sorts a.on { background: var(--brand); color: #fff; font-weight: 600; }
.toolbar .count { font-size: 13px; color: var(--muted); margin-left: auto; }
.toolbar .prices { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.toolbar .prices input { width: 70px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; outline: none; }

.active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.chip a { color: var(--muted); }
.chip a:hover { color: var(--danger); }

/* ------------------------------------------------------------------ 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 24px 0 8px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px;
    display: flex; align-items: center; justify-content: center; background: #fff;
    font-size: 13px; padding: 0 10px;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .cur { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pager .dis { color: #cbd5e1; cursor: not-allowed; }

/* ------------------------------------------------------------------ 商品详情 */
.detail-top { display: grid; grid-template-columns: 420px 1fr; gap: 24px; }
.gallery { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.gallery-main { border: 1px solid var(--line-2); border-radius: var(--radius-sm); aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; padding: 16px; background: #fafbfc; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 12px; }
.gallery-thumbs img { width: 62px; height: 62px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; cursor: pointer; object-fit: contain; background: #fff; }
.gallery-thumbs img.on { border-color: var(--brand); }

.detail-info { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.detail-title { font-size: 24px; font-weight: 800; line-height: 1.3; word-break: break-all; }
.detail-sub { color: var(--muted); font-size: 13px; margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.detail-price-box { background: linear-gradient(120deg, #fff8f3, #fff); border: 1px solid #ffe0c7; border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; }
.detail-price-box .cur { font-size: 13px; color: var(--muted); }
.detail-price-box .big { font-size: 34px; color: var(--accent); font-weight: 800; line-height: 1.1; }
.detail-price-box .big small { font-size: 14px; font-weight: 400; }

.tier-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.tier-table th, .tier-table td { border: 1px solid #ffe0c7; padding: 7px 10px; text-align: center; background: #fff; }
.tier-table th { background: #fff8f3; color: var(--text-2); font-weight: 600; }
.tier-table td.p { color: var(--accent); font-weight: 700; }
.tier-table tr.on td { background: #fff3e8; }

.kv-list { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 13px; margin: 14px 0; }
.kv-list dt { color: var(--muted); }
.kv-list dd { margin: 0; }

.qty-box { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; width: 132px; }
.qty-box button { width: 36px; height: 38px; border: 0; background: #f8fafc; cursor: pointer; font-size: 16px; color: var(--text-2); }
.qty-box button:hover { background: var(--brand-soft); color: var(--brand); }
.qty-box input { width: 60px; height: 38px; border: 0; text-align: center; outline: none; font-weight: 700; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a, .tabs button { padding: 11px 22px; font-size: 15px; color: var(--text-2); border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; font-weight: 600; }
.tabs a.on, .tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab-pane { display: none; }
.tab-pane.on { display: block; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table th, .spec-table td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.spec-table th { background: #fafbfc; width: 160px; color: var(--text-2); font-weight: 600; }
.spec-table tr:nth-child(even) td { background: #fcfdfe; }

.alt-item { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
.alt-item img { width: 58px; height: 58px; object-fit: contain; background: #fafbfc; border-radius: 6px; }
.alt-item .info { flex: 1; }
.alt-item .pn { font-weight: 700; }

/* ------------------------------------------------------------------ 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.table th { background: #fafbfc; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.table tbody tr:hover { background: #fcfdff; }
.table .pn { font-weight: 700; }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------------ 购物车 / 结算 */
.cart-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cart-table th { background: #fafbfc; padding: 12px; text-align: left; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--line); }
.cart-table td { padding: 14px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.cart-table .pinfo { display: flex; gap: 12px; align-items: center; }
.cart-table .pinfo img { width: 64px; height: 64px; object-fit: contain; background: #fafbfc; border-radius: 6px; border: 1px solid var(--line-2); }

.cart-bar {
    position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); padding: 14px 20px;
    display: flex; align-items: center; gap: 20px; border-radius: 0 0 var(--radius) var(--radius);
    margin-top: -1px; flex-wrap: wrap;
}
.cart-bar .total { margin-left: auto; text-align: right; }
.cart-bar .total .amt { font-size: 24px; color: var(--accent); font-weight: 800; }

.steps { display: flex; align-items: center; gap: 0; margin-bottom: 20px; }
.steps .step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.steps .step .n { width: 24px; height: 24px; border-radius: 50%; background: #e9edf3; color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.steps .step.on { color: var(--brand); font-weight: 700; }
.steps .step.on .n { background: var(--brand); color: #fff; }
.steps .line { flex: 1; height: 1px; background: var(--line); margin: 0 14px; min-width: 40px; }

.addr-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer; transition: all .18s; background: #fff; position: relative; }
.addr-card:hover { border-color: var(--brand); }
.addr-card.on { border-color: var(--brand); background: var(--brand-soft); }
.addr-card .nm { font-weight: 700; }
.addr-card .ph { color: var(--text-2); margin-left: 10px; }
.addr-card .ad { color: var(--muted); font-size: 13px; margin-top: 4px; }
.addr-card .def { position: absolute; top: 12px; right: 14px; }

.summary-list { font-size: 13px; }
.summary-list .row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-list .row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 15px; }
.summary-list .row.total b { color: var(--accent); font-size: 22px; }

/* ------------------------------------------------------------------ 订单 */
.order-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.order-head { background: #fafbfc; padding: 10px 16px; display: flex; align-items: center; gap: 20px; font-size: 13px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.order-head .no { font-weight: 700; }
.order-head .st { margin-left: auto; font-weight: 700; }
.order-body { padding: 14px 16px; }
.order-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: flex-end; gap: 10px; background: #fff; }
.order-goods { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.order-goods:last-child { border-bottom: 0; }
.order-goods img { width: 56px; height: 56px; object-fit: contain; background: #fafbfc; border-radius: 6px; border: 1px solid var(--line-2); }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 1px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.timeline li.on::before { background: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); }
.timeline .t { font-weight: 600; font-size: 13px; }
.timeline .d { color: var(--muted); font-size: 12px; }

.status-tag { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.st-10 { background: #fff7e6; color: #d46b08; }
.st-20 { background: #e6f4ff; color: #0958d9; }
.st-30 { background: #f0f5ff; color: #2f54eb; }
.st-40 { background: #f6ffed; color: #389e0d; }
.st-50 { background: #f1f3f5; color: #6b7280; }
.st-60 { background: #fff1f0; color: #cf1322; }

/* ------------------------------------------------------------------ 个人中心 */
.account-layout { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: start; }
.account-side { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.account-side .me { background: linear-gradient(135deg, #1d4ed8, #2f6bff); color: #fff; padding: 20px 16px; text-align: center; }
.account-side .me .av { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .22); margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.account-side .me .lv { display: inline-block; background: rgba(255, 255, 255, .22); border-radius: 10px; padding: 1px 10px; font-size: 11px; margin-top: 6px; }
.account-side nav { padding: 8px 0; }
.account-side nav a { display: flex; align-items: center; gap: 8px; padding: 10px 18px; font-size: 13px; color: var(--text-2); border-left: 3px solid transparent; }
.account-side nav a:hover { background: #fafbfd; color: var(--brand); }
.account-side nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; border-left-color: var(--brand); }
.account-side nav .grp { padding: 12px 18px 6px; font-size: 12px; color: var(--muted); }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.stat-card .l { font-size: 12px; color: var(--muted); }
.stat-card .v { font-size: 24px; font-weight: 800; margin-top: 4px; }
.stat-card .v.orange { color: var(--accent); }
.stat-card .v.blue { color: var(--brand); }

/* ------------------------------------------------------------------ BOM */
.bom-hero { background: linear-gradient(120deg, #0b3d91, #1d4ed8 60%, #0ea5e9); border-radius: var(--radius); padding: 36px; color: #fff; margin-bottom: 18px; }
.bom-hero h2 { color: #fff; font-size: 30px; }
.bom-hero p { color: rgba(255, 255, 255, .88); margin-top: 8px; max-width: 720px; }
.bom-hero .features { display: flex; gap: 28px; margin-top: 20px; flex-wrap: wrap; }
.bom-hero .features div { font-size: 13px; }
.bom-hero .features b { display: block; font-size: 22px; }

.drop-zone {
    border: 2px dashed #c7d7ff; border-radius: var(--radius); background: #fafbff;
    padding: 40px 20px; text-align: center; cursor: pointer; transition: all .2s;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--brand); background: var(--brand-soft); }
.drop-zone .ico { font-size: 40px; color: var(--brand); }
.drop-zone h4 { margin: 10px 0 6px; }
.drop-zone p { color: var(--muted); font-size: 13px; }

.bom-textarea { width: 100%; min-height: 220px; font-family: Consolas, Monaco, monospace; font-size: 13px; line-height: 1.7; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none; resize: vertical; }
.bom-textarea:focus { border-color: var(--brand); }

.match-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.match-stat { border-radius: var(--radius-sm); padding: 14px; text-align: center; background: #fafbfc; border: 1px solid var(--line); }
.match-stat .v { font-size: 26px; font-weight: 800; }
.match-stat .l { font-size: 12px; color: var(--muted); }
.match-stat.ok .v { color: var(--success); }
.match-stat.part .v { color: var(--warn); }
.match-stat.alt .v { color: var(--brand); }
.match-stat.no .v { color: var(--danger); }

/* ------------------------------------------------------------------ 品牌/活动 */
.brand-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.brand-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; transition: all .2s; }
.brand-card:hover { box-shadow: var(--shadow); border-color: #c7d7ff; transform: translateY(-3px); }
.brand-card .lg { height: 52px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: var(--brand); margin-bottom: 8px; }
.brand-card .nm { font-weight: 700; }
.brand-card .ct { font-size: 12px; color: var(--muted); }

.point-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.point-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: all .2s; display: flex; flex-direction: column; }
.point-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.point-card img { aspect-ratio: 1/1; object-fit: cover; background: #fafbfc; }
.point-card .bd { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.point-card .nm { font-weight: 700; font-size: 14px; }
.point-card .sb { font-size: 12px; color: var(--muted); margin-top: 2px; }
.point-card .pt { color: var(--accent); font-weight: 800; font-size: 18px; margin-top: 8px; }
.point-card .pt small { font-size: 12px; font-weight: 400; }

.article-list { display: flex; flex-direction: column; }
.article-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.article-item:last-child { border-bottom: 0; }
.article-item img { width: 150px; height: 96px; object-fit: cover; border-radius: 6px; background: #fafbfc; flex: 0 0 auto; }
.article-item .tt { font-size: 16px; font-weight: 700; }
.article-item .sm { color: var(--muted); font-size: 13px; margin-top: 6px; }
.article-item .mt { color: var(--muted); font-size: 12px; margin-top: 8px; display: flex; gap: 14px; }
.article-content { font-size: 15px; line-height: 1.9; color: #333; }
.article-content p { margin-bottom: 14px; }

/* ------------------------------------------------------------------ 空态 / 提示 */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ico { font-size: 46px; opacity: .35; }
.empty h4 { margin: 12px 0 6px; color: var(--text-2); }

.alert { border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.alert-error { background: #fff1f0; border: 1px solid #ffa39e; color: #cf1322; }
.alert-info { background: #e6f4ff; border: 1px solid #91caff; color: #0958d9; }
.alert-warn { background: #fff7e6; border: 1px solid #ffd591; color: #d46b08; }

.toast-wrap { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { background: #101828; color: #fff; padding: 10px 20px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13px; animation: toastIn .25s ease; }
.toast.ok { background: #16a34a; }
.toast.err { background: #e5484d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ 页脚 */
.footer { background: #101828; color: #94a3b8; margin-top: 30px; padding-top: 40px; font-size: 13px; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 30px; padding-bottom: 30px; }
.footer h5 { color: #fff; font-size: 14px; margin-bottom: 14px; }
.footer a { color: #94a3b8; display: block; padding: 4px 0; }
.footer a:hover { color: #fff; }
.footer .about p { line-height: 1.8; }
.footer .hotline { color: #fff; font-size: 24px; font-weight: 800; margin: 8px 0 4px; }
.footer-bottom { border-top: 1px solid #1f2937; padding: 18px 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #64748b; }

/* ------------------------------------------------------------------ 登录注册 */
.auth-wrap { max-width: 420px; margin: 60px auto; }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.auth-card h2 { text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.auth-tabs a { flex: 1; text-align: center; padding: 10px 0; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; }
.auth-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; }

/* ------------------------------------------------------------------ 公告条 */
.notice-bar {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 14px; padding: 9px 16px; font-size: 13px; overflow: hidden;
}
.notice-bar .nb-tag {
    background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px;
    padding: 2px 10px; border-radius: 4px; flex: 0 0 auto;
}
.notice-bar .nb-list { flex: 1; display: flex; gap: 26px; overflow: hidden; }
.notice-bar .nb-list a { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.notice-bar .nb-list a:hover { color: var(--brand); }
.notice-bar .nb-more { color: var(--muted); flex: 0 0 auto; font-size: 12px; }

/* ------------------------------------------------------------------ 购物车数量徽标（顶栏） */
.header-actions .btn-ghost-mini {
    border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff; font-size: 13px;
}
.header-actions .btn-ghost-mini:hover { border-color: var(--brand); color: var(--brand); }

/* ------------------------------------------------------------------ 库存/货期标签 */
.stock-tag { font-size: 12px; }
.stock-tag.in { color: var(--success); font-weight: 700; }
.stock-tag.low { color: var(--warn); font-weight: 700; }
.stock-tag.out { color: var(--danger); font-weight: 700; }

.pcard-tiers { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ------------------------------------------------------------------ 通用小工具 */
.split { height: 1px; background: var(--line-2); margin: 16px 0; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.link-strong { color: var(--brand); font-weight: 600; }
.panel-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-title .bar { width: 3px; height: 15px; background: var(--brand); border-radius: 2px; }
.scroll-x { overflow-x: auto; }
.footer .about { max-width: 320px; }

/* ------------------------------------------------------------------ 动画 */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 1200px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
    .brand-wall { grid-template-columns: repeat(8, 1fr); }
    .cat-cards { grid-template-columns: repeat(4, 1fr); }
    .hero { grid-template-columns: 200px 1fr 240px; }
    .mega { width: 900px; }
}
@media (max-width: 992px) {
    .hero { grid-template-columns: 1fr; }
    .hero-side, .hero-right { display: none; }
    .hero-slider { aspect-ratio: 1200 / 750; }
    .list-layout { grid-template-columns: 1fr; }
    .detail-top { grid-template-columns: 1fr; }
    .product-grid, .product-grid.col4 { grid-template-columns: repeat(3, 1fr); }
    .brand-wall { grid-template-columns: repeat(5, 1fr); }
    .brand-grid { grid-template-columns: repeat(3, 1fr); }
    .point-grid { grid-template-columns: repeat(3, 1fr); }
    .promise, .stats, .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: repeat(2, 1fr); }
    .account-layout { grid-template-columns: 1fr; }
    .nav-all { width: 150px; }
    .mega { width: calc(100vw - 32px); }
    .nav-links a { padding: 0 12px; font-size: 14px; }
}
@media (max-width: 640px) {
    .header-main { flex-wrap: wrap; gap: 12px; }
    .search-box { order: 3; width: 100%; max-width: none; flex: 0 0 100%; }
    .product-grid, .product-grid.col4, .product-grid.col3 { grid-template-columns: repeat(2, 1fr); }
    .product-grid.col2 { grid-template-columns: 1fr; }
    .cat-cards { grid-template-columns: repeat(2, 1fr); }
    .brand-wall { grid-template-columns: repeat(3, 1fr); }
    .point-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .match-summary { grid-template-columns: repeat(2, 1fr); }
    .nav-links { overflow-x: auto; }
    .detail-title { font-size: 19px; }
    .footer-top { grid-template-columns: 1fr; }
    .topbar-left { display: none; }
}