/* ============================================================
   智能控制台演示站点 - 样式表
   支持浅色 / 深色主题，通过 [data-theme] 切换
   ============================================================ */

/* ---------- CSS 变量：浅色主题（默认） ---------- */
:root,
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --accent-glow: rgba(99, 102, 241, 0.15);

  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #6366f1, #8b5cf6);

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.1);

  --navbar-bg: rgba(255, 255, 255, 0.85);
  --navbar-border: rgba(226, 232, 240, 0.8);

  --flash-color: rgba(99, 102, 241, 0.08);
}

/* ---------- CSS 变量：深色主题 ---------- */
[data-theme="dark"] {
  --bg-primary: #0b1120;
  --bg-secondary: #111827;
  --bg-tertiary: #1e293b;
  --bg-elevated: #1e293b;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-light: rgba(129, 140, 248, 0.12);
  --accent-glow: rgba(129, 140, 248, 0.2);

  --gradient-hero: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
  --gradient-accent: linear-gradient(135deg, #818cf8, #a78bfa);

  --border: #334155;
  --border-light: #1e293b;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.6);

  --navbar-bg: rgba(11, 17, 32, 0.85);
  --navbar-border: rgba(51, 65, 85, 0.6);

  --flash-color: rgba(129, 140, 248, 0.1);
}

/* ---------- 全局重置 ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.5s ease, color 0.5s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   导航栏
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--navbar-border);
  transition: background-color 0.5s ease, border-color 0.5s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  transition: color 0.5s ease;
}

.brand-icon {
  font-size: 22px;
}

.brand-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 实时同步徽章 */
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--accent-light);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  transition: background-color 0.5s ease, color 0.5s ease;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* 主题切换按钮 */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  transform: rotate(15deg);
}

/* ============================================================
   Hero 区域
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 24px 100px;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  opacity: 0.06;
  transition: opacity 0.5s ease;
  z-index: 0;
}

[data-theme="dark"] .hero-bg {
  opacity: 0.4;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  transition: background-color 0.5s ease, color 0.5s ease;
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--text-secondary);
  font-weight: 400;
  transition: color 0.5s ease;
}

/* ============================================================
   主内容区
   ============================================================ */
.main-content {
  flex: 1;
  padding: 0 24px 80px;
}

.content-wrapper {
  max-width: 860px;
  margin: 0 auto;
}

/* 内容卡片 */
.content-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 56px;
  box-shadow: var(--shadow-lg);
  transition: background-color 0.5s ease, border-color 0.5s ease,
    box-shadow 0.5s ease;
  position: relative;
  overflow: hidden;
}

/* 更新闪烁高亮 */
.content-card.flash {
  animation: content-flash 1.2s ease-out;
}

@keyframes content-flash {
  0% { box-shadow: var(--shadow-lg), 0 0 0 0 var(--accent-glow); }
  30% { box-shadow: var(--shadow-lg), 0 0 0 12px var(--accent-glow); background-color: var(--flash-color); }
  100% { box-shadow: var(--shadow-lg), 0 0 0 0 transparent; }
}

/* 内容图片展示区 */
.content-image {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 28px;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(255,255,255,0.1);
}



.content-image img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.3));
}



.content-image img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.content-body {
  transition: opacity 0.35s ease;
}

.content-body.fading {
  opacity: 0;
}

/* 正文 HTML 样式 */
.content-body h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 32px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-light);
  transition: color 0.5s ease, border-color 0.5s ease;
}

.content-body h2:first-child {
  margin-top: 0;
}

.content-body h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 28px 0 12px;
  transition: color 0.5s ease;
}

.content-body p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.85;
  transition: color 0.5s ease;
}

.content-body ul,
.content-body ol {
  margin: 12px 0 20px;
  padding-left: 24px;
}

.content-body li {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.75;
  transition: color 0.5s ease;
}

.content-body li::marker {
  color: var(--accent);
}

.content-body strong {
  color: var(--text-primary);
  font-weight: 700;
  transition: color 0.5s ease;
}

.content-body em {
  color: var(--accent);
  font-style: italic;
}

.content-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.content-body a:hover {
  border-bottom-color: var(--accent);
}

.loading-text {
  color: var(--text-muted) !important;
  text-align: center;
  font-style: italic;
}

/* ============================================================
   功能特性卡片
   ============================================================ */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color 0.5s ease;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  transition: color 0.5s ease;
}

/* ============================================================
   页脚
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 24px 0;
  transition: background-color 0.5s ease, border-color 0.5s ease;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.5s ease;
}

.update-info {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.5s ease;
}

.update-info #updatedAt {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 12px;
}

/* ============================================================
   更新 Toast 提示
   ============================================================ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 16px;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 16px;
  }

  .live-badge .live-text {
    display: none;
  }

  .hero {
    padding: 56px 16px 72px;
  }

  .main-content {
    padding: 0 16px 56px;
  }

  .content-card {
    padding: 32px 24px;
    border-radius: 16px;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .footer-container {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px;
  }

  .content-body h2 {
    font-size: 22px;
  }
}
