/* ===================== 简银科技 v2 - SpaceX极简风格 ===================== */
/* CSS变量 - 亮色主题 */
:root {
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f2;
  --bg-tertiary: #e6e6ea;
  --bg-navbar: rgba(250, 250, 250, 0.82);
  --bg-footer: #15181e;
  --bg-card: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.03);

  --text-primary: #171719;
  --text-secondary: #50525a;
  --text-tertiary: #9094a0;
  --text-on-primary: #ffffff;
  --text-footer: #aaaab0;
  --text-muted: #75757f;

  --accent: #004cff;
  --accent-light: #3d7cff;
  --accent-hover: #003acc;
  --border-color: #dedee2;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.07);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --max-width: 1280px;
  --navbar-height: 64px;
  --transition: 0.25s ease;

  --font-sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 暗色主题 - 深蓝灰,柔和舒适 */
[data-theme="dark"] {
  --bg-primary: #0d0f13;
  --bg-secondary: #13161c;
  --bg-tertiary: #1a1e26;
  --bg-navbar: rgba(13, 15, 19, 0.80);
  --bg-footer: #08090c;
  --bg-card: #15181e;
  --bg-overlay: rgba(255, 255, 255, 0.04);

  --text-primary: #e2e2e8;
  --text-secondary: #9095a0;
  --text-tertiary: #62666e;
  --text-on-primary: #ffffff;
  --text-footer: #8a8a92;
  --text-muted: #555560;

  --accent: #5b9dff;
  --accent-light: #7ab3ff;
  --accent-hover: #4a8aef;
  --border-color: #1e222a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* 灰色纪念日滤镜 */
html.grayscale {
  filter: grayscale(1);
}

/* ===================== 基础重置 ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  font-weight: 400;
  letter-spacing: 0.01em;
  padding-top: var(--navbar-height);
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover {
  opacity: 0.75;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

ul { list-style: none; }

/* ===================== 布局容器 ===================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 24px;
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  text-align: center;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 48px;
  font-weight: 400;
}

.text-center { text-align: center; }

/* ===================== 导航栏 ===================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-navbar);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition), border-color var(--transition);
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary) !important;
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0;
}

.navbar-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.navbar-brand:hover {
  opacity: 0.8;
}

/* 导航链接 - 双语标签 */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.navbar-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition), background var(--transition);
  white-space: nowrap;
  line-height: 1.2;
  color: var(--text-primary);
}

.navbar-links a:hover {
  opacity: 0.65;
  background: transparent;
}

