/* 软件官网公开端的样式。
   整站没有一行 JS，所以版式全靠这里：明暗两套跟随系统，不提供切换开关
   （访客来看的是软件，不是主题设置）。 */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --border: #e6e6ea;
  --text: #16161a;
  --muted: #6e6e76;
  --accent: #0a7cff;
  --accent-soft: rgba(10, 124, 255, 0.1);
  --accent-line: rgba(10, 124, 255, 0.34);
  --accent-contrast: #ffffff;
  /* 装饰用的固定色：不用 color-mix 是为了兼容老一点的浏览器——
     算不出来的话那一行会整条失效，背景会直接变透明 */
  --grad-2: #b06bff;
  --glow-2: rgba(176, 107, 255, 0.18);
  --grid-line: rgba(120, 120, 135, 0.14);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --shadow-sm: 0 1px 2px rgba(16, 16, 24, 0.06);
  --shadow-md: 0 10px 30px rgba(16, 16, 24, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --max: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08080a;
    --bg-soft: #101014;
    --surface: #131318;
    --surface-2: #17171d;
    --border: #26262e;
    --text: #f4f4f6;
    --muted: #9c9ca6;
    --accent: #3f9bff;
    --accent-soft: rgba(63, 155, 255, 0.16);
    --accent-line: rgba(63, 155, 255, 0.42);
    --accent-contrast: #06121f;
    --glow-2: rgba(176, 107, 255, 0.24);
    --grid-line: rgba(255, 255, 255, 0.06);
    --nav-bg: rgba(8, 8, 10, 0.72);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

a { color: var(--accent); }

/* —— 顶部导航（吸顶） —— */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  min-width: 0;
}

.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}

.nav-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--grad-2));
  color: #fff;
  font-size: 14px;
}

.nav-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 14px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-links a:hover { color: var(--text); }

/* —— 按钮 —— */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease,
    background 0.16s ease;
}

.button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.button:active { transform: translateY(0); }

.button-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 6px 18px var(--accent-soft);
}

.button-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.button-large { min-height: 48px; padding: 0 26px; font-size: 16px; }
.button-nav { min-height: 34px; padding: 0 16px; font-size: 14px; }

/* —— 页面骨架 —— */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 48px;
}

.section { margin: 72px 0 0; scroll-margin-top: 84px; }

.section-head { margin-bottom: 22px; }

.section-title {
  font-size: 26px;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.015em;
}

.section-note { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* —— 首屏 —— */
.hero {
  position: relative;
  margin-top: 32px;
  padding: 72px 32px 64px;
  border-radius: 28px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  text-align: center;
}

/* 一团柔光 + 一层细网格：不引入任何图片，纯 CSS */
.hero-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 420px;
  background:
    radial-gradient(45% 60% at 30% 40%, var(--accent-soft), transparent 70%),
    radial-gradient(40% 55% at 72% 30%, var(--glow-2), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.hero-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(60% 60% at 50% 40%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 40%, #000, transparent 75%);
}

.hero-body { position: relative; }

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.hero-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--grad-2));
  color: #fff;
  font-size: 42px;
  font-weight: 600;
}

.hero-title {
  font-size: clamp(34px, 5.4vw, 54px);
  line-height: 1.1;
  margin: 24px 0 12px;
  letter-spacing: -0.025em;
}

.hero-summary {
  margin: 0 auto;
  max-width: 620px;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--muted);
}

.hero-pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0;
  margin: 22px 0 0;
}

.pill {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  background: var(--surface);
}

.pill-strong {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  font-weight: 600;
}

.hero-actions {
  margin: 30px 0 0;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 技术栈标签：比平台胶囊轻，跟平台分两行，一眼能看出哪个是「能装在哪」、
   哪个是「用什么写的」 */
.stack {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}

.stack-label { color: var(--muted); font-size: 13px; }

.stack-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}

.tag {
  font-size: 12.5px;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

/* —— 功能介绍 —— */
.features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 14px;
}

.feature-name { font-size: 17px; margin: 0 0 6px; letter-spacing: -0.01em; }

.feature-text { margin: 0; color: var(--muted); font-size: 14.5px; }

/* —— 下载 —— */
.files { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }

.file {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.file:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
}

.file-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.file-badge-link { background: var(--bg-soft); color: var(--muted); }

.file-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }

.file-name {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.file-sub { color: var(--muted); font-size: 13px; }

.file .button { flex: none; min-height: 36px; padding: 0 18px; font-size: 14px; }

.hint { color: var(--muted); font-size: 13px; margin: 12px 2px 0; }

/* —— 更新日志（时间线） —— */
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.timeline-item { position: relative; padding-bottom: 14px; }

.timeline-dot {
  position: absolute;
  left: -25px;
  top: 9px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border);
}

.timeline-latest .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.release {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px 18px;
  box-shadow: var(--shadow-sm);
}

.release-head {
  cursor: pointer;
  padding: 12px 0;
  display: flex;
  gap: 12px;
  align-items: baseline;
  list-style: none;
}

