/* 门户补充样式：页脚、频道顶栏、用户中心（主样式沿用 main.css） */
.page-header {
  background: linear-gradient(135deg, var(--page-header-bg-start), var(--page-header-bg-end));
  color: #fff;
  padding: 36px 0;
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.page-header p {
  opacity: 0.9;
  font-size: 14px;
}

.site-footer {
  background: #2C3E50;
  color: #BDC3C7;
  margin-top: 60px;
  padding: 48px 0 20px;
}
.site-footer a { color: #BDC3C7; display: block; margin: 6px 0; }
.site-footer a:hover { color: var(--primary-color); }
.site-footer h4 { color: #fff; margin-bottom: 12px; font-size: 15px; }
.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #405D7A;
}
.site-footer__bottom {
  padding-top: 16px;
  font-size: 13px;
  text-align: center;
}
.header-tool,
.func-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 56px;
  min-height: 64px;
  padding: 0;
  color: #666;
  text-decoration: none;
  font-size: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
}
.header-tool:hover,
.func-item:hover { color: var(--primary-color); }
.header-tool--support {
  position: relative;
  min-width: 56px;
}
.header-tool--support > .header-tool {
  min-height: 64px;
}
.header-tool__icon-wrap,
.func-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  line-height: 1;
  flex-shrink: 0;
  border: 2px solid #ccc;
  border-radius: 50%;
  color: #999;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.2s, color 0.2s;
}
.header-tool:hover .header-tool__icon-wrap,
.func-item:hover .func-icon {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.header-tool__icon {
  width: 28px;
  height: 28px;
  display: block;
}
.header-tool__icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
.header-tool__badge {
  position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--primary-color); color: #fff;
  font-size: 11px; line-height: 16px; text-align: center;
}
.header-tool__avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light);
  color: var(--primary-color); display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.header-tool__label,
.func-text {
  display: block;
  font-size: 13px;
  color: inherit;
  line-height: 1.2;
}

