/* ================================================================
   home.css — 简章优品首页样式
   基于 docs/design/homepage-ui-spec.md §4 Design Token
   作用域：仅首页 www_homepage.html（body.homepage），不影响 ecom-platform
   ================================================================ */

/* ── Design Token ─────────────────────────────────────────────── */
:root {
  --color-primary:      #2563EB;
  --color-primary-deep: #1D4ED8;
  --color-title:        #0F172A;
  --color-text:         #475569;
  --color-muted:        #64748B;
  --color-bg:           #F8FAFC;
  --color-card:         #FFFFFF;
  --color-border:       #E2E8F0;
  --color-blue-soft:    #EFF6FF;

  --radius-button:      10px;
  --radius-card:        20px;
  --radius-section:     24px;
  --radius-hero:        28px;

  --shadow-card:        0 12px 32px rgba(15, 23, 42, 0.06);
  --shadow-hero:        0 24px 64px rgba(15, 23, 42, 0.08);

  --container-width:    1180px;
  --nav-height:         72px;
}

/* ═══════════════════════════════════════════════════════════════
   1. 全页面作用域
   ═══════════════════════════════════════════════════════════════ */
body.homepage {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

body.homepage *,
body.homepage *::before,
body.homepage *::after {
  box-sizing: border-box;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   2. 统一居中容器
   ═══════════════════════════════════════════════════════════════ */
body.homepage .container {
  width: calc(100% - 48px);
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
}

/* ═══════════════════════════════════════════════════════════════
   3. Header / 导航栏
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-title);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-left: auto;
}

.main-nav a {
  font-size: 15px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.main-nav a:hover {
  color: var(--color-primary);
}

/* ── 内部工作台按钮 ──────────────────────────────────────────── */
.btn-workbench {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  background: var(--color-card);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-button);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-workbench:hover {
  background: var(--color-blue-soft);
}

.btn-workbench.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-workbench.is-disabled:hover {
  background: var(--color-card);
}

/* ── Hamburger (mobile only) ──────────────────────────────────── */
.hamburger {
  display: none;
  flex: 0 0 auto;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-title);
  padding: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   4. Hero（大卡片）
   ═══════════════════════════════════════════════════════════════ */
.hero {
  padding: 96px 0 64px;
  scroll-margin-top: 96px;
}

.hero-panel {
  overflow: visible;
  text-align: center;
  padding: 76px 72px;
  border-radius: var(--radius-hero);
  border: 1px solid var(--color-border);
  background: #FFFFFF;
  box-shadow:
    0 8px 40px rgba(37, 99, 235, 0.06),
    0 2px 8px rgba(15, 23, 42, 0.04);
}

.hero h1 {
  margin: 0 auto;
  max-width: 680px;
  font-size: clamp(38px, 3.8vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  color: var(--color-title);
  font-weight: 850;
}

.hero p {
  max-width: 620px;
  margin: 24px auto 0;
  font-size: 18px;
  line-height: 1.85;
  color: var(--color-text);
}

/* ── Hero 按钮 ────────────────────────────────────────────────── */
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  min-height: 46px;
  padding: 0 24px;
  border-radius: var(--radius-button);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--color-primary);
  color: #FFFFFF;
  border: none;
}

.btn-primary:hover {
  background: var(--color-primary-deep);
}

.btn-secondary {
  background: var(--color-card);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-blue-soft);
}

/* ═══════════════════════════════════════════════════════════════
   5. Section 统一
   ═══════════════════════════════════════════════════════════════ */
.section {
  padding: 56px 0;
  scroll-margin-top: 96px;
}

.section-header {
  margin-bottom: 28px;
}

.section-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--color-title);
  font-weight: 800;
}

.section-desc {
  max-width: 720px;
  margin-top: 12px;
  color: var(--color-muted);
  line-height: 1.8;
  font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════════
   6. 四卡片区
   ═══════════════════════════════════════════════════════════════ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.feature-card {
  min-height: 210px;
  padding: 30px;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.card-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  background: var(--color-blue-soft);
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 800;
}

.feature-card h3 {
  margin: 0 0 14px;
  font-size: 21px;
  color: var(--color-title);
}

.feature-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
  color: var(--color-text);
}

/* ═══════════════════════════════════════════════════════════════
   7. 数据中台建设记录（2×2 卡片区）
   ═══════════════════════════════════════════════════════════════ */
.record-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.record-item {
  min-height: 112px;
  padding: 26px 28px;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  background: #FFFFFF;
  box-shadow: var(--shadow-card);
}

.record-item h3 {
  margin: 0 0 12px;
  font-size: 19px;
  color: var(--color-title);
}

.record-item p {
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text);
}

/* ═══════════════════════════════════════════════════════════════
   8. 关于本站
   ═══════════════════════════════════════════════════════════════ */
.about-panel {
  padding: 34px 36px;
  border-radius: var(--radius-card);
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

.about-panel .section-title {
  margin-bottom: 14px;
}

.about-panel p {
  max-width: 920px;
  line-height: 1.95;
  font-size: 15px;
  color: var(--color-text);
}

/* ═══════════════════════════════════════════════════════════════
   9. Footer
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--color-border);
  background: #FFFFFF;
}

.footer-inner {
  padding: 34px 0;
  text-align: center;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.8;
}

.footer-inner p {
  margin-bottom: 4px;
}

.beian {
  font-size: 13px;
}

.beian a {
  color: var(--color-muted);
  text-decoration: none;
  margin-right: 8px;
}

.beian a:hover {
  text-decoration: underline;
}

.beian span {
  color: #94a3b8;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   10. 移动端 ≤ 768px
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  body.homepage .container {
    width: calc(100% - 32px);
    max-width: var(--container-width);
  }

  /* Header */
  .site-header {
    height: 60px;
  }

  .header-inner {
    gap: 12px;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 8px 0;
    box-shadow: var(--shadow-card);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 14px 24px;
    border-bottom: 1px solid var(--color-border);
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  .hamburger {
    display: block;
  }

  /* Hero → 单列 */
  .hero {
    padding: 72px 0 48px;
    scroll-margin-top: 72px;
  }

  .hero-panel {
    padding: 32px 24px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 16px;
    margin-top: 16px;
  }

  .hero-cta {
    flex-direction: column;
    margin-top: 24px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  /* Section */
  .section {
    padding: 32px 0;
    scroll-margin-top: 72px;
  }

  .section-title {
    font-size: 22px;
  }

  .section-header {
    margin-bottom: 20px;
  }

  /* 卡片 → 单列 */
  .card-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: auto;
  }

  /* 记录 → 单列 */
  .record-list {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .site-footer {
    margin-top: 32px;
  }

  .footer-inner {
    padding: 24px 0;
  }
}
