/* ========================================
   圆梦海淘 - 顾客中心样式
   ======================================== */

:root {
  --color-warm-white: #F7F4EE;
  --color-deep-ink: #17202A;
  --color-vermilion: #C94A3A;
  --color-pine-green: #2F6F62;
  --color-bg: var(--color-warm-white);
  --color-surface: #FFFFFF;
  --color-text: var(--color-deep-ink);
  --color-text-muted: #6B7280;
  --color-border: #E5E1D8;
  --color-border-light: #F0EDE6;
  --color-primary: var(--color-pine-green);
  --color-primary-hover: #245249;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic Pro", "Yu Gothic", "Meiryo", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(23, 32, 42, 0.06);
  --shadow-md: 0 2px 8px rgba(23, 32, 42, 0.08);
  --shadow-lg: 0 4px 16px rgba(23, 32, 42, 0.10);
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --container-max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- 导航栏 ---- */
.portal-navbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.portal-navbar-inner {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 1rem;
}
.brand-wordmark {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-deep-ink);
  letter-spacing: 0.05em;
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.navbar-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-text);
  font-size: 14px;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.navbar-link:hover { color: var(--color-primary); background: rgba(47, 111, 98, 0.06); }
.navbar-icon { font-size: 20px; }
.cart-badge {
  background: var(--color-vermilion);
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.cart-badge:empty, .cart-badge.d-none { display: none; }

/* ---- 主内容 ---- */
.portal-shell { min-height: calc(100vh - 180px); padding: 1.5rem 0; }
.portal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.portal-card-body { padding: 1.5rem; }

/* ---- 状态标签 ---- */
.status-pill {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.status-pending_review, .status-open { background: #FEF3C7; color: #92400E; }
.status-approved, .status-in_progress, .status-granted { background: #DBEAFE; color: #1E40AF; }
.status-packing { background: #E0E7FF; color: #3730A3; }
.status-shipped, .status-completed, .status-closed, .status-paid { background: #DCFCE7; color: #166534; }
.status-cancelled, .status-refunded, .status-rejected { background: #FEE2E2; color: #991B1B; }
.status-pending, .status-used, .status-expired { background: #F3F4F6; color: #6B7280; }
.status-active { background: #DCFCE7; color: #166534; }
.status-disabled, .status-unpaid { background: #F3F4F6; color: #6B7280; }

/* ---- 表单 ---- */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--color-text); margin-bottom: 0.25rem; }
.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
}
.form-control:focus { border-color: var(--color-primary); }
.form-control:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.form-text { font-size: 12px; color: var(--color-text-muted); margin-top: 0.25rem; }
.form-check { display: flex; align-items: flex-start; gap: 0.5rem; }
.form-check-input { margin-top: 0.2rem; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-outline-primary { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-outline-primary:hover { background: rgba(47, 111, 98, 0.06); }
.btn-outline-secondary { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); }
.btn-outline-secondary:hover { background: var(--color-bg); }
.btn-outline-danger { background: transparent; color: var(--color-vermilion); border: 1px solid var(--color-vermilion); }
.btn-outline-danger:hover { background: rgba(201, 74, 58, 0.06); }
.btn-danger { background: var(--color-vermilion); color: white; }
.btn-danger:hover { background: #B03D2E; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 13px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- 表格 ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--color-border-light); }
.table th { font-weight: 500; color: var(--color-text-muted); font-size: 13px; }
.table-sm th, .table-sm td { padding: 0.5rem; font-size: 13px; }
.table-responsive { overflow-x: auto; }

/* ---- 年龄门 ---- */
.age-gate {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 42, 0.85);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.age-gate.is-hidden { display: none; }
.age-gate-panel {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
}
.age-gate-title { font-size: 20px; font-weight: 700; color: var(--color-vermilion); margin: 0 0 0.75rem; }
.age-gate-desc { font-size: 14px; color: var(--color-text-muted); margin: 0 0 1.5rem; line-height: 1.6; }
.age-gate-buttons { display: flex; gap: 0.75rem; justify-content: center; }
.age-btn { padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-size: 15px; font-weight: 600; border: none; cursor: pointer; }
.age-btn-yes { background: var(--color-pine-green); color: white; }
.age-btn-yes:hover { background: #245249; }
.age-btn-no { background: #E5E7EB; color: var(--color-text); }
.age-btn-no:hover { background: #D1D5DB; }

/* ---- 通知 ---- */
.notice {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  max-width: min(92vw, 480px);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
}
.notice-success { background: #DCFCE7; color: #166534; }
.notice-error, .notice-danger { background: #FEE2E2; color: #991B1B; }
.notice-info { background: #DBEAFE; color: #1E40AF; }
.notice-warning { background: #FEF3C7; color: #92400E; }

/* ---- 面包屑 ---- */
.breadcrumb { display: flex; gap: 0.5rem; font-size: 14px; color: var(--color-text-muted); margin-bottom: 1rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--color-primary); }
.breadcrumb-sep { color: var(--color-border); }

/* ---- 空状态 ---- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--color-text-muted); }

/* ---- 手机端底部导航 ---- */
.mobile-bottom-nav {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  bottom: 0;
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  left: 0;
  position: fixed;
  right: 0;
  z-index: 120;
}
.mobile-bottom-nav a {
  align-items: center;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  gap: 0.1rem;
  justify-content: center;
  min-height: 58px;
  position: relative;
}
.mobile-bottom-nav i { font-size: 19px; line-height: 1; }
.mobile-bottom-nav a.is-active { color: var(--color-primary); font-weight: 600; }
.mobile-bottom-nav .cart-badge { position: absolute; right: calc(50% - 22px); top: 5px; }

/* ---- 详情展开 ---- */
details { border-top: 1px solid var(--color-border-light); padding-top: 0.75rem; margin-top: 0.75rem; }
summary { cursor: pointer; font-weight: 500; color: var(--color-primary); user-select: none; }
summary:hover { text-decoration: underline; }

/* ---- 响应式 ---- */
@media (max-width: 575px) {
  .portal-navbar-inner { height: 50px; }
  .brand-wordmark { font-size: 1.25rem; }
  .navbar-link span { display: none; }
  .portal-card-body { padding: 1rem; }
  .portal-shell { padding-bottom: 5rem; }
  .mobile-bottom-nav { display: grid; }
  body { padding-bottom: 58px; }
}

/* ---- 目录模式提示 ---- */
.catalog-mode-notice {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 14px;
  color: #92400E;
}
.catalog-mode-notice.d-none { display: none; }

/* ---- 信任模块（信息页通用） ---- */
.trust-section {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  padding: 2rem 0;
  margin-top: 2rem;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 991px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) { .trust-grid { grid-template-columns: 1fr; } }
.trust-card {
  padding: 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
}
.trust-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.trust-card-icon { color: var(--color-primary); }
.trust-card-text { font-size: 13px; color: var(--color-text-muted); margin: 0; line-height: 1.6; }

/* ---- 信息页通用 ---- */
.info-page { padding: 2rem 0; }
.info-page h1 { font-size: 1.5rem; font-weight: 700; color: var(--color-text); margin: 0 0 1.5rem; }
.info-page h2 { font-size: 1.125rem; font-weight: 600; color: var(--color-text); margin: 1.5rem 0 0.75rem; }
.info-page p { color: var(--color-text-muted); margin: 0 0 1rem; line-height: 1.7; }
.info-page ul, .info-page ol { color: var(--color-text-muted); margin: 0 0 1rem; padding-left: 1.5rem; }
.info-page li { margin-bottom: 0.5rem; line-height: 1.6; }
.info-page .alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 1rem;
}
.info-page .alert-info { background: #DBEAFE; color: #1E40AF; }
.info-page .alert-warning { background: #FEF3C7; color: #92400E; }
.info-page .alert-danger { background: #FEE2E2; color: #991B1B; }
