/* ========================================
   白管家品牌官网 - 共享样式
   ======================================== */

/* -- CSS 变量 -- */
:root {
  --brand-900: #2a1f0e;
  --brand-800: #3d2e16;
  --brand-700: #523f22;
  --brand-600: #5d4a2f;
  --brand-500: #715b3e;
  --brand-400: #8b7355;
  --brand-300: #a68e6e;
  --brand-200: #c4a882;
  --brand-100: #dfc29f;
  --brand-50: #f5e8d4;
  --background-900: #1e1b19;
  --background-800: #33302d;
  --background-700: #4d453c;
  --background-600: #7f756b;
  --background-500: #9e948a;
  --background-400: #b8aea4;
  --background-300: #d1c4b9;
  --background-200: #e8e1dd;
  --background-100: #f4ede8;
  --background-50: #fff8f4;
  --text-900: #000000;
  --text-800: #1e1b19;
  --text-700: #33302d;
  --text-600: #4d453c;
  --text-500: #6b5b3e;
  --text-400: #7f756b;
  --text-300: #9e948a;
  --text-200: #b8aea4;
  --text-100: #d1c4b9;
  --text-50: #f4ede8;
  --text-inverse: #ffffff;
  --shadow-color: rgba(30,27,25,0.06);
  --shadow-color-sm: rgba(30,27,25,0.05);
  --glass-bg: rgba(255,248,244,0.85);
  --hero-overlay: rgba(30,27,25,0.45);
  --text-white-80: rgba(255,255,255,0.8);
  --text-white-60: rgba(255,255,255,0.6);
  --bg-white-10: rgba(255,255,255,0.1);
  --shadow-black-15: rgba(0,0,0,0.15);
  --shadow-color-lg: rgba(30,27,25,0.08);
  --font-sans: HarmonyOS Sans, PingFang SC, Microsoft YaHei, ui-sans-serif, sans-serif, system-ui;
  --font-serif: HarmonyOS Sans, PingFang SC, Microsoft YaHei, ui-sans-serif, sans-serif, system-ui;
  --font-mono: HarmonyOS Sans, ui-monospace, monospace;
  --star-color: #e8a33d;
  --white: #ffffff;
}

@theme inline {
  --color-background: var(--background-50);
  --color-foreground: var(--text-500);
  --color-card: var(--background-50);
  --color-primary: var(--brand-500);
  --color-border: var(--background-300);
  --color-muted: var(--text-400);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-family-sans: var(--font-sans);
  --font-family-serif: var(--font-sans);
}

/* -- 基础重置 -- */
@layer base {
  body {
    font-family: var(--font-sans);
    color: var(--text-500);
    background: var(--background-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  a { text-decoration: none; color: inherit; }
  ul { list-style: none; }
  img { max-width: 100%; display: block; }
}

/* -- 容器 -- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   SHARED HEADER
   ======================================== */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all 0.3s ease;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.header-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-500);
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-logo-icon span {
  color: var(--text-inverse);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 18px;
}
.header-logo-text {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-800);
}
#main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  font-size: 15px;
  color: var(--text-400);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link[data-active="true"] {
  color: var(--brand-500) !important;
  font-weight: 600;
}
.nav-link:hover {
  color: var(--brand-500);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-outline {
  padding: 8px 20px;
  border-radius: 100px;
  border: 1px solid var(--background-300);
  background: transparent;
  color: var(--text-600);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.btn-outline:hover {
  border-color: var(--brand-400);
  color: var(--brand-500);
}
.btn-primary-sm {
  padding: 8px 20px;
  border-radius: 100px;
  border: none;
  background: var(--brand-500);
  color: var(--text-inverse);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.btn-primary-sm:hover {
  background: var(--brand-600);
}
#site-header.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px var(--shadow-color);
}

/* Header 变体：深色背景页面（banner 为深色渐变） */
#site-header.header-dark .nav-link {
  color: var(--text-white-80);
}
#site-header.header-dark .header-logo-text {
  color: var(--text-inverse);
}
#site-header.header-dark .btn-outline {
  border-color: var(--text-white-60);
  color: var(--text-inverse);
}
#site-header.header-dark .mobile-menu-btn span {
  background: var(--text-inverse);
}

/* Header 深色变体：滚动后恢复常规色 */
#site-header.header-dark.scrolled .nav-link {
  color: var(--text-400) !important;
}
#site-header.header-dark .nav-link[data-active="true"] {
  color: #ffffff !important;
  font-weight: 600;
}
#site-header.header-dark .nav-link:hover {
  color: var(--brand-500);
}
#site-header.header-dark.scrolled .nav-link[data-active="true"] {
  color: var(--brand-500) !important;
}
#site-header.header-dark.scrolled .nav-link:hover {
  color: var(--brand-500) !important;
}
#site-header.header-dark.scrolled .header-logo-text {
  color: var(--text-800);
}
#site-header.header-dark.scrolled .btn-outline {
  border-color: var(--background-300);
  color: var(--text-600);
}
#site-header.header-dark.scrolled .mobile-menu-btn span {
  background: var(--text-800);
}

/* Mobile hamburger */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-800);
  border-radius: 1px;
  transition: all 0.3s;
}

/* ========================================
   SHARED FOOTER
   ======================================== */
