/* ============ 湛江宇晟贸易有限公司 · 供需平台 ============
   苹果风格配色 + 微软雅黑字体 */
:root {
    --brand: #0071E3;            /* Apple Blue */
    --brand-dark: #0060DF;
    --brand-light: #E8F2FF;
    --green: #34C759;            /* Apple Green */
    --red: #FF3B30;              /* Apple Red */
    --orange: #FF9500;           /* Apple Orange */
    --yellow: #FFCC00;
    --indigo: #5856D6;           /* Apple Indigo */
    --teal: #5AC8FA;             /* Apple Teal */
    --bg: #F5F5F7;               /* Apple 浅灰底 */
    --text: #1D1D1F;             /* Apple 深色文字 */
    --text-2: #6E6E73;           /* Apple 次级文字 */
    --text-3: #86868B;
    --border: #E8E8ED;           /* Apple 细分割线 */
    --card-border: rgba(0, 0, 0, .04);
    --radius: 18px;              /* Apple 大圆角 */
    --radius-sm: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, .06);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, .12);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: .2px;
}

/* ---------- 导航（毛玻璃苹果风） ---------- */
.main-nav {
    background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    box-shadow: none;
}
.main-nav .navbar-brand,
.main-nav .nav-link {
    color: var(--text);
}
.main-nav .nav-link:hover,
.main-nav .nav-link.active {
    color: var(--brand);
}
.admin-nav {
    background: #1D1D1F;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.admin-nav .navbar-brand,
.admin-nav .nav-link {
    color: #f5f5f7;
}
.admin-nav .nav-link:hover,
.admin-nav .nav-link.active {
    color: #0A84FF;
}
.brand-badge {
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    border-radius: 999px;
    padding: .2rem .7rem;
    font-size: .95rem;
}
.brand-text {
    font-weight: 700;
    letter-spacing: .5px;
}
/* ---------- 品牌 LOGO ---------- */
.brand-logo {
    height: 108px;
    width: 108px;
    object-fit: contain;
    border-radius: 8px;
}
.brand-logo-dark {
    opacity: .95;
}
.auth-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
}
.hero-logo-img {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    object-fit: contain;
    background: #fff;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.hero-brand-text {
    min-width: 0;
}
.hero-title {
    white-space: nowrap;
    font-size: 2.2rem;
}
@media (max-width: 1199.98px) {
    .hero-title { font-size: 1.85rem; }
}
@media (max-width: 991.98px) {
    .hero-title { font-size: 1.6rem; white-space: normal; line-height: 1.3; }
    .hero-slogan { white-space: normal; }
}
.hero-slogan {
    white-space: nowrap;
    font-size: 12.5px;
    line-height: 1.4;
}

/* ---------- 手机端（<768px）：首页横幅自适应 ---------- */
@media (max-width: 767.98px) {
    .hero-banner { padding: 1rem 1rem; }
    .hero-brand { gap: .6rem; }
    .hero-logo-img { width: 56px; height: 56px; border-radius: 10px; padding: 4px; box-shadow: 0 3px 10px rgba(0,0,0,.16); }
    .hero-title { white-space: normal; font-size: 1.15rem; line-height: 1.35; }
    .hero-slogan { white-space: normal; font-size: 11px; line-height: 1.55; }
    .hero-banner .btn { font-size: .95rem; padding: .45rem .9rem; }
    .stat-card { padding: .45rem .2rem; }
    .stat-num { font-size: 1.15rem; }
    .stat-lab { font-size: .78rem; }
    .main-nav .brand-text { font-size: .95rem; letter-spacing: 0; }
}

/* ---------- 首页横幅（苹果渐变） ---------- */
.hero-banner {
    background: linear-gradient(135deg, #0A84FF 0%, #0071E3 55%, #5856D6 100%);
    color: #fff;
    padding: 1.4rem 2rem;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}
.hero-banner::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
}
.hero-banner::before {
    content: "";
    position: absolute;
    right: 60px;
    bottom: -100px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
}

.stat-card {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: var(--radius-sm);
    padding: .6rem .3rem;
    color: #fff;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.stat-num {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.25;
}
.stat-lab {
    font-size: .8rem;
    opacity: .9;
}
.stat-card-sm {
    background: #fff;
    border: 1px solid var(--card-border);
    color: var(--text);
    box-shadow: var(--shadow);
    border-radius: var(--radius-sm);
    text-align: center;
}

