/* ============================================================
   QuanHaiGou — 前台主题样式
   浅色系 B2B 外贸风格，支持 RTL（阿拉伯语）与响应式
   主题色由后台「网站配置 → 外观主题」注入 CSS 变量
   ============================================================ */

:root {
    --pri: #0f5fa6;
    --pri-dark: #0b4a83;
    --pri-light: #e8f2fb;
    --accent: #f0a500;
    --dark: #0b1f33;
    --text: #1f2937;
    --text-2: #4b5563;
    --muted: #8a95a5;
    --line: #e5eaf1;
    --bg: #f6f8fb;
    --white: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .12);
    --shadow-hover: 0 4px 12px rgba(16, 24, 40, .08), 0 18px 40px -18px rgba(15, 95, 166, .28);
    --wrap: 1240px;
    --head-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--pri); text-decoration: none; transition: color .18s; }
a:hover { color: var(--pri-dark); }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; color: var(--dark); }
p { margin: 0 0 1em; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- 顶栏 ---------------- */
.topbar {
    background: var(--dark);
    color: #b9c7d6;
    font-size: 13px;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 38px; gap: 16px; }
.topbar a { color: #cdd9e6; }
.topbar a:hover { color: #fff; }
.topbar-left { display: flex; gap: 20px; flex-wrap: wrap; overflow: hidden; white-space: nowrap; }
.topbar-left span { display: inline-flex; align-items: center; gap: 6px; }

.lang-switch { position: relative; }
.lang-switch > button {
    background: transparent; border: 1px solid rgba(255,255,255,.22); color: #dbe6f1;
    padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: 12.5px;
    display: inline-flex; align-items: center; gap: 7px;
}
.lang-switch > button:hover { border-color: rgba(255,255,255,.5); color: #fff; }
.lang-menu {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 168px;
    background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
    padding: 6px; z-index: 60; display: none; max-height: 340px; overflow-y: auto;
}
.lang-switch.open .lang-menu { display: block; }
.lang-menu a {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 12px; border-radius: 7px; color: var(--text); font-size: 13.5px;
}
.lang-menu a:hover { background: var(--pri-light); color: var(--pri); }
.lang-menu a.on { background: var(--pri-light); color: var(--pri); font-weight: 600; }
.lang-menu .code { font-size: 11px; color: var(--muted); text-transform: uppercase; }

/* ---------------- 页头 ---------------- */
.site-head { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-head .wrap { display: flex; align-items: center; gap: 26px; height: var(--head-h); }

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo img { max-height: 44px; width: auto; }
.logo-text { font-size: 19px; font-weight: 800; color: var(--dark); letter-spacing: -.3px; line-height: 1.15; }
.logo-text small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.main-nav > li > a {
    display: block; padding: 8px 13px; border-radius: var(--radius-sm);
    color: var(--text); font-weight: 500; font-size: 14.5px; white-space: nowrap;
}
.main-nav > li > a:hover, .main-nav > li.active > a { background: var(--pri-light); color: var(--pri); }

.has-sub { position: relative; }
.sub-menu {
    position: absolute; top: 100%; inset-inline-start: 0; min-width: 220px; background: #fff;
    border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .18s; z-index: 55;
}
.has-sub:hover .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.sub-menu a { display: block; padding: 8px 12px; border-radius: 7px; color: var(--text-2); font-size: 14px; }
.sub-menu a:hover { background: var(--pri-light); color: var(--pri); }

.head-tools { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.head-search { position: relative; }
.head-search input {
    width: 190px; padding: 9px 38px 9px 14px; border: 1px solid var(--line);
    border-radius: 999px; background: var(--bg); outline: none; transition: .18s; font-size: 14px;
}
.head-search input:focus { width: 240px; border-color: var(--pri); background: #fff; }
.head-search button {
    position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--muted); padding: 6px; line-height: 1;
}
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; background: var(--pri); color: #fff; border-radius: 999px; font-size: 14px; font-weight: 500; }
.cart-btn:hover { background: var(--pri-dark); color: #fff; }
.cart-btn .badge {
    background: var(--accent); color: #3a2a00; font-size: 11.5px; font-weight: 700;
    min-width: 19px; height: 19px; border-radius: 999px; display: inline-flex;
    align-items: center; justify-content: center; padding: 0 5px;
}
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); width: 40px; height: 38px; cursor: pointer; color: var(--text); }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 24px; border-radius: 999px; border: 1px solid transparent;
    background: var(--pri); color: #fff; font-size: 14.5px; font-weight: 600;
    cursor: pointer; transition: all .18s; text-align: center; white-space: nowrap;
}
.btn:hover { background: var(--pri-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #3a2a00; }
.btn-accent:hover { background: #d99400; color: #3a2a00; }
.btn-ghost { background: #fff; color: var(--pri); border-color: #cfdeee; }
.btn-ghost:hover { background: var(--pri-light); color: var(--pri); }
.btn-outline { background: transparent; color: var(--pri); border-color: var(--pri); }
.btn-outline:hover { background: var(--pri); color: #fff; }
.btn-sm { padding: 7px 15px; font-size: 13.5px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }

/* ---------------- 轮播 ---------------- */
.hero { position: relative; background: var(--dark); overflow: hidden; }
.hero-slide { display: none; position: relative; }
.hero-slide.on { display: block; }
.hero-slide img { width: 100%; height: 460px; object-fit: cover; }
.hero-slide::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(8,25,42,.86) 0%, rgba(8,25,42,.55) 48%, rgba(8,25,42,.12) 100%);
}
.hero-caption {
    position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%);
    z-index: 2; width: 100%;
}
.hero-caption .inner { max-width: 560px; color: #fff; }
.hero-caption h1 { color: #fff; font-size: 40px; line-height: 1.2; margin-bottom: 14px; }
.hero-caption p { font-size: 16.5px; color: #cddbe9; margin-bottom: 26px; }
.hero-caption .btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-dots { position: absolute; bottom: 22px; inset-inline-start: 50%; transform: translateX(-50%); display: flex; gap: 9px; z-index: 3; }
.hero-dots button {
    width: 10px; height: 10px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,.42); padding: 0;
}
.hero-dots button.on { background: #fff; width: 26px; border-radius: 999px; }
.hero-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,.14); color: #fff; font-size: 20px; line-height: 1;
    backdrop-filter: blur(4px);
}
.hero-nav:hover { background: rgba(255,255,255,.3); }
.hero-nav.prev { inset-inline-start: 20px; }
.hero-nav.next { inset-inline-end: 20px; }

/* ---------------- 通用区块 ---------------- */
.section { padding: 60px 0; }
.section.alt { background: #fff; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 40px; }
.section-head h2 { font-size: 28px; margin-bottom: 10px; }
.section-head p { color: var(--muted); margin: 0; font-size: 15px; }
.section-head.left { text-align: start; margin-inline-start: 0; }

/* 优势卡片 */
.usp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.usp { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; transition: .2s; }
.usp:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.usp .ico {
    width: 46px; height: 46px; border-radius: 12px; background: var(--pri-light); color: var(--pri);
    display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 14px;
}
.usp h3 { font-size: 16.5px; margin-bottom: 7px; }
.usp p { color: var(--text-2); font-size: 14px; margin: 0; }

/* 数据条 */
.stats { background: var(--dark); color: #fff; padding: 44px 0; }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stats .num { font-size: 34px; font-weight: 800; color: #fff; line-height: 1.1; }
.stats .num span { color: var(--accent); }
.stats .lbl { color: #9fb2c6; font-size: 13.5px; margin-top: 5px; }

/* 分类宫格 */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cat-card {
    position: relative; border-radius: var(--radius); overflow: hidden; background: #fff;
    border: 1px solid var(--line); transition: .2s; min-height: 168px;
    display: flex; flex-direction: column; justify-content: flex-end;
}
.cat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.cat-card .bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .16; }
.cat-card .body { position: relative; padding: 22px; }
.cat-card h3 { font-size: 17px; margin-bottom: 4px; }
.cat-card p { color: var(--muted); font-size: 13px; margin: 0; }

/* 商品卡片 */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.pcard {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; transition: .2s;
}
.pcard:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.pcard-thumb { position: relative; display: block; aspect-ratio: 4/3; background: #f1f4f8; overflow: hidden; }
.pcard-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.pcard:hover .pcard-thumb img { transform: scale(1.05); }
.pcard-tags { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag-pill { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: #3a2a00; }
.tag-pill.n { background: #12885a; color: #fff; }
.tag-pill.h { background: #c0392b; color: #fff; }
.pcard-body { padding: 16px 16px 18px; display: flex; flex-direction: column; flex: 1; }
.pcard-body h3 { font-size: 15px; margin-bottom: 6px; }
.pcard-body h3 a { color: var(--dark); }
.pcard-body h3 a:hover { color: var(--pri); }
.pcard-sku { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.pcard-sum { font-size: 13px; color: var(--text-2); margin: 0 0 14px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.price { font-size: 18px; font-weight: 800; color: #c0392b; line-height: 1.2; }
.price small { font-size: 11.5px; color: var(--muted); font-weight: 500; display: block; }
.price .old { font-size: 13px; color: var(--muted); text-decoration: line-through; font-weight: 500; margin-inline-start: 6px; }
.price-ask { font-size: 15px; font-weight: 700; color: var(--pri); }
.pcard-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* 侧栏 + 列表布局 */
.layout { display: grid; grid-template-columns: 268px 1fr; gap: 28px; align-items: start; }
.sidebar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: calc(var(--head-h) + 16px); }
.side-block + .side-block { border-top: 1px solid var(--line); }
.side-block h4 { padding: 15px 18px; font-size: 14.5px; background: #fafcfe; border-bottom: 1px solid var(--line); }
.side-block .body { padding: 14px 18px; }
.cat-list a {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 9px 0; color: var(--text-2); font-size: 14px; border-bottom: 1px dashed var(--line);
}
.cat-list li:last-child a { border-bottom: none; }
.cat-list a:hover, .cat-list a.on { color: var(--pri); font-weight: 600; }
.cat-list .cnt { font-size: 12px; color: var(--muted); background: var(--bg); padding: 1px 8px; border-radius: 999px; }
.filter-form .row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.filter-form input[type=text], .filter-form input[type=number] {
    width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: #fbfcfe; outline: none; font-size: 14px;
}
.filter-form input:focus { border-color: var(--pri); background: #fff; }

.toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 18px; margin-bottom: 20px; flex-wrap: wrap;
}
.toolbar .count { font-size: 14px; color: var(--text-2); }
.toolbar select {
    padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: #fbfcfe; outline: none; font-size: 14px; min-width: 168px;
}
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .ico { font-size: 46px; opacity: .35; margin-bottom: 14px; }

/* 面包屑 */
.crumb { padding: 16px 0; font-size: 13px; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--pri); }
.crumb .sep { margin: 0 7px; opacity: .6; }
.crumb .cur { color: var(--text-2); }

/* 分页 */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.pagination .page-item a, .pagination .page-item span {
    min-width: 38px; height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: #fff; color: var(--text-2);
    display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
.pagination .page-item a:hover { border-color: var(--pri); color: var(--pri); }
.pagination .page-item.active a, .pagination .page-item.active span { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.pagination .page-item.disabled span { opacity: .45; }
.page-ellipsis span { border: none; background: none; }

/* ---------------- 商品详情 ---------------- */
.pd { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: start; }
.pd-gallery .main { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; aspect-ratio: 1/1; }
.pd-gallery .main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pd-thumbs button { width: 74px; height: 74px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; cursor: pointer; }
.pd-thumbs button.on { border-color: var(--pri); box-shadow: 0 0 0 2px rgba(15,95,166,.14); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.pd-info h1 { font-size: 26px; margin-bottom: 12px; }
.pd-sub { color: var(--text-2); font-size: 14.5px; }
.pd-price-box { background: linear-gradient(180deg, #fbfdff, #f3f8fd); border: 1px solid #dbe8f4; border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.pd-price-box .price { font-size: 30px; }
.pd-price-box .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.pd-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin: 16px 0 20px; font-size: 14px; }
.pd-quick .k { color: var(--muted); }
.pd-quick .v { color: var(--text); font-weight: 600; }
.pd-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty-box button { width: 38px; height: 42px; border: none; background: none; cursor: pointer; font-size: 18px; color: var(--text-2); }
.qty-box button:hover { background: var(--pri-light); color: var(--pri); }
.qty-box input { width: 66px; height: 42px; border: none; text-align: center; outline: none; font-weight: 600; }
.pd-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.badge-line { font-size: 12.5px; color: var(--text-2); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; display: inline-flex; gap: 6px; align-items: center; }

.tabs { margin-top: 44px; }
.tabs-head { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs-head button {
    padding: 12px 20px; border: none; background: none; cursor: pointer;
    font-size: 15px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs-head button.on { color: var(--pri); border-bottom-color: var(--pri); }
.tabs-body { background: #fff; border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 28px; }
.tabs-pane { display: none; }
.tabs-pane.on { display: block; }
.rich { color: var(--text-2); font-size: 15px; line-height: 1.85; }
.rich h3 { font-size: 17px; margin: 22px 0 10px; color: var(--dark); }
.rich h3:first-child { margin-top: 0; }
.rich ul, .rich ol { margin: 0 0 16px; padding-inline-start: 22px; list-style: disc; }
.rich ol { list-style: decimal; }
.rich li { margin-bottom: 6px; }
.rich img { border-radius: var(--radius-sm); margin: 12px 0; }
.rich table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.rich th, .rich td { border: 1px solid var(--line); padding: 9px 12px; text-align: start; }
.rich th { background: #fafcfe; font-weight: 600; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.spec-table th, .spec-table td { border: 1px solid var(--line); padding: 11px 16px; text-align: start; }
.spec-table th { background: #fafcfe; width: 210px; color: var(--text-2); font-weight: 600; }

/* ---------------- 表单 ---------------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field label .req { color: #c0392b; }
.field input, .field select, .field textarea {
    padding: 11px 14px; border: 1px solid #d5dde8; border-radius: var(--radius-sm);
    background: #fbfcfe; outline: none; transition: .16s; color: var(--text); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--pri); background: #fff; box-shadow: 0 0 0 3px rgba(15,95,166,.1);
}
.field textarea { min-height: 118px; resize: vertical; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field .err { font-size: 12.5px; color: #c0392b; margin-top: 5px; }
.field.has-err input, .field.has-err textarea, .field.has-err select { border-color: #e8a9a2; background: #fffafa; }
.checkbox { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin: 3px 0 0; flex-shrink: 0; }
.form-note { font-size: 13px; color: var(--muted); background: var(--pri-light); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* 提示条 */
.flash { display: flex; align-items: flex-start; gap: 11px; padding: 13px 18px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14.5px; border: 1px solid; }
.flash.success { background: #f0fbf5; border-color: #bfe6d1; color: #0e6b47; }
.flash.error { background: #fdf2f1; border-color: #f4c7c3; color: #8f2a20; }
.flash.warning { background: #fffbf0; border-color: #f0e0b6; color: #8a6416; }
.flash.info { background: #eff6fd; border-color: #cfe2f5; color: #13578f; }
.flash .close { margin-inline-start: auto; background: none; border: none; cursor: pointer; color: inherit; opacity: .55; font-size: 17px; line-height: 1; }

/* ---------------- 购物车 / 结算 ---------------- */
.cart-table { width: 100%; border-collapse: collapse; background: #fff; }
.cart-table th, .cart-table td { padding: 15px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.cart-table th { background: #fafcfe; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.cart-row { display: flex; align-items: center; gap: 14px; }
.cart-row img { width: 74px; height: 74px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); flex-shrink: 0; }
.cart-row .t { font-weight: 600; color: var(--dark); font-size: 14.5px; }
.cart-row .s { font-size: 12.5px; color: var(--muted); }
.cart-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.cart-remove:hover { color: #c0392b; }
.summary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.summary h3 { font-size: 16.5px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.summary .line { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14.5px; color: var(--text-2); }
.summary .line.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; font-size: 17px; font-weight: 700; color: var(--dark); }
.summary .line.total .v { color: #c0392b; font-size: 21px; }

.steps-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }
.steps-bar .s { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.steps-bar .s .n { width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; }
.steps-bar .s.on { color: var(--pri); font-weight: 600; }
.steps-bar .s.on .n { background: var(--pri); color: #fff; }
.steps-bar .dash { flex: 1; height: 1px; background: var(--line); min-width: 20px; }

/* ---------------- 会员中心 ---------------- */
.member-wrap { display: grid; grid-template-columns: 232px 1fr; gap: 26px; align-items: start; }
.member-menu { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: sticky; top: calc(var(--head-h) + 16px); }
.member-menu .u { padding: 20px 18px; background: linear-gradient(135deg, var(--pri), #1b7ac4); color: #fff; }
.member-menu .u .n { font-weight: 700; font-size: 15.5px; }
.member-menu .u .e { font-size: 12.5px; opacity: .85; word-break: break-all; }
.member-menu a { display: flex; align-items: center; gap: 10px; padding: 12px 18px; color: var(--text-2); font-size: 14.5px; border-inline-start: 3px solid transparent; }
.member-menu a:hover { background: #fafcfe; color: var(--pri); }
.member-menu a.on { background: var(--pri-light); color: var(--pri); border-inline-start-color: var(--pri); font-weight: 600; }
.member-body { min-width: 0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel + .panel { margin-top: 20px; }
.panel h3 { font-size: 17px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-card .n { font-size: 27px; font-weight: 800; color: var(--pri); line-height: 1.1; }
.stat-card .l { font-size: 13px; color: var(--muted); margin-top: 4px; }
.list-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.list-table th, .list-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: start; }
.list-table th { background: #fafcfe; font-size: 13px; color: var(--text-2); font-weight: 600; }
.list-table tbody tr:hover { background: #fbfdff; }

/* 状态标签 */
.status { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.status.s0 { background: #fff5e6; color: #9a6200; }
.status.s1 { background: #e9f4ff; color: #1461a8; }
.status.s2 { background: #f0ecfd; color: #5b3fc4; }
.status.s3 { background: #e9f7f1; color: #116b48; }
.status.s4 { background: #eef1f5; color: #5b6675; }
.status.s5 { background: #fdeeee; color: #a83226; }

/* 时间线 */
.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content: ''; position: absolute; inset-inline-start: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline .item { position: relative; padding-bottom: 20px; }
.timeline .item::before { content: ''; position: absolute; inset-inline-start: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--pri); }
.timeline .t { font-size: 13.5px; color: var(--muted); }
.timeline .d { font-size: 14px; color: var(--text); }

/* ---------------- 留言板 ---------------- */
.msg-list { display: flex; flex-direction: column; gap: 18px; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.msg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--pri-light); color: var(--pri); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.msg-head .who { font-weight: 700; color: var(--dark); font-size: 14.5px; }
.msg-head .meta { font-size: 12.5px; color: var(--muted); }
.msg-head .subj { font-weight: 600; color: var(--dark); font-size: 15.5px; margin-bottom: 8px; }
.msg-text { color: var(--text-2); font-size: 14.5px; white-space: pre-line; }
.msg-reply { margin-top: 14px; margin-inline-start: 26px; background: #f7fafd; border-inline-start: 3px solid var(--pri); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 14px 18px; }
.msg-reply .r-h { font-size: 13px; font-weight: 700; color: var(--pri); margin-bottom: 6px; }

/* ---------------- 文章 ---------------- */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.acard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .2s; display: flex; flex-direction: column; }
.acard:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.acard .thumb { aspect-ratio: 16/9; background: #eef2f7; overflow: hidden; }
.acard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.acard .body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.acard h3 { font-size: 16px; margin-bottom: 8px; }
.acard h3 a { color: var(--dark); }
.acard h3 a:hover { color: var(--pri); }
.acard p { font-size: 13.5px; color: var(--text-2); flex: 1; margin-bottom: 12px; }
.acard .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; }
.article-detail { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; }
.article-detail h1 { font-size: 28px; margin-bottom: 14px; }
.article-detail .meta { font-size: 13px; color: var(--muted); padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }

/* ---------------- CTA / 订阅 ---------------- */
.cta-band { background: linear-gradient(135deg, var(--pri), #1476c4); border-radius: var(--radius); padding: 40px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; font-size: 24px; margin-bottom: 8px; }
.cta-band p { color: #dbeaf7; margin: 0; font-size: 14.5px; max-width: 620px; }

.newsletter-band { background: var(--dark); color: #fff; padding: 48px 0; }
.newsletter-band .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.newsletter-band h2 { color: #fff; font-size: 22px; margin-bottom: 8px; }
.newsletter-band p { color: #9fb2c6; margin: 0; font-size: 14px; }
.newsletter-form { display: flex; gap: 10px; }
.newsletter-form input {
    flex: 1; padding: 13px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08); color: #fff; outline: none;
}
.newsletter-form input::placeholder { color: #8fa3b8; }
.newsletter-form input:focus { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.14); }

/* ---------------- 页脚 ---------------- */
.site-foot { background: #0d1b2a; color: #93a5b8; padding: 56px 0 0; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 34px; }
.site-foot h4 { color: #fff; font-size: 15px; margin-bottom: 18px; }
.site-foot a { color: #93a5b8; }
.site-foot a:hover { color: #fff; }
.site-foot ul li { margin-bottom: 10px; }
.foot-about p { color: #7e92a8; font-size: 13.5px; line-height: 1.8; }
.foot-contact li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; }
.foot-contact .k { color: #5f7387; }
.social { display: flex; gap: 10px; margin-top: 16px; }
.social a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.08); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.social a:hover { background: var(--pri); color: #fff; }
.foot-links { border-top: 1px solid rgba(255,255,255,.09); margin-top: 44px; padding: 22px 0; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-size: 13px; color: #6f8398; }
.foot-links .fl a { margin-inline-end: 16px; }

/* 返回顶部 */
.to-top {
    position: fixed; inset-inline-end: 26px; bottom: 26px; width: 44px; height: 44px;
    border-radius: 50%; background: var(--pri); color: #fff; border: none; cursor: pointer;
    display: none; align-items: center; justify-content: center; font-size: 18px; z-index: 40;
    box-shadow: 0 6px 18px rgba(15,95,166,.4);
}
.to-top.show { display: flex; }

/* WhatsApp 悬浮 */
.float-wa {
    position: fixed; inset-inline-start: 26px; bottom: 26px; z-index: 40;
    display: inline-flex; align-items: center; gap: 9px; padding: 11px 18px;
    background: #25d366; color: #fff; border-radius: 999px; font-size: 14px; font-weight: 600;
    box-shadow: 0 6px 18px rgba(37,211,102,.4);
}
.float-wa:hover { color: #fff; background: #1eb455; }

/* 图片灯箱 */
.lightbox { position: fixed; inset: 0; background: rgba(8,15,25,.9); z-index: 100; display: none; align-items: center; justify-content: center; padding: 30px; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 92%; max-height: 88vh; border-radius: var(--radius); }
.lightbox .close { position: absolute; top: 22px; inset-inline-end: 26px; background: none; border: none; color: #fff; font-size: 30px; cursor: pointer; line-height: 1; }

/* Toast */
.toast-wrap { position: fixed; top: 20px; inset-inline-end: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--pri);
    border-radius: var(--radius-sm); padding: 13px 18px; box-shadow: var(--shadow);
    font-size: 14px; min-width: 240px; max-width: 360px; animation: toastIn .25s ease;
}
.toast.success { border-inline-start-color: #12885a; }
.toast.error { border-inline-start-color: #c0392b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .usp-grid { grid-template-columns: repeat(2, 1fr); }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .foot-grid { grid-template-columns: 1fr 1fr; }
    .layout { grid-template-columns: 232px 1fr; }
}

@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; }
    .main-nav {
        position: fixed; inset: 0; background: #fff; flex-direction: column; align-items: stretch;
        padding: calc(var(--head-h) + 20px) 20px 30px; gap: 0; overflow-y: auto; z-index: 45;
        display: none; align-items: flex-start;
    }
    body.nav-open .main-nav { display: flex; }
    .main-nav > li { width: 100%; border-bottom: 1px solid var(--line); }
    .main-nav > li > a { padding: 14px 4px; font-size: 16px; }
    .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding: 0 0 10px 14px; }
    .head-search { display: none; }
    .pd { grid-template-columns: 1fr; gap: 26px; }
    .member-wrap { grid-template-columns: 1fr; }
    .member-menu { position: static; }
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .stat-cards { grid-template-columns: 1fr 1fr; }
    .newsletter-band .wrap { grid-template-columns: 1fr; }
    .hero-slide img { height: 340px; }
    .hero-caption h1 { font-size: 27px; }
    .hero-caption p { font-size: 14.5px; }
    .hero-nav { display: none; }
    .stats .wrap { grid-template-columns: 1fr 1fr; gap: 22px; }
    .cart-table thead { display: none; }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
    .cart-table tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
    .cart-table td { border: none; padding: 6px 0; }
}

@media (max-width: 640px) {
    .wrap { padding: 0 15px; }
    .section { padding: 40px 0; }
    .product-grid, .product-grid.cols-3 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .pcard-body { padding: 12px; }
    .pcard-body h3 { font-size: 14px; }
    .price { font-size: 16px; }
    .usp-grid, .cat-grid, .article-grid, .form-grid, .stat-cards { grid-template-columns: 1fr; }
    .foot-grid { grid-template-columns: 1fr; gap: 26px; }
    .hero-slide img { height: 260px; }
    .hero-caption h1 { font-size: 22px; }
    .section-head h2 { font-size: 22px; }
    .cta-band { padding: 26px; }
    .article-detail { padding: 22px; }
    .form-card { padding: 20px; }
    .topbar-left span:nth-child(n+2) { display: none; }
    .float-wa { inset-inline-start: 16px; bottom: 16px; padding: 10px 14px; font-size: 13px; }
    .to-top { inset-inline-end: 16px; bottom: 16px; }
}

/* ---------------- RTL（阿拉伯语） ---------------- */
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .hero-slide::after { background: linear-gradient(270deg, rgba(8,25,42,.86) 0%, rgba(8,25,42,.55) 48%, rgba(8,25,42,.12) 100%); }
[dir="rtl"] .price .old { margin-inline-start: 0; margin-inline-end: 6px; }
[dir="rtl"] .head-search input { padding: 9px 14px 9px 38px; }
[dir="rtl"] .timeline { padding-inline-start: 0; padding-inline-end: 22px; }
[dir="rtl"] .timeline::before { inset-inline-start: auto; inset-inline-end: 5px; }
[dir="rtl"] .timeline .item::before { inset-inline-start: auto; inset-inline-end: -22px; }
[dir="rtl"] .msg-reply { margin-inline-start: 0; margin-inline-end: 26px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-inline-start: none; border-inline-end: 3px solid var(--pri); }
[dir="rtl"] .pagination .page-item span, [dir="rtl"] .pagination .page-item a { direction: rtl; }

/* 打印 */
@media print {
    .site-head, .site-foot, .topbar, .float-wa, .to-top, .hero-nav, .cta-band { display: none !important; }
    body { background: #fff; }
}
