/* =====================================================================
   Vehuan Mall — base.css 设计系统（SPEC 第 7 节，法律级）
   白底 + 科技蓝主色 + 金点缀 + 深空 hero；禁用靛蓝/紫色。
   ===================================================================== */

:root {
  /* 色板 */
  --c-primary: #0E6BB8;
  --c-primary-deep: #083E6E;
  --c-primary-soft: #E8F3FC;
  --c-accent: #F2B024;
  --c-accent-soft: #FFF6E0;
  --c-ink: #12233B;
  --c-body: #5A6B84;
  --c-muted: #8A9BB3;
  --c-bg: #F6F8FB;
  --c-surface: #FFFFFF;
  --c-line: #E3E9F2;
  --c-success: #189A61;
  --c-danger: #E04B4B;
  --c-warn: #E8922C;
  --c-info: #4A90D9;
  --c-night: #0B1B33;

  /* 字体 */
  --font-sans: 'PingFang TC','Noto Sans TC','Microsoft JhengHei','Hiragino Sans GB',system-ui,sans-serif;
  --font-mono: 'JetBrains Mono',Consolas,monospace;

  /* 圆角 / 阴影 / 过渡 */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 999px;
  --sh-sm: 0 1px 3px rgba(18,35,59,.08);
  --sh-md: 0 6px 18px rgba(18,35,59,.10);
  --sh-lg: 0 16px 40px rgba(18,35,59,.14);
  --t: .2s ease;

  /* 容器 */
  --container: 1280px;
}

/* ---------------- Reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-body);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5 { color: var(--c-ink); font-weight: 700; margin: 0 0 .5em; line-height: 1.35; }
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
a { color: var(--c-primary); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--c-primary-deep); }
img { max-width: 100%; display: block; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
hr { border: 0; border-top: 1px solid var(--c-line); margin: 1.5rem 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---------------- 容器 / 网格 ---------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.flex { display: flex; gap: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.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; }
.text-muted { color: var(--c-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ---------------- 图片规范（硬项） ---------------- */
.img-responsive { width: 100%; height: auto; display: block; }
.img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.ratio { position: relative; overflow: hidden; background: var(--c-line); border-radius: var(--r-sm); }
.ratio-1x1 { aspect-ratio: 1 / 1; }
.ratio-4x3 { aspect-ratio: 4 / 3; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio .img-cover { position: absolute; inset: 0; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; line-height: 1.4;
  border: 1px solid transparent; transition: all var(--t);
  background: var(--c-surface); color: var(--c-ink);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--c-primary); border-color: var(--c-line); }