/* ---------- 分类 Tab ---------- */
.category-tabs .nav-link {
    color: var(--text-2);
    font-weight: 600;
    border-radius: 999px;
    padding: .45rem 1.1rem;
}
.category-tabs .nav-link:hover {
    color: var(--brand);
}
.category-tabs .nav-link.active {
    background: var(--brand);
    color: #fff;
}
.category-tabs .badge {
    background: rgba(0, 0, 0, .10);
    color: inherit;
    font-weight: 600;
}
.category-tabs .nav-link.active .badge {
    background: rgba(255, 255, 255, .3);
}
.type-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 2px;
}
.type-supply { background: var(--green); }
.type-demand { background: #007AFF; }

/* ---------- 产品卡片（苹果卡片） ---------- */
.product-card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover) !important;
}
.product-img-wrap {
    position: relative;
    display: flex;
    gap: 4px;
    padding: 6px 6px 0;
    background: #F2F2F6;
}
.product-img-item {
    flex: 1;
    min-width: 0;
    height: 104px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    font-size: 2rem;
}
.product-badges {
    position: absolute;
    top: .75rem;
    left: .75rem;
    z-index: 2;
    display: flex;
    gap: .35rem;
}
.desc-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    color: var(--text-2);
}

/* ---------- 详情页 ---------- */
.detail-main-img {
    max-height: 460px;
    object-fit: contain;
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
}
.detail-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    opacity: .7;
}
.detail-thumb.active, .detail-thumb:hover {
    border-color: var(--brand);
    opacity: 1;
}
.desc-pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    margin: 0;
}
.thumb-sm {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* ---------- 上传预览 ---------- */
.upload-preview .up-item {
    position: relative;
    width: 92px;
    height: 92px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #F2F2F6;
}
.upload-preview .up-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.upload-preview .up-item .up-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 18px;
    font-size: 12px;
    cursor: pointer;
}
.upload-preview .up-item .up-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 10px;
    text-align: center;
    color: #fff;
    padding: 1px 0;
}
.up-status.ok { background: rgba(52, 199, 89, .88); }
.up-status.fail { background: rgba(255, 59, 48, .88); }
.up-status.loading { background: rgba(0, 122, 255, .88); }

footer.footer {
    border-top: 1px solid var(--border);
    background: #fff;
    margin-top: 2rem;
    color: var(--text-2);
}

/* ---------- Bootstrap 按钮 / 表单统一苹果配色 ---------- */
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
    border-radius: 980px;                 /* Apple 胶囊按钮 */
    font-weight: 600;
    letter-spacing: .3px;
}
.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand);
    --bs-btn-active-border-color: var(--brand);
    border-radius: 980px;
    font-weight: 600;
}
.btn-success {
    --bs-btn-bg: var(--green);
    --bs-btn-border-color: var(--green);
    --bs-btn-hover-bg: #2DB84E;
    --bs-btn-hover-border-color: #2DB84E;
    --bs-btn-active-bg: #2DB84E;
    --bs-btn-active-border-color: #2DB84E;
    border-radius: 980px;
    font-weight: 600;
}
.btn-danger {
    --bs-btn-bg: var(--red);
    --bs-btn-border-color: var(--red);
    --bs-btn-hover-bg: #E62E24;
    --bs-btn-hover-border-color: #E62E24;
    --bs-btn-active-bg: #E62E24;
    --bs-btn-active-border-color: #E62E24;
    border-radius: 980px;
    font-weight: 600;
}
.btn-warning {
    --bs-btn-bg: var(--orange);
    --bs-btn-border-color: var(--orange);
    --bs-btn-hover-bg: #E08600;
    --bs-btn-hover-border-color: #E08600;
    --bs-btn-active-bg: #E08600;
    --bs-btn-active-border-color: #E08600;
    color: #fff;
    border-radius: 980px;
    font-weight: 600;
}
.btn-info {
    --bs-btn-bg: var(--teal);
    --bs-btn-border-color: var(--teal);
    --bs-btn-hover-bg: #4BB8E8;
    --bs-btn-hover-border-color: #4BB8E8;
    --bs-btn-active-bg: #4BB8E8;
    --bs-btn-active-border-color: #4BB8E8;
    color: #fff;
    border-radius: 980px;
    font-weight: 600;
}
.btn-secondary {
    border-radius: 980px;
    font-weight: 600;
}
.btn-outline-secondary {
    border-radius: 980px;
}
.btn-sm { border-radius: 980px; }

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    font-family: inherit;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, .25);
}