.home-banner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  margin: 20px auto;
}
.home-banner__aside {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.home-banner__aside a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #333;
}
.home-banner__aside a:hover { background: var(--primary-light); color: var(--primary-color); }
.home-banner__slider {
  min-height: 300px;
  border-radius: 8px;
  overflow: hidden;
  background: #eef2f5;
}
.home-banner__slider img { width: 100%; height: 300px; object-fit: cover; display: block; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 16px;
}
.section-title h2 { font-size: 22px; color: #1a1a1a; }
.section-title a { color: var(--primary-color); font-size: 14px; }

.goods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.goods-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.goods-card:hover { transform: translateY(-4px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.goods-card__img { height: 160px; background: #f5f7fa; display:flex; align-items:center; justify-content:center; }
.goods-card__img img { width: 100%; height: 160px; object-fit: cover; }
.goods-card__body { padding: 12px 14px 16px; }
.goods-card__title { font-size: 14px; font-weight: 600; margin-bottom: 6px; height: 40px; overflow: hidden; }
.goods-card__meta { color: #909399; font-size: 12px; margin-bottom: 8px; }
.goods-card__price { color: var(--primary-color); font-size: 18px; font-weight: 700; }

.auth-box {
  max-width: 420px;
  margin: 48px auto;
  background: #fff;
  padding: 32px;
  border-radius: 10px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
.auth-box h1 { font-size: 22px; margin-bottom: 20px; text-align: center; }
.auth-box label { display:block; margin: 12px 0 6px; color:#606266; }
.auth-box input, .auth-box select {
  width: 100%; height: 40px; border: 1px solid #dcdfe6; border-radius: 6px; padding: 0 12px;
}
.auth-box .btn-primary { width: 100%; margin-top: 20px; border: none; cursor: pointer; text-align: center; display:inline-block; }
.auth-error { color: #f56c6c; font-size: 13px; margin-top: 8px; }

/* 旧版用户中心栅格布局已废弃；现行布局见 portal-user.css（.user-layout 全宽顶栏+侧栏） */
.user-side { background:#fff; border-radius:8px; padding:16px; box-shadow:0 2px 12px rgba(0,0,0,.06); }
.user-side a { display:block; padding:10px 12px; border-radius:6px; color:#333; margin-bottom:4px; }
.user-side a.active, .user-side a:hover { background: var(--primary-light); color: var(--primary-color); }
.user-main { background:#fff; border-radius:8px; padding:20px; box-shadow:0 2px 12px rgba(0,0,0,.06); min-height: 420px; }
.stat-row { display:grid; grid-template-columns: repeat(3,1fr); gap:12px; margin-bottom:20px; }
.stat-card { background:#f8fafc; border-radius:8px; padding:16px; }
.stat-card strong { display:block; font-size:24px; color:var(--primary-color); margin-top:6px; }

.table { width:100%; border-collapse: collapse; }
.table th, .table td { border-bottom:1px solid #ebeef5; padding:10px 8px; text-align:left; font-size:13px; }
.table th { background:#fafafa; color:#606266; }

.admin-wrap { min-height:100vh; background:#f0f2f5; }
.admin-top { background:#001529; color:#fff; padding:0 24px; height:56px; display:flex; align-items:center; justify-content:space-between; }
.admin-body { max-width:1200px; margin:24px auto; padding:0 20px; }
.admin-card { background:#fff; border-radius:8px; padding:20px; box-shadow:0 1px 4px rgba(0,0,0,.08); }
.admin-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:20px; }
.admin-table { width:100%; border-collapse:collapse; }
.admin-table th, .admin-table td { border-bottom:1px solid #ebeef5; padding:10px 8px; text-align:left; font-size:13px; vertical-align:middle; }
.admin-table th { background:#fafafa; color:#606266; }
.admin-top a { text-decoration:none; opacity:.9; }
.admin-top a:hover { opacity:1; color:var(--primary-color); }

.portal-toast {
  position: fixed;
  left: 50%;
  top: 72px;
  z-index: 3000;
  transform: translate(-50%, -8px);
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(48, 49, 51, 0.92);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.portal-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 960px) {
  .home-banner, .goods-grid, .site-footer__cols, .admin-stats, .stat-row { grid-template-columns: 1fr 1fr; }
  .home-banner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .goods-grid, .site-footer__cols, .admin-stats, .stat-row { grid-template-columns: 1fr; }
}

/* ===== 对齐 Nuxt 首页的旧样式已迁至 portal-home.css；此处仅保留非首页增强 ===== */
/* （banner-box / category-mega / quick-links / footer 以 portal-home.css 为准） */

/* 顶栏增强 */
.header-icon-btn {
  display: none; border: 0; background: transparent; cursor: pointer; color: #303133; padding: 6px;
}
.header-search-history {
  position: absolute; left: 0; right: 60px; top: calc(100% + 4px);
  background: #fff; border: 1px solid #ebeef5; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08); z-index: 20; padding: 8px 0;
}
.header-search-wrap { position: relative; }
.header-search-history__head {
  display: flex; justify-content: space-between; padding: 4px 12px 8px; color: #909399; font-size: 12px;
}
.header-search-history__clear { border: 0; background: none; color: var(--primary-color); cursor: pointer; }
.header-search-history__item { display: flex; align-items: center; }
.header-search-history__query {
  flex: 1; border: 0; background: none; text-align: left; padding: 8px 12px; cursor: pointer;
}
.header-search-history__query:hover { background: #f5f7fa; }
.header-search-history__remove { border: 0; background: none; color: #c0c4cc; padding: 0 12px; cursor: pointer; }
.header-tool--support { position: relative; }
.header-support-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px;
  background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 14px; z-index: 30;
}
.header-support-item { margin-bottom: 10px; font-size: 13px; }
.header-support-item__label { display: block; color: #909399; margin-bottom: 4px; }
.header-support-item__value { color: var(--primary-color); font-weight: 600; text-decoration: none; }
.header-support-qr { width: 120px; height: 120px; object-fit: contain; }
.header-support-chat {
  width: 100%; border: 0; border-radius: 6px; background: var(--primary-color); color: #fff;
  height: 36px; cursor: pointer; margin-top: 4px;
}
.header-user-menu { position: relative; }
.header-user-dropdown {
  display: none; position: absolute; right: 0; top: 100%; min-width: 140px;
  background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px 0; z-index: 30;
}
.header-user-menu:hover .header-user-dropdown { display: block; }
.header-user-dropdown a, .header-user-dropdown button {
  display: block; width: 100%; text-align: left; padding: 8px 14px; border: 0; background: none;
  color: #303133; font-size: 13px; cursor: pointer; text-decoration: none;
}
.header-user-dropdown a:hover, .header-user-dropdown button:hover { background: #f5f7fa; color: var(--primary-color); }
.header-mobile-drawer { position: fixed; inset: 0; z-index: 2000; }
.header-mobile-drawer__mask { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.header-mobile-drawer__panel {
  position: absolute; top: 0; right: 0; width: min(86vw, 320px); height: 100%;
  background: #fff; padding: 16px; overflow: auto;
}
.header-mobile-nav a { display: block; padding: 12px 4px; border-bottom: 1px solid #f0f0f0; color: #303133; }
.header-mobile-entries {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.header-mobile-entries a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e4e7ed;
  border-radius: 16px;
  color: #606266;
  font-size: 13px;
  text-decoration: none;
  background: #f5f7fa;
}
.header-mobile-entries a:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
}
.header-mobile-service {
  margin: 14px 0 8px;
  padding: 10px 12px;
  background: #f5f7fa;
  border-radius: 8px;
  color: #666;
  font-size: 14px;
}
.header-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.header-mobile-actions__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  color: #303133;
  text-decoration: none;
  font-size: 13px;
}
.header-mobile-actions__btn--primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

@media (max-width: 992px) {
  .header-icon-btn { display: inline-flex; }
  .header-nav { display: none; }
  .header-search-wrap,
  .header-tools { display: none; }
  .header-top__inner {
    justify-content: space-between;
    min-height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .logo-img {
    height: 44px;
    max-width: min(240px, 58vw);
  }
}

/* 返回顶部漂浮按钮（首页 / 搜索页） */
.portal-back-top {
  position: fixed;
  right: 16px;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 1210;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid #ebeef5;
  border-radius: 50%;
  background: #fff;
  color: #606266;
  box-shadow: 0 8px 24px rgba(31, 45, 61, 0.14);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, opacity 0.2s ease, transform 0.2s ease;
}
.portal-back-top[hidden] {
  display: none !important;
}
.portal-back-top:hover {
  color: var(--primary-color, #e83500);
  background: #fff8f5;
  border-color: #f5c2b2;
}
.portal-back-top__text {
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
}
/* 与右侧浮动栏并存时上移，避免叠住 */
body:has(#inv-float-dock) .portal-back-top {
  bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 768px) {
  .portal-back-top {
    right: 10px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
  }
  body:has(#inv-float-dock) .portal-back-top {
    bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }
}