.navbar-links a .nav-cn {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.navbar-links a .nav-en {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 1px;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 主题切换按钮 */
.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: opacity var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  opacity: 0.65;
  border-color: var(--text-secondary);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* 移动端汉堡菜单按钮 */
.navbar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.navbar-toggle:hover {
  opacity: 0.65;
}

.navbar-toggle .icon-close { display: none; }
.navbar-toggle.active .icon-menu { display: none; }
.navbar-toggle.active .icon-close { display: block; }

/* ===================== 横幅 ===================== */
.banner {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===================== 时间线 ===================== */
.timeline {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.timeline-list {
  position: relative;
  padding-left: 2.5em;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 0.65em;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--bg-tertiary);
}

.timeline-item {
  position: relative;
  padding: 16px 0;
}

.timeline-bullet {
  position: absolute;
  left: -2.1em;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  z-index: 1;
}

.timeline-bullet.pink   { border-color: #F93B69; background: #F93B69; }
.timeline-bullet.orange { border-color: #EB8B6E; background: #EB8B6E; }
.timeline-bullet.blue   { border-color: #4d8aff; background: #4d8aff; }
.timeline-bullet.green  { border-color: #20c997; background: #20c997; }

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.timeline-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.timeline-content h4 {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-secondary);
}

/* ===================== 介绍区域 ===================== */
.intro {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.intro p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===================== 卡片网格 ===================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 0 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: opacity var(--transition), border-color var(--transition);
}

.card-item:hover {
  opacity: 0.85;
  border-color: var(--text-tertiary);
}

.card-item a {
  display: block;
}

.card-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.card-label {
  padding: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* 设备展示网格 */
.device-section {
  padding: 40px 24px;
}

.device-section h2 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.device-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: opacity var(--transition), border-color var(--transition);
}

.device-item:hover {
  opacity: 0.85;
  border-color: var(--text-tertiary);
}

.device-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* 大图横幅 */
.device-banner {
  max-width: var(--max-width);
  margin: 24px auto;
  padding: 0 24px;
}

.device-banner img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

/* ===================== 按钮 ===================== */
.btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--accent);
  color: #fff;
  letter-spacing: 0.02em;
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  opacity: 1;
}

.btn:active {
  transform: scale(0.98);
}

.btn-light {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-light:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn span::after {
  content: ' →';
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover span::after {
  opacity: 1;
}

/* ===================== 下载页面 ===================== */
.download-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.download-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
  text-align: center;
}

.download-block h2 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 600;
}

.download-block p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

/* ===================== 视频容器 ===================== */
.video-container {
  max-width: 100%;
  margin: 24px auto;
  padding: 0 24px;
  position: relative;
}

.video-container iframe {
  width: 100%;
  max-width: 1120px;
  aspect-ratio: 2 / 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: block;
  margin: 0 auto;
}

/* ===================== 返回按钮 ===================== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  margin: 16px 24px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.back-btn:hover {
  color: var(--text-primary);
  opacity: 1;
}

/* ===================== 文档页 ===================== */
.docs-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.docs-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
}

.docs-block h2 {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 8px;
  font-weight: 600;
}

.docs-block p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

/* ===================== 加入我们 ===================== */
.join-section {
  padding: 40px 24px;
  text-align: center;
}

.join-role {
  margin-bottom: 48px;
}

.join-role h2 {
  color: var(--text-primary);
  font-size: 1.3rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.join-role img {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: opacity var(--transition);
}

.join-role img:hover {
  opacity: 0.9;
}

/* ===================== 打赏页 ===================== */
.donate-section {
  text-align: center;
  padding: 80px 24px;
}

.donate-section h1 {
  color: var(--text-primary);
  margin-bottom: 12px;
  font-size: 1.6rem;
}

.donate-section p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.donate-qr {
  max-width: 280px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.donate-qr img {
  width: 100%;
  border-radius: var(--radius-sm);
}

/* ===================== 下载站 ===================== */
.share-list {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 24px;
}

.share-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  transition: border-color var(--transition);
}

.share-item:hover {
  border-color: var(--text-tertiary);
}

.share-item h3 {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* ===================== 更新页 ===================== */
.update-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 40px 20px;
  background: #001f86;
}

.update-page img {
  max-width: 160px;
  margin: 0 auto 24px;
}

.update-page h1 {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
}

/* ===================== 页脚 ===================== */
.footer {
  background: var(--bg-footer);
  color: var(--text-footer);
  padding: 48px 24px 24px;
  margin-top: auto;
}

[data-theme="dark"] .footer {
  border-top: 1px solid var(--border-color);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 32px;
  align-items: start;
}

.footer-col h2 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

[data-theme="dark"] .footer-col h2 {
  color: var(--text-secondary);
}

.footer-col p {
  font-size: 0.85rem;
  line-height: 2;
  color: rgba(255, 255, 255, 0.6);
}

.footer-col a {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: #fff !important;
  opacity: 1;
}

.footer-slogan img {
  max-width: 120px;
  opacity: 0.7;
}

.footer-copyright {
  text-align: center;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ===================== 响应式 - 平板/手机 ===================== */
@media (max-width: 900px) {
  /* 移除 backdrop-filter 避免 fixed 定位被限制在 navbar 内 */
  .navbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--bg-primary);
  }

  .navbar-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* 品牌和按钮浮在菜单之上 */
  .navbar-brand,
  .navbar-actions {
    position: relative;
    z-index: 999;
  }

  /* 移动端菜单 - 全屏覆盖 */
  .navbar-links {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: var(--navbar-height) 0 40px;
    gap: 0;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 998;
  }

  .navbar-links.open {
    display: flex !important;
    animation: fadeIn 0.2s ease;
  }

  .navbar-links a {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px;
    padding: 16px 24px;
    font-size: 1rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    line-height: 1.4;
  }

  .navbar-links a:hover {
    opacity: 0.6;
    background: var(--bg-secondary);
  }

  .navbar-links a .nav-cn {
    font-size: 1rem;
    font-weight: 500;
  }

  .navbar-links a .nav-en {
    font-size: 0.7rem;
    margin-top: 0;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-slogan {
    grid-column: 1 / -1;
    text-align: center;
  }

  .footer-slogan img {
    margin: 0 auto;
  }
}

/* ===================== 响应式 - 手机 ===================== */
@media (max-width: 600px) {
  :root {
    --navbar-height: 56px;
  }

  .navbar-inner {
    padding: 0 16px;
  }

  .navbar-brand {
    font-size: 1rem;
  }

  .navbar-brand img {
    width: 28px;
    height: 28px;
  }

  .section {
    padding: 48px 16px;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .card-grid,
  .device-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 0 16px;
  }

  .device-section {
    padding: 32px 16px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .footer-col p,
  .footer-col a {
    text-align: center;
  }

  .video-container iframe {
    aspect-ratio: 16 / 9;
  }

  .download-block,
  .docs-block {
    padding: 20px;
  }

  .intro {
    padding: 0 16px;
  }

  .intro p {
    font-size: 0.95rem;
  }

  .timeline {
    padding: 0 16px;
  }

  .device-banner {
    padding: 0 16px;
  }
}

/* ===================== backdrop-filter 降级 ===================== */
@supports not (backdrop-filter: blur(1px)) {
  .navbar {
    background: var(--bg-primary);
  }
  .navbar-links {
    background: var(--bg-primary);
  }
}

/* ===================== 动画 ===================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 主题切换过渡 */
*, *::before, *::after {
  transition-property: background-color, border-color, color;
  transition-duration: var(--transition);
}

/* ===================== 工具类 ===================== */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.text-muted { color: var(--text-muted) !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