/* 卡片 / 面板 通用 */
.card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}
.list-group-item {
    border-color: var(--border);
}

/* 徽章：苹果圆角 */
.badge {
    border-radius: 999px;
    font-weight: 600;
}
.bg-success { background-color: var(--green) !important; }
.bg-danger { background-color: var(--red) !important; }
.bg-warning { background-color: var(--orange) !important; }
.bg-info { background-color: var(--teal) !important; }
.bg-primary { background-color: var(--brand) !important; }
.text-primary { color: var(--brand) !important; }

/* 状态徽章（text-bg-*）：统一为苹果配色，白字保证对比度 */
.badge.text-bg-warning { background-color: var(--orange) !important; color: #fff !important; }
.badge.text-bg-success { background-color: var(--green) !important; color: #fff !important; }
.badge.text-bg-danger { background-color: var(--red) !important; color: #fff !important; }
.badge.text-bg-secondary { background-color: #8E8E93 !important; color: #fff !important; }

/* 统计/文字色：苹果色并保证白底可读（覆盖 Bootstrap 黄/青等低对比原色） */
.text-warning { color: #C93400 !important; }
.text-info { color: var(--brand) !important; }
.text-success { color: var(--green) !important; }
.text-danger { color: var(--red) !important; }

/* 表格 */
.table {
    --bs-table-hover-bg: #F5F5F7;
}
.table thead th {
    color: var(--text-2);
    font-weight: 600;
    border-bottom-color: var(--border);
}
.table td, .table th {
    border-color: var(--border);
}

/* 页脚版权 */
.footer small {
    color: var(--text-3);
}

/* ============ 分类分栏（Categories chips） ============ */
.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cat-chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid #d1d1d6;
  background: #fff;
  color: #495057;
  font-size: 14px;
  text-decoration: none;
  transition: all .15s;
}
.cat-chips .chip:hover { border-color: #0071E3; color: #0071E3; }
.cat-chips .chip.chip-active {
  background: #0071E3;
  border-color: #0071E3;
  color: #fff;
  font-weight: 600;
}
.cat-chips .chip .chip-count {
  background: #e9ecef;
  color: #6c757d;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
}
.cat-chips .chip.chip-active .chip-count { background: rgba(255,255,255,.25); color: #fff; }

/* 访问统计条（首页底端） */
.visit-stats {
  max-width: 1200px;
  margin: 28px auto 40px;
  padding: 0 12px;
}
.visit-stats-inner {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  background: #fefefe;
  border: 1px solid #e5e9f0;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14px;
}
.visit-stat { color: #6c757d; }
.visit-stat b { color: #0071E3; font-size: 16px; }
.visit-stat-link {
  text-decoration: none;
  color: #0071E3;
  font-weight: 600;
}
.visit-stat-link:hover { text-decoration: underline; }

/* 管理员待审核提示条 */
.admin-pending-bar {
  max-width: 1200px;
  margin: 0 auto 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.admin-pending-card {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}
.admin-pending-card:hover { filter: brightness(0.95); text-decoration: none; }
.admin-pending-card .num { font-size: 24px; font-weight: 700; }
.apc-user { background: linear-gradient(135deg, #ff9500, #ff6b00); }
.apc-product { background: linear-gradient(135deg, #0071E3, #0d6efd); }

/* 导航栏待审核小徽标（管理后台右边） */
.nav-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  vertical-align: 1px;
}

/* 导航栏待审核小徽标（管理后台旁：会员/发布 分开、可点击） */
.nav-badge-link {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 11px;
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav-badge-link:hover { color: #fff !important; filter: brightness(0.9); text-decoration: none; }
.nav-badge-user { background: #ff6b00; }
.nav-badge-prod { background: #0071E3; }

/* 首页公告栏 */
.announce-bar { background: #fff; }
.announce-bar .announce-item {
  display: inline-flex;
  align-items: center;
  color: #1D1D1F;
  font-size: 13px;
  text-decoration: none;
  padding: 2px 10px 2px 6px;
  border-radius: 14px;
  background: #f5f7fa;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.announce-bar .announce-item:hover { color: #0071E3; background: #e8f1ff; }
.announce-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ff6b00; margin-right: 6px; flex: none;
}
