/* ============================================================
   Coolsmart Theme — main.css
   HomeKit-inspired warm amber design system
   ============================================================ */

/* ── CSS 自定义属性 ── */
:root {
  /* 背景渐变 */
  --bg-gradient: linear-gradient(
    170deg,
    #0d7a8a 0%,
    #0a5a6e 25%,
    #063a50 55%,
    #021a28 100%
  );

  /* 卡片 */
  --card-light-bg: rgba(255, 255, 255, 0.88);
  --card-dark-bg:  rgba(28, 28, 32, 0.72);
  --card-blur:     blur(14px);
  --card-blur-dark:blur(10px);
  --card-radius:   18px;
  --card-radius-sm:12px;
  --card-shadow:   0 4px 24px rgba(0, 0, 0, 0.22);
  --card-shadow-hover: 0 8px 36px rgba(0, 0, 0, 0.30);

  /* 颜色 */
  --accent:        #ff9500;
  --accent-dark:   #e07800;
  --text-dark:     #1c1c1e;
  --text-light:    rgba(255, 255, 255, 0.92);
  --text-muted:    rgba(255, 255, 255, 0.55);
  --text-muted-dark: rgba(28, 28, 30, 0.55);

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
          "Segoe UI", Roboto, sans-serif;

  /* 间距 */
  --section-gap:   80px;
  --card-gap:      14px;
  --nav-height:    64px;
  --mobile-bar:    68px;

  /* 动效 */
  --transition:    0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── 背景 & Body ── */
body {
  font-family: var(--font);
  color: var(--text-light);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 全屏背景质感叠加 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0,220,200,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(0,80,120,0.25) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ── 页面容器 ── */
.site {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ============================================================
   顶部导航
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background var(--transition), backdrop-filter var(--transition);
}

.site-header.scrolled {
  background: rgba(20, 12, 4, 0.55);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-logo .logo-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-logo .logo-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

/* 桌面导航菜单 */
.nav-primary ul {
  display: flex;
  gap: 6px;
}

.nav-primary a {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
  transition: background var(--transition), color var(--transition);
}

.nav-primary a:hover,
.nav-primary .current-menu-item a {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* 汉堡菜单（手机） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ============================================================
   Hero 区块
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  padding-bottom: 60px;
}

.hero-content {
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 149, 0, 0.20);
  border: 1px solid rgba(255, 149, 0, 0.40);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-desc {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.75);
  max-width: 520px;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--card-radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 18px rgba(255, 149, 0, 0.40);
}
.btn-primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 6px 24px rgba(255, 149, 0, 0.55);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.20);
}

/* 英雄数字统计 */
.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 56px;
  flex-wrap: wrap;
}

.stat-item .stat-num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1;
}

.stat-item .stat-num span {
  color: var(--accent);
}

.stat-item .stat-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}

/* ============================================================
   卡片组件
   ============================================================ */
.card {
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  transition:
    transform var(--transition),
    box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

.card-light {
  background: var(--card-light-bg);
  -webkit-backdrop-filter: var(--card-blur);
  backdrop-filter: var(--card-blur);
  color: var(--text-dark);
}

.card-dark {
  background: var(--card-dark-bg);
  -webkit-backdrop-filter: var(--card-blur-dark);
  backdrop-filter: var(--card-blur-dark);
  color: var(--text-light);
}

/* 卡片图标 */
.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.card-light .card-icon { background: rgba(255, 149, 0, 0.12); }
.card-dark  .card-icon { background: rgba(255, 149, 0, 0.22); }
.card-icon svg { width: 22px; height: 22px; }
.card-light .card-icon svg { fill: var(--accent); }
.card-dark  .card-icon svg { fill: var(--accent); }

/* 卡片文字 */
.card-title {
  font-size: 1.0rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.85rem;
  line-height: 1.55;
}

.card-light .card-desc { color: var(--text-muted-dark); }
.card-dark  .card-desc { color: rgba(255,255,255,0.55); }

/* 卡片状态标签 */
.card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 12px;
  padding: 3px 10px;
  border-radius: 20px;
}

.card-light .card-status {
  background: rgba(255, 149, 0, 0.12);
  color: var(--accent-dark);
}

