/* ==========================================================================
   Serial Studio 官网样式
   配色沿用应用主题：
   主蓝 #3968AC · 浅蓝 #5B8DCE · 主绿 #4A9D5F · 发送橙 #D97706
   ========================================================================== */

:root {
  --blue: #3968ac;
  --blue-dark: #2d5389;
  --blue-light: #5b8dce;
  --blue-soft: rgba(57, 104, 172, 0.12);
  --green: #4a9d5f;
  --green-soft: rgba(74, 157, 95, 0.12);
  --orange: #d97706;
  --orange-soft: rgba(217, 119, 6, 0.12);

  --bg: #fafafa;
  --bg-alt: #f0f0f0;
  --surface: #ffffff;
  --border: #c9cdd0;
  --border-light: #e4e7ea;
  --text: #19232d;
  --text-muted: #788d9c;

  --shadow-sm: 0 1px 2px rgba(25, 35, 45, 0.06), 0 1px 3px rgba(25, 35, 45, 0.08);
  --shadow-md: 0 8px 24px rgba(25, 35, 45, 0.10);
  --shadow-lg: 0 24px 60px rgba(25, 35, 45, 0.16);

  --radius-sm: 8px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --radius-xl: 32px;

  --max-width: 1120px;
  --font-sans: "Microsoft YaHei", "PingFang SC", "Segoe UI", -apple-system,
    BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease,
    border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn--lg {
  padding: 14px 26px;
  font-size: 16px;
}

.btn--sm {
  padding: 9px 18px;
  font-size: 14px;
}

.btn--primary {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(57, 104, 172, 0.28);
}

.btn--primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 8px 22px rgba(57, 104, 172, 0.34);
  transform: translateY(-1px);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--blue-light);
  color: var(--blue);
  transform: translateY(-1px);
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* 顶部导航 */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.navbar.is-scrolled {
  border-bottom-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}