.release-head::-webkit-details-marker { display: none; }

.release-head::after {
  content: "＋";
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

.release[open] .release-head::after { content: "－"; }

.release-version { font-weight: 600; }
.release-date { color: var(--muted); font-size: 13px; }

.release-notes {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14.5px;
}

/* —— 关于与自定义区块（Markdown 渲染出来的 HTML） —— */
.prose { max-width: 72ch; color: var(--muted); }

.custom { color: var(--muted); }

/* 渲染出来的正文：标题、列表、图片、代码、表格都在这里统一收拾。
   两个容器共用一套规则——作者在「详细介绍」与「自定义区块」里写的东西
   长得应该一样。 */
.prose h1, .prose h2, .prose h3, .prose h4,
.custom h1, .custom h2, .custom h3, .custom h4 {
  color: var(--text);
  line-height: 1.3;
  margin: 28px 0 12px;
  letter-spacing: -0.015em;
}

.prose h1, .custom h1 { font-size: 24px; }
.prose h2, .custom h2 { font-size: 21px; }
.prose h3, .custom h3 { font-size: 17px; }
.prose h4, .custom h4 { font-size: 15px; }

.prose p, .custom p { margin: 0 0 16px; }

.prose ul, .prose ol, .custom ul, .custom ol { margin: 0 0 16px; padding-left: 22px; }
.prose li, .custom li { margin: 5px 0; }

.prose blockquote, .custom blockquote {
  margin: 0 0 16px;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.prose img, .custom img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin: 6px 0;
}

.prose code, .custom code {
  font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 5px;
}

.prose pre, .custom pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
}

.prose pre code, .custom pre code { background: none; border: none; padding: 0; }

.prose table, .custom table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 0 0 16px;
}

.prose th, .prose td, .custom th, .custom td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.prose thead th, .custom thead th { background: var(--bg-soft); color: var(--text); font-weight: 500; }

.prose hr, .custom hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* 卡片里的说明（功能介绍、更新日志）也用 Markdown，但排得紧凑些：
   它们本来就是几行字，不该出现大标题与整块留白。 */
.feature-text p:last-child,
.release-notes p:last-child,
.release-notes ul:last-child,
.release-notes ol:last-child { margin-bottom: 0; }

.feature-text ul, .feature-text ol,
.release-notes ul, .release-notes ol { margin: 6px 0 0; padding-left: 20px; }

.feature-text code, .release-notes code {
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 5px;
}

.feature-text img, .release-notes img { border-radius: 10px; margin: 6px 0; }

/* —— 页脚 —— */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.footer-line { margin: 4px 0; }

/* —— 错误页 —— */
.page-error { text-align: center; padding-top: 120px; }
.error-code { font-size: 56px; font-weight: 600; margin: 0; color: var(--muted); }
.error-title { font-size: 24px; margin: 8px 0 12px; }
.error-message { color: var(--muted); margin: 0; }

/* —— 窄屏 —— */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-inner { padding: 10px 16px; }
  .page { padding: 0 16px 32px; }
  .hero { padding: 48px 20px 44px; border-radius: 22px; }
  .section { margin-top: 52px; }
  .file { flex-wrap: wrap; }
  .file .button { width: 100%; }
  .footer { padding: 24px 16px 36px; }
}

/* —— 公告（M6）：级别徽标、置顶标记与列表卡片。
   公告站复用这份浅色 Apple 风样式表（没有 HomeNexus 的公告成品可搬），
   这里只补公告特有的几条；明暗两套各给一组色，避免亮色下警告色发灰。 */
:root {
  --notice-info: #0a7cff;
  --notice-warning: #b26a00;
  --notice-danger: #c0272d;
  --notice-info-soft: rgba(10, 124, 255, 0.12);
  --notice-warning-soft: rgba(178, 106, 0, 0.14);
  --notice-danger-soft: rgba(192, 39, 45, 0.14);
}
@media (prefers-color-scheme: dark) {
  :root {
    --notice-info: #5aa9ff;
    --notice-warning: #e0a44a;
    --notice-danger: #ff6b6b;
    --notice-info-soft: rgba(90, 169, 255, 0.18);
    --notice-warning-soft: rgba(224, 164, 74, 0.18);
    --notice-danger-soft: rgba(255, 107, 107, 0.18);
  }
}
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.notice-item {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.notice-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice-title { margin: 0; font-size: 17px; font-weight: 600; }
.notice-title a { color: var(--text); text-decoration: none; }
.notice-title a:hover { color: var(--accent); }
.notice-level {
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  color: var(--notice-info);
  background: var(--notice-info-soft);
}
.notice-level.is-warning { color: var(--notice-warning); background: var(--notice-warning-soft); }
.notice-level.is-critical { color: var(--notice-danger); background: var(--notice-danger-soft); }
.notice-pin {
  padding: 2px 8px;
  font-size: 12px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: var(--bg-soft);
}
.notice-meta { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.notice-body { margin-top: 18px; }