.card-dark .card-status {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.70);
}

/* 大尺寸数值卡片（温度/数字展示） */
.card-metric .metric-value {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent);
  margin: 8px 0 4px;
}

.card-metric .metric-label {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

/* ============================================================
   特性/服务网格
   ============================================================ */
.section {
  padding-block: var(--section-gap);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: "›";
  font-size: 1.2em;
  color: rgba(255, 255, 255, 0.40);
  font-weight: 400;
}

.section-link {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}
.section-link:hover { text-decoration: underline; }

/* 卡片网格 */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--card-gap);
}

@media (min-width: 600px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .cards-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 宽卡片 (span 2 列) */
.card-wide { grid-column: span 2; }

/* 高卡片 (span 2 行) */
.card-tall { grid-row: span 2; }

/* ============================================================
   关于/品牌区块
   ============================================================ */
.about-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .about-section { grid-template-columns: 1fr 1fr; gap: 20px; }
}

.about-text-card {
  padding: 36px;
}

.about-text-card h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.about-text-card h2 em {
  font-style: normal;
  color: var(--accent);
}

.about-text-card p {
  font-size: 0.95rem;
  line-height: 1.70;
  color: var(--text-muted-dark);
}

.about-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.about-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
}

.about-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ============================================================
   CTA / 联系区块
   ============================================================ */
.cta-card {
  text-align: center;
  padding: 60px 40px;
}

.cta-card h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.cta-card h2 em {
  font-style: normal;
  color: var(--accent);
}

.cta-card p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 460px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  margin-top: auto;
  padding-block: 32px;
  padding-bottom: calc(32px + var(--mobile-bar));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 769px) {
  .site-footer { padding-bottom: 32px; }
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.70);
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.18s;
}
.footer-links a:hover { color: rgba(255, 255, 255, 0.80); }

/* ============================================================
   手机抽屉菜单
   ============================================================ */
.mobile-drawer {
  display: none;
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  background: rgba(18, 10, 2, 0.92);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  z-index: 90;
  padding: 24px 20px;
  transform: translateY(-8px);
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
}

.mobile-drawer.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 768px) {
  .mobile-drawer { display: block; }
}

.drawer-menu li { border-bottom: 1px solid rgba(255,255,255,0.07); }
.drawer-menu a {
  display: block;
  padding: 16px 4px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-light);
}
.drawer-menu a:hover { color: var(--accent); }

/* 汉堡 → X */
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   手机底部 Tab Bar
   ============================================================ */
.mobile-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-bar);
  background: rgba(18, 10, 2, 0.78);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 768px) {
  .mobile-tabbar { display: flex; }
  .nav-primary { display: none; }
  .nav-toggle { display: flex; }
}

.tab-list {
  display: flex;
  flex: 1;
  align-items: center;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding-top: 10px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.18s;
  text-decoration: none;
}

.tab-item svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform var(--transition);
}

.tab-item span {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tab-item:hover,
.tab-item.active {
  color: var(--accent);
}

.tab-item.active svg {
  transform: scale(1.12);
}

/* ============================================================
   普通页面内容
   ============================================================ */
.page-content {
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: var(--section-gap);
}

.content-card {
  padding: 40px;
}

.entry-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-dark);
  margin-bottom: 24px;
}

.entry-content {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #3a3a3c;
}

.entry-content h2,
.entry-content h3 { font-weight: 700; margin: 1.5em 0 0.6em; color: var(--text-dark); }
.entry-content p  { margin-bottom: 1em; }
.entry-content a  { color: var(--accent); text-decoration: underline; }

/* ============================================================
   404
   ============================================================ */
.error-404 {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  gap: 20px;
  padding-top: var(--nav-height);
}

.error-404 .error-code {
  font-size: 7rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: var(--accent);
  line-height: 1;
  opacity: 0.3;
}

.error-404 h1 { font-size: 1.6rem; font-weight: 700; }
.error-404 p  { color: rgba(255,255,255,0.55); }

/* ============================================================
   工具类
   ============================================================ */
.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;
}

.text-accent { color: var(--accent); }
.mt-auto { margin-top: auto; }