.site-footer {
  background: var(--text-800);
  color: var(--text-200);
  padding: 64px 24px 32px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-300);
  margin: 0;
}
.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-inverse);
  margin: 0 0 16px;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col li a {
  font-size: 14px;
  color: var(--text-300);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col li a:hover {
  color: var(--brand-200);
}
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--text-300);
}
.footer-qr {
  margin-top: 16px;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  background: var(--text-700);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-400);
  font-size: 12px;
}
.footer-bottom {
  border-top: 1px solid var(--text-700);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom span {
  font-size: 13px;
  color: var(--text-400);
}

/* ========================================
   SECTION 通用
   ======================================== */
.section-title {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-800);
  text-align: center;
  margin-bottom: 16px;
}
.section-subtitle {
  font-size: 16px;
  color: var(--text-400);
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}

/* ========================================
   PAGE BANNER（内页通用）
   ======================================== */
.page-banner {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
  padding: 80px 24px 60px;
  text-align: center;
}
.page-banner h1 {
  font-family: var(--font-sans);
  font-size: 40px;
  font-weight: 700;
  color: var(--text-inverse);
  margin-bottom: 12px;
}
.page-banner p {
  font-size: 18px;
  color: var(--text-white-80);
}

/* ========================================
   BOTTOM CTA（内页通用）
   ======================================== */
.bottom-cta {
  background: var(--brand-500);
  padding: 64px 24px;
  text-align: center;
}
.bottom-cta h2,
.bottom-cta h3 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-inverse);
  margin-bottom: 28px;
}
.bottom-cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-outline-white {
  padding: 14px 36px;
  border-radius: 100px;
  border: 1px solid var(--text-white-60);
  background: transparent;
  color: var(--text-inverse);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.btn-outline-white:hover {
  background: var(--bg-white-10);
}
.btn-dark {
  padding: 14px 36px;
  border-radius: 100px;
  border: none;
  background: var(--text-inverse);
  color: var(--brand-700);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.btn-dark:hover {
  background: var(--background-100);
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
  #main-nav {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background-900);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    z-index: 100;
  }
  #main-nav.nav-open {
    display: flex !important;
  }
  #main-nav .nav-link {
    color: var(--text-100) !important;
  }
  .header-actions {
    display: none !important;
  }
  .mobile-cta-bar {
    display: flex !important;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .page-banner h1 {
    font-size: 30px !important;
  }
  .section-title {
    font-size: 26px !important;
  }
}

/* 移动端 CTA 栏（header 下方补充） */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--background-50);
  border-top: 1px solid var(--background-200);
  padding: 12px 16px;
  gap: 10px;
  box-shadow: 0 -2px 8px var(--shadow-color);
}
.mobile-cta-bar button {
  flex: 1;
  padding: 12px 0;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s;
}
.mobile-cta-bar .mobile-cta-primary {
  background: var(--brand-500);
  color: var(--text-inverse);
  border: none;
}
.mobile-cta-bar .mobile-cta-primary:hover {
  background: var(--brand-600);
}
.mobile-cta-bar .mobile-cta-secondary {
  background: transparent;
  color: var(--text-600);
  border: 1px solid var(--background-300);
}
.mobile-cta-bar .mobile-cta-secondary:hover {
  border-color: var(--brand-400);
  color: var(--brand-500);
}

/* ===== Global Merchant Modal ===== */
.merchant-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.merchant-modal-overlay.open {
  display: flex;
}
.merchant-modal {
  background: var(--text-inverse, #fff);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
}
.merchant-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}
.merchant-modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-800);
  margin: 0;
}
.merchant-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--background-50);
  color: var(--text-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.merchant-modal-close:hover {
  background: var(--background-200);
}
.merchant-modal-body {
  padding: 24px 28px 28px;
}
.merchant-modal .form-group {
  margin-bottom: 18px;
}
.merchant-modal .form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-700);
  margin-bottom: 6px;
}
.merchant-modal .form-group label .required {
  color: #ba1a1a;
  margin-left: 2px;
}
.merchant-modal .form-group input,
.merchant-modal .form-group select,
.merchant-modal .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--background-300);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-700);
  background: var(--background-50);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
}
.merchant-modal .form-group input:focus,
.merchant-modal .form-group select:focus,
.merchant-modal .form-group textarea:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(139,115,85,0.15);
}
.merchant-modal .form-group input.error,
.merchant-modal .form-group select.error {
  border-color: #ba1a1a;
  box-shadow: 0 0 0 3px rgba(186,26,26,0.1);
}
.merchant-modal .form-error-msg {
  display: none;
  font-size: 13px;
  color: #ba1a1a;
  margin-top: 4px;
}
.merchant-modal .form-error-msg.show {
  display: block;
}
.merchant-modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.merchant-modal .btn-submit-modal {
  width: 100%;
  padding: 12px;
  background: var(--brand-400);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
  font-family: inherit;
}
.merchant-modal .btn-submit-modal:hover {
  background: var(--brand-600);
}
.merchant-modal-success {
  display: none;
  text-align: center;
  padding: 48px 28px;
}
.merchant-modal-success.active {
  display: block;
}
.merchant-modal-success .success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e8f5ee;
  color: #2f6b4a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.merchant-modal-success h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-800);
  margin-bottom: 8px;
}
.merchant-modal-success p {
  font-size: 14px;
  color: var(--text-400);
  margin: 0;
}
@media (max-width: 640px) {
  .merchant-modal .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
