/* ========================================
   Hiwik Life — Brand Stylesheet
   Light theme + Blue/Indigo accent
   品牌主色取自 app: Primitive/BlueScale/Blue400 (#4C6EF5)
   辅色取自 Primitive/RingBlue (#7B8CFF)
   ======================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  /* Brand */
  --color-primary: #4C6EF5;
  --color-primary-hover: #3B5BDB;
  --color-secondary: #7B8CFF;
  --color-gradient: linear-gradient(135deg, #4C6EF5 0%, #7B8CFF 100%);
  --color-gradient-soft: linear-gradient(135deg, rgba(76, 110, 245, 0.06), rgba(123, 140, 255, 0.04));

  /* Surface */
  --color-bg: #F5F6F8;
  --color-card: #FFFFFF;
  --color-card-hover: #FAFBFD;
  --color-border: #E5E7EB;
  --color-border-strong: #D1D5DB;

  /* Text */
  --color-text: #111827;
  --color-text-secondary: #4B5563;
  --color-text-muted: #6B7280;

  /* Accent tint (与 app 中 selection/folding 同色系) */
  --color-tint-blue: rgba(76, 110, 245, 0.08);

  /* Semantic data (匹配 app 内 RedColor.income / expense / ring*) */
  --color-income: #45C77A;
  --color-expense: #FF3B30;
  --color-ring-orange: #FF8A5B;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --max-width: 920px;
  --transition: 0.25s ease;

  --shadow-card: 0 2px 12px rgba(17, 24, 39, 0.04);
  --shadow-hover: 0 8px 28px rgba(76, 110, 245, 0.12);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Segoe UI', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* ---------- Header ---------- */
.site-header {
  background: var(--color-gradient);
  position: relative;
  overflow: hidden;
  color: #fff;
}

.site-header::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: 25%;
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 44px 24px 40px;
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.brand h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.header-subtitle {
  font-size: 0.96rem;
  opacity: 0.9;
  margin-top: 4px;
  padding-left: 70px;
}

/* ---------- Navigation ---------- */
.site-nav {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.nav-inner a {
  display: inline-block;
  padding: 14px 18px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.nav-inner a:hover,
.nav-inner a.active {
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
}

/* ---------- Language Switch ---------- */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
}

.lang-switch button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 14px 12px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.lang-switch button.active {
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
}

.lang-switch button:hover:not(.active) {
  color: var(--color-text);
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 44px 24px 64px;
  width: 100%;
}

/* ---------- Card ---------- */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: rgba(76, 110, 245, 0.3);
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
}

.card h2 .icon {
  font-size: 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.card h2 .icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 22px 0 10px;
  color: var(--color-text);
}

.card p,
.card li {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.card ul {
  list-style: none;
  padding: 0;
}

.card ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
}

.card ul li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.4;
}

/* ---------- FAQ (Accordion) ---------- */
.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 18px 0;
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  user-select: none;
  gap: 12px;
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--color-primary);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-item.open .faq-answer {
  max-height: 520px;
  padding-top: 12px;
}

.faq-answer p {
  color: var(--color-text-secondary);
  font-size: 0.93rem;
  line-height: 1.8;
}

/* ---------- Contact Banner ---------- */
.contact-banner {
  background: var(--color-gradient);
  border-radius: var(--radius);
  padding: 36px 32px;
  text-align: center;
  margin-top: 12px;
  color: #fff;
}

.contact-banner h2 {
  justify-content: center;
  margin-bottom: 8px;
  color: #fff;
}

.contact-banner p {
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 20px;
}

.contact-banner .btn {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: background var(--transition);
}

.contact-banner .btn:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 28px 24px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  background: var(--color-card);
}

.site-footer a {
  color: var(--color-text-muted);
}

.site-footer a:hover {
  color: var(--color-primary);
}

/* ---------- Index Hero ---------- */
.hero {
  text-align: center;
  padding: 56px 0 36px;
}

.hero img {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  box-shadow: 0 10px 36px rgba(76, 110, 245, 0.28);
  margin-bottom: 24px;
}

.hero h2 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: var(--color-text);
}

.hero p {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
}

.hero-links .btn-primary {
  background: var(--color-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(76, 110, 245, 0.3);
}

.hero-links .btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  color: #fff;
  box-shadow: var(--shadow-hover);
}

.hero-links .btn-outline {
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
  background: var(--color-card);
}

.hero-links .btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ---------- Feature Grid ---------- */
.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.feature-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  border-color: rgba(76, 110, 245, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.feature-card .icon {
  font-size: 1.7rem;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--color-tint-blue);
}

.feature-card .icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
}

.feature-card p {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ---------- Section Title ---------- */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 40px 0 16px;
  text-align: center;
  letter-spacing: -0.01em;
}

.section-title-sub {
  text-align: center;
  color: var(--color-text-muted);
  margin: -8px auto 20px;
  font-size: 0.95rem;
  max-width: 560px;
}

/* ---------- Effective Date Tag ---------- */
.date-tag {
  display: inline-block;
  background: var(--color-tint-blue);
  color: var(--color-primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 20px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .header-inner {
    padding: 28px 20px 24px;
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  .brand h1 {
    font-size: 1.35rem;
  }

  .header-subtitle {
    padding-left: 60px;
    font-size: 0.88rem;
  }

  .main-content {
    padding: 28px 16px 48px;
  }

  .card {
    padding: 24px 20px;
  }

  .hero {
    padding: 36px 0 24px;
  }

  .hero h2 {
    font-size: 1.45rem;
  }

  .hero img {
    width: 84px;
    height: 84px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .contact-banner {
    padding: 28px 20px;
  }
}