.navbar__inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand__text strong {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand__text small {
  font-size: 12px;
  color: var(--text-muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  padding: 8px 14px;
  font-size: 15px;
  color: var(--text-muted);
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav__link:hover {
  color: var(--text);
  background: rgba(57, 104, 172, 0.08);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 38px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.lang-toggle:hover {
  color: var(--blue);
  border-color: var(--blue-light);
  background: var(--blue-soft);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 150px 0 80px;
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
}

.hero__glow--one {
  width: 460px;
  height: 460px;
  background: var(--blue-soft);
  top: -120px;
  right: -60px;
}

.hero__glow--two {
  width: 360px;
  height: 360px;
  background: var(--green-soft);
  bottom: -100px;
  left: -80px;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  align-items: center;
  gap: 48px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid rgba(57, 104, 172, 0.18);
  border-radius: 999px;
}

.badge__dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(74, 157, 95, 0.2);
}

.hero__title {
  margin-top: 22px;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero__title-accent {
  color: var(--blue);
}

.hero__subtitle {
  margin-top: 22px;
  max-width: 520px;
  font-size: 17px;
  color: var(--text-muted);
}

.hero__actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero__note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.hero__visual {
  position: relative;
}

.window {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.window__body {
  width: 100%;
  height: auto;
}

/* 数据条 */
.stats {
  padding: 24px 0 56px;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.stat__value {
  display: block;
  font-size: 34px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
}

.stat__plus {
  font-size: 22px;
}

.stat__label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 通用 section */
.section {
  padding: 88px 0;
}

.section--alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.section__header {
  max-width: 680px;
  margin: 0 auto 56px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.section__title {
  margin-top: 12px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section__lead {
  margin-top: 16px;
  font-size: 16px;
  color: var(--text-muted);
}

/* 功能卡片 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.feature-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.feature-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  margin-bottom: 20px;
}

.feature-card__icon svg {
  width: 26px;
  height: 26px;
}

.feature-card__icon--blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.feature-card__icon--green {
  color: var(--green);
  background: var(--green-soft);
}

.feature-card__icon--orange {
  color: var(--orange);
  background: var(--orange-soft);
}

.feature-card__title {
  font-size: 18px;
  margin-bottom: 10px;
}

.feature-card__text {
  font-size: 14px;
  color: var(--text-muted);
}

/* 插件 */
.plugins-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
}

.plugin-chip {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.plugin-chip:hover {
  color: var(--blue);
  border-color: var(--blue-light);
  transform: translateY(-2px);
}

.plugin-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.plugin-showcase__title {
  font-size: 24px;
  margin-bottom: 14px;
}

.plugin-showcase__text {
  font-size: 15px;
  color: var(--text-muted);
}

.plugin-showcase__list {
  margin-top: 20px;
  list-style: none;
  display: grid;
  gap: 10px;
}

.plugin-showcase__list li {
  position: relative;
  padding-left: 26px;
  font-size: 14px;
  color: var(--text);
}

.plugin-showcase__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6 9 17l-5-5' fill='none' stroke='%234a9d5f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.plugin-showcase__visual {
  display: flex;
  justify-content: center;
}

.mini-dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.mini-dashboard__gauge,
.mini-dashboard__chart,
.mini-dashboard__leds {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.mini-dashboard__leds {
  grid-column: span 2;
  flex-direction: row;
  justify-content: center;
}

.mini-gauge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0 72%, var(--border-light) 72% 100%);
  position: relative;
}

.mini-gauge::before {
  content: "";
  position: absolute;
  inset: 14px;
  background: var(--surface);
  border-radius: 50%;
}

.mini-gauge span {
  position: relative;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.mini-dashboard__chart svg {
  width: 100%;
  height: 96px;
}

.mini-label {
  font-size: 12px;
  color: var(--text-muted);
}

.mini-led {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.mini-led--on {
  background: var(--green);
  box-shadow: 0 0 10px rgba(74, 157, 95, 0.7);
}

.mini-led--off {
  background: var(--border);
}

/* 截图 */
.screenshot {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.screenshot__frame {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.screenshot__frame img {
  width: 100%;
  height: auto;
}

.screenshot__caption {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

/* 脚本 */
.script-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.script-card {
  min-width: 0;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.script-card__badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #3776ab;
  background: rgba(55, 118, 171, 0.12);
  border-radius: 6px;
}

.script-card__badge--lua {
  color: #2c2c82;
  background: rgba(44, 44, 130, 0.12);
}

.script-card__title {
  margin-top: 18px;
  font-size: 20px;
}

.script-card__text {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.script-card__code {
  display: block;
  width: 100%;
  height: 435px;
  max-width: 100%;
  margin-top: 20px;
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
  color: #d6deeb;
  background: #1e2a3a;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

/* 下载 */
.download {
  background: linear-gradient(180deg, var(--bg) 0%, #eef4fb 100%);
}

.download-card {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 32px 36px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.download-card__platform {
  display: flex;
  align-items: center;
  gap: 18px;
}

.download-card__logo {
  width: 54px;
  height: 54px;
  color: var(--blue);
  flex: none;
}

.download-card__title {
  font-size: 20px;
}

.download-card__meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.download-card__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.download-btn {
  display: flex;
  width: 100%;
}

.download-card__hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* 页脚 */
.footer {
  padding: 40px 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border-light);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.footer__brand strong {
  font-size: 15px;
}

.footer__brand p {
  font-size: 12px;
  color: var(--text-muted);
}

.footer__meta {
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
}

.footer__meta p + p {
  margin-top: 4px;
}

/* 滚动显现动画 */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* 响应式 */
@media (max-width: 960px) {
  .hero__inner,
  .plugin-showcase {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 120px;
  }

  .hero__visual {
    order: -1;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 24px 20px;
    background: rgba(250, 250, 250, 0.98);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .nav.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav__link {
    padding: 14px 8px;
    font-size: 16px;
  }

  .menu-toggle {
    display: flex;
  }

  .navbar__actions .btn--sm {
    display: none;
  }

  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid,
  .script-grid {
    grid-template-columns: 1fr;
  }

  .download-card {
    flex-direction: column;
    text-align: center;
  }

  .download-card__platform {
    flex-direction: column;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__meta {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   更新历史时间线（用户下载页）
   ========================================================================== */
.timeline {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 0 0 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 12px;
  bottom: 8px;
  width: 2px;
  background: var(--border-light);
}

.timeline__item {
  position: relative;
  padding: 0 0 22px 0;
}

.timeline__marker {
  position: absolute;
  left: -28px;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

.timeline__item--beta .timeline__marker {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-soft);
}

.timeline__card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.timeline__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline__version {
  font-weight: 700;
  font-size: 17px;
}

.timeline__badge,
.timeline__latest {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  line-height: 1.6;
}

.timeline__badge {
  background: var(--blue-soft);
  color: var(--blue);
}

.timeline__item--beta .timeline__badge {
  background: var(--orange-soft);
  color: var(--orange);
}

.timeline__latest {
  background: var(--green-soft);
  color: var(--green);
}

.timeline__date {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 13px;
}

.timeline__notes {
  margin: 10px 0 0;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.6;
}

.timeline__downloads {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.timeline__link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.timeline__link:hover {
  background: var(--blue);
  color: #fff;
}

.timeline__empty {
  color: var(--text-muted);
  text-align: center;
  padding: 32px 0;
}

@media (max-width: 768px) {
  .timeline {
    padding-left: 24px;
  }

  .timeline__marker {
    left: -24px;
  }

  .timeline__date {
    margin-left: 0;
    width: 100%;
  }
}