.btn-ghost:hover { background: var(--c-primary-soft); color: var(--c-primary-deep); }
.btn-outline { background: #fff; color: var(--c-primary); border-color: var(--c-primary); }
.btn-outline:hover { background: var(--c-primary); color: #fff; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--t), transform var(--t);
}
.card.hover:hover { box-shadow: var(--sh-md); transform: translateY(-3px); }
.card-title { font-size: 16px; font-weight: 700; color: var(--c-ink); margin-bottom: 12px; }

/* ---------------- 表单 ---------------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--c-ink); font-weight: 600; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--c-line); border-radius: var(--r-sm);
  background: #fff; color: var(--c-ink);
  transition: border-color var(--t), box-shadow var(--t);
}
.form-control:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.form-control.is-invalid { border-color: var(--c-danger); }
.form-error { font-size: 12px; color: var(--c-danger); margin-top: 4px; }
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6B84' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { display: none; }
.switch .slider {
  position: absolute; inset: 0; background: var(--c-line);
  border-radius: var(--r-full); transition: var(--t);
}
.switch .slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: var(--t);
}
.switch input:checked + .slider { background: var(--c-primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------------- 徽章 / 标签 ---------------- */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; line-height: 1.6;
}
.badge-primary { background: var(--c-primary-soft); color: var(--c-primary); }
.badge-accent { background: var(--c-accent-soft); color: #9A6B00; }
.badge-success { background: rgba(24,154,97,.12); color: var(--c-success); }
.badge-danger { background: rgba(224,75,75,.12); color: var(--c-danger); }
.badge-warn { background: rgba(232,146,44,.14); color: var(--c-warn); }
.badge-muted { background: var(--c-line); color: var(--c-body); }

.tag {
  display: inline-block; padding: 4px 10px; margin: 0 6px 6px 0;
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-full); font-size: 12px; color: var(--c-body);
}
.tag:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r-sm); overflow: hidden; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--c-line); }
.table th { background: var(--c-bg); color: var(--c-ink); font-weight: 600; font-size: 13px; }
.table tr:hover td { background: #FAFCFE; }

/* ---------------- Toast / Modal ---------------- */
#toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--c-ink); color: #fff; padding: 12px 18px;
  border-radius: var(--r-sm); box-shadow: var(--sh-lg);
  font-size: 14px; min-width: 240px;
  animation: toast-in .25s ease;
}
.toast.success { background: var(--c-success); }
.toast.error { background: var(--c-danger); }
.toast.warn { background: var(--c-warn); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.modal-mask {
  position: fixed; inset: 0; background: rgba(11,27,51,.55);
  display: flex; align-items: center; justify-content: center; z-index: 9998;
  animation: fade-in .2s ease;
}
.modal {
  background: #fff; border-radius: var(--r-md); padding: 24px;
  width: 90%; max-width: 480px; box-shadow: var(--sh-lg);
  animation: modal-in .2s ease;
}
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- 骨架屏 ---------------- */
.skeleton { background: linear-gradient(90deg, var(--c-line) 25%, #EEF2F8 50%, var(--c-line) 75%); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: var(--r-sm); }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-line); margin-bottom: 16px; }
.tab { padding: 10px 16px; cursor: pointer; color: var(--c-body); font-weight: 600; border-bottom: 2px solid transparent; }
.tab.active { color: var(--c-primary); border-color: var(--c-primary); }

/* ---------------- 下拉菜单 ---------------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: 100%; right: 0; background: #fff;
  border: 1px solid var(--c-line); border-radius: var(--r-sm);
  box-shadow: var(--sh-md); min-width: 160px; padding: 6px; display: none; z-index: 100;
}
.dropdown:hover .dropdown-menu, .dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--c-ink); font-size: 14px; }
.dropdown-menu a:hover { background: var(--c-primary-soft); color: var(--c-primary-deep); }

/* ---------------- 分页 ---------------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line); border-radius: var(--r-sm);
  background: #fff; color: var(--c-ink); font-size: 14px;
}
.pagination a:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pagination .active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------------- Hero（深空渐变 + 科技网格） ---------------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #0B1B33 0%, #123A66 55%, #0E6BB8 100%);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.hero-inner { position: relative; padding: 72px 0; }
.hero h1 { color: #fff; font-size: 40px; letter-spacing: 1px; }
.hero p { color: rgba(255,255,255,.85); font-size: 17px; max-width: 560px; }
.hero .btn-primary { background: var(--c-accent); color: var(--c-ink); }
.hero .btn-primary:hover { background: #FFC24A; color: var(--c-ink); }

/* ---------------- 商品卡 ---------------- */
.product-card {
  background: #fff; border: 1px solid var(--c-line);
  border-radius: var(--r-md); overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--sh-md); transform: translateY(-3px); }
.product-card .thumb { aspect-ratio: 1 / 1; background: var(--c-bg); overflow: hidden; position: relative; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t); }
.product-card:hover .thumb img { transform: scale(1.05); }
.product-card .body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.product-card .name {
  font-size: 14px; color: var(--c-ink); font-weight: 600;
  margin-bottom: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .price-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.product-card .price { color: var(--c-danger); font-weight: 700; font-size: 17px; }
.product-card .moq { font-size: 12px; color: var(--c-muted); }
.product-card .badge-wrap { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; }

/* ---------------- 后台（深色侧栏） ---------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px; background: var(--c-night); color: #cdd7e5;
  padding: 20px 0; flex-shrink: 0;
}
.admin-sidebar .brand { color: #fff; font-weight: 700; font-size: 18px; padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: #cdd7e5; font-size: 14px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-sidebar .group-title { padding: 14px 20px 6px; font-size: 12px; color: #7c8da6; letter-spacing: 1px; }
.admin-main { flex: 1; background: var(--c-bg); display: flex; flex-direction: column; }
.admin-topbar {
  background: #fff; padding: 12px 24px;
  border-bottom: 1px solid var(--c-line);
  display: flex; justify-content: space-between; align-items: center;
}
.admin-content { padding: 24px; flex: 1; }

/* 统计卡 */
.stat-card { background: #fff; border-radius: var(--r-md); padding: 20px; box-shadow: var(--sh-sm); }
.stat-card .num { font-size: 28px; font-weight: 800; color: var(--c-ink); }
.stat-card .label { font-size: 13px; color: var(--c-muted); }

/* 纯 CSS 条形图 */
.css-bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding: 10px 0; }
.css-bar-chart .bar { flex: 1; background: linear-gradient(180deg, var(--c-primary), #4A90D9); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; }
.css-bar-chart .bar span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--c-muted); }
.css-bar-chart .bar em { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 11px; font-style: normal; color: var(--c-ink); }

/* ---------------- 响应式断点 ---------------- */
@media (max-width: 1199px) {
  .grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 32px; }
}
@media (max-width: 991px) {
  .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar { width: 64px; }
  .admin-sidebar .brand, .admin-sidebar a span, .admin-sidebar .group-title { display: none; }
}
@media (max-width: 767px) {
  .hero-inner { padding: 48px 0; }
  .hero h1 { font-size: 26px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
  body { font-size: 14px; }
  .container { padding: 0 14px; }
  .grid { gap: 12px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .grid.cols-5 { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 22px; }
  .btn { padding: 8px 14px; font-size: 13px; }
}

/* ---------------- 提示条 Alert（与 Toast 同设计语言） ---------------- */
.alert {
  padding: 12px 16px; border-radius: var(--r-sm);
  font-size: 14px; line-height: 1.6;
  border: 1px solid transparent; margin-bottom: 16px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert-success { background: rgba(24,154,97,.10); color: #0E6B44; border-color: rgba(24,154,97,.25); }
.alert-danger  { background: rgba(224,75,75,.08);  color: #A83232; border-color: rgba(224,75,75,.25); }
.alert-warning{ background: rgba(232,146,44,.10); color: #8A5A14; border-color: rgba(232,146,44,.30); }
.alert-info    { background: rgba(14,107,184,.08); color: var(--c-primary-deep); border-color: rgba(14,107,184,.20); }
.alert strong { font-weight: 700; margin-right: 4px; }

/* ---------------- 物流轨迹时间线 ---------------- */
.track-timeline {
  position: relative; padding-left: 28px; margin: 16px 0;
}
.track-timeline::before {
  content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px;
  width: 2px; background: var(--c-line);
}
.track-timeline .track-node {
  position: relative; padding: 0 0 18px 0;
}
.track-timeline .track-node::before {
  content: ''; position: absolute; left: -25px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--c-muted);
}
.track-timeline .track-node.latest::before {
  background: var(--c-primary); border-color: var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-primary-soft);
}
.track-timeline .track-time {
  font-size: 12px; color: var(--c-muted); font-family: var(--font-mono);
}
.track-timeline .track-event {
  font-size: 14px; color: var(--c-ink); margin-top: 2px;
}
.track-timeline .track-node.latest .track-event {
  font-weight: 600; color: var(--c-primary-deep);
}

/* ---------------- 博客富文本正文 .article-body ---------------- */
.article-body { font-size: 15px; line-height: 1.8; color: var(--c-ink); word-break: break-word; }
.article-body > *:first-child { margin-top: 0; }
/* 图片自适应 + 居中 */
.article-body img { max-width: 100%; height: auto; display: block; margin: 12px auto; border-radius: 8px; }
.article-body .blog-center { text-align: center; }
.article-body .blog-center img { margin-left: auto; margin-right: auto; }
/* 文字链接颜色 */
.article-body a.blog-link { color: #1a4fd8; text-decoration: underline; }
.article-body a.blog-link-red { color: #d32f2f; text-decoration: underline; }
/* 图片链接：链接一闪闪跳动 */
.article-body a.blog-img-link { display: inline-block; position: relative; line-height: 0; }
.article-body a.blog-img-link img { margin: 0; }
.article-body a.blog-img-link::after {
  content: '▶ 查看 ↗'; position: absolute; right: 10px; top: 10px;
  background: rgba(0,0,0,.60); color: #fff; font-size: 13px; line-height: 1;
  padding: 7px 11px; border-radius: 6px; letter-spacing: .5px;
  animation: blogFlash 1.1s ease-in-out infinite;
}
@keyframes blogFlash { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
/* 标题 / 列表 / 表格 / 引用 / 强调 */
.article-body h2 { font-size: 22px; margin: 20px 0 10px; line-height: 1.4; }
.article-body h3 { font-size: 18px; margin: 16px 0 8px; line-height: 1.4; }
.article-body h4 { font-size: 16px; margin: 14px 0 6px; }
.article-body ul, .article-body ol { padding-left: 24px; margin: 10px 0; }
.article-body li { margin: 3px 0; }
.article-body big { font-size: 122%; }
.article-body blockquote {
  border-left: 3px solid var(--c-primary); background: rgba(14,107,184,.06);
  padding: 10px 16px; margin: 12px 0; border-radius: 0 8px 8px 0; color: var(--c-body);
}
.article-body table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.article-body th, .article-body td { border: 1px solid var(--c-line); padding: 7px 10px; font-size: 14px; }
.article-body th { background: var(--c-bg-soft); font-weight: 600; }
.article-body p { margin: 10px 0; }
.article-body a { color: var(--c-primary); }
