:root {
  --bg: #1e1e1e;
  --panel: #252526;
  --panel-head: #2d2d30;
  --border: #3e3e42;
  --text: #cccccc;
  --text-dim: #858585;
  --title: #e0e0e0;
  --accent: #007acc;
  --accent-hover: #1177bb;
  --keyword: #569cd6;
  --green: #4ec9b0;
  --danger: #f14c4c;
  --radius: 8px;
  --max-w: 1120px;
  --scrollbar-size: 14px;
  --scrollbar-thumb: rgba(121, 121, 121, 0.4);
  --scrollbar-thumb-hover: rgba(100, 100, 100, 0.7);
  --scrollbar-thumb-active: rgba(191, 191, 191, 0.4);
  --nav-height: 52px;
  --legal-notice-color: #f14c4c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  height: 100%;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow: hidden;
}

img,
video {
  max-width: 100%;
}

*::-webkit-scrollbar { width: var(--scrollbar-size); height: var(--scrollbar-size); }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
  border: 3px solid transparent;
  border-radius: 7px;
  min-height: 32px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
  border: 3px solid transparent;
}
*::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
  background-clip: padding-box;
  border: 3px solid transparent;
}
*::-webkit-scrollbar-corner { background: transparent; }

a { color: var(--keyword); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-nav {
  position: relative;
  flex: 0 0 auto;
  z-index: 1000;
  min-height: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
  background: #323233;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 24px;
  padding-top: env(safe-area-inset-top, 0px);
  gap: 8px 12px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* #app 为壳层；滚动在 .page-scroll，避免 fixed 导航位于 overflow 内在移动端不绘制 */
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
  display: flex;
  flex-direction: column;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--glass-radius-xs, 12px);
  background: #3e3e42;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--title);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.site-nav.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-nav.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-nav.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--title);
  margin-right: auto;
}

.nav-brand img,
.nav-brand .nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  background: transparent;
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 13px;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--keyword);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn-secondary {
  background: #3e3e42;
  color: var(--text);
}

.btn-secondary:hover {
  background: #4a4a4a;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--keyword);
  color: var(--keyword);
  text-decoration: none;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.page-main {
  flex: 1 1 auto;
  padding: 32px 0 64px;
}

.hero {
  /* 仅设上下内边距，避免 padding 简写覆盖 .container 的左右留白 */
  padding-top: 56px;
  padding-bottom: 48px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(0, 122, 204, 0.15);
  border: 1px solid rgba(0, 122, 204, 0.35);
  border-radius: 999px;
  font-size: 12px;
  color: var(--keyword);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  color: var(--title);
  line-height: 1.25;
  margin-bottom: 16px;
  font-weight: 600;
}

.hero p {
  font-size: 16px;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 用更高优先级盖过 .hero p / .page-head p 的灰色文案色 */
.legal-notice,
.hero p.legal-notice,
.page-head p.legal-notice {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 4px;
  box-sizing: border-box;
  text-align: center;
  color: var(--legal-notice-color, #f14c4c);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}

.legal-notice--hero,
.hero p.legal-notice--hero {
  margin-top: 22px;
  max-width: 720px;
}

.legal-notice--page,
.page-head p.legal-notice--page {
  margin-top: 14px;
  max-width: 100%;
}

/* 与上方密码行同宽（在 .download-modal-body 内，不再另加左右 margin） */
.legal-notice--modal {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  border-radius: 8px;
  background: color-mix(in srgb, var(--legal-notice-color, #f14c4c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--legal-notice-color, #f14c4c) 28%, transparent);
}

.section {
  margin-top: 56px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: 22px;
  color: var(--title);
  margin-bottom: 8px;
}

.section-head p {
  color: var(--text-dim);
  font-size: 14px;
}

.page-intro {
  margin-top: 0;
}

.page-head {
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: clamp(26px, 4vw, 32px);
  color: var(--title);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 8px;
}

.page-head p {
  font-size: 16px;
  color: var(--text-dim);
  margin: 0;
  max-width: none;
}

.page-head p.tagline {
  color: var(--keyword);
}

.page-head .tutorial-badge {
  margin-bottom: 10px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-media {
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}

.card-media:hover {
  border-color: #569cd6;
}

/*
 * 两层视觉：卡片壳 + 内容。
 * 图片顶/左/右贴齐卡片边（禁止 padding/圆角再造内嵌框），文案区单独 8px 内边距。
 */
.showcase-card,
.editor-card,
.tutorial-item,
.screenshot-card,
.feature-card,
.video-player-wrap {
  padding: 0;
  overflow: hidden;
}

.card-media > .media-img,
.card-media > .media-video {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  display: block;
  background: transparent;
  border: none;
  border-radius: 0;
}

.card-media > .media-video {
  background: #111;
}

/* 未加载完用底色占位；缩短淡入，缓存命中时 JS 会立刻加 is-loaded */
.card-media > .media-img {
  opacity: 0;
  transition: opacity 0.08s ease-out;
  content-visibility: auto;
}

.card-media > .media-img.is-loaded {
  opacity: 1;
}

.card-media > .media-img.is-link {
  cursor: pointer;
}

.card-media > .media-video {
  aspect-ratio: 16 / 9;
  max-height: 520px;
  background: #111;
}

.card-media > .media-video.is-ready {
  background: #000;
}

.media-video-embed,
iframe.media-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 520px;
  border: 0;
  display: block;
  background: #111;
}

/* 无媒体数据：不占图片/视频框，仅文案占位 */
.media-empty {
  display: block;
  padding: 18px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
  background: transparent;
  border: none;
  aspect-ratio: auto;
  height: auto;
  max-height: none;
}

.card-media > .media-empty {
  padding: 18px 8px 4px;
}

.card-media > .media-img + *,
.card-media > .media-video + *,
.card-media > .media-empty + * {
  padding-top: 8px;
  padding-left: 8px;
  padding-right: 8px;
}

.card-media > :not(.media-img):not(.media-video):not(.media-empty) {
  padding-left: 8px;
  padding-right: 8px;
}

.card-media > :not(.media-img):not(.media-video):not(.media-empty):last-child {
  padding-bottom: 8px;
}

.card-media > .card-actions {
  padding-left: 8px;
  padding-right: 8px;
  padding-bottom: 8px;
}

.card-media > h3,
.card-media > h4 {
  margin: 0;
}

.card-media > p {
  margin: 6px 0 0;
}

.card-media.tutorial-item:hover {
  border-color: var(--keyword);
}

.card-media h3,
.card-media h4 {
  color: var(--title);
}

.card-media h3 {
  font-size: 20px;
}

.card-media h4 {
  font-size: 15px;
}

.card-media p {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}

.card-media .card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 24px;
}

.showcase-card > p {
  font-size: 15px;
  line-height: 1.8;
}

/* 首页双栏产品面板：并排展示，避免上下叠大卡片 */
.home-products {
  margin-top: 40px;
}

.home-spotlight {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.home-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
}

.home-panel-media {
  flex: 0 0 auto;
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.home-panel-media > .media-img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: transparent;
  opacity: 0;
  transition: opacity 0.12s ease-out;
}

.home-panel-media > .media-img.is-loaded {
  opacity: 1;
}

.home-panel-media > .media-img.is-link {
  cursor: pointer;
}

.home-panel-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 20px;
}

.home-panel-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--keyword);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--keyword) 35%, transparent);
  background: color-mix(in srgb, var(--keyword) 12%, transparent);
}

.home-panel-body h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--title);
  line-height: 1.35;
}

.home-panel-body p {
  margin: 0;
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-dim);
}

.home-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.home-feature {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.home-feature-media {
  background: transparent;
}

.home-feature-media > .media-img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  display: block;
  background: transparent;
  opacity: 0;
  transition: opacity 0.12s ease-out;
}

.home-feature-media > .media-img.is-loaded {
  opacity: 1;
}

.home-feature-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-feature-body h4 {
  margin: 0;
  font-size: 15px;
  color: var(--title);
}

.home-feature-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dim);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.feature-card > .media-img {
  height: 140px;
  aspect-ratio: auto;
}

.editor-card {
  text-align: center;
}

.editor-card > .media-img {
  transition: opacity 0.15s;
}

.editor-card > .media-img.is-loaded:hover {
  opacity: 0.92;
}

.editor-card > .btn {
  margin: 8px auto;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* 教程列表：导航下区域内分栏，页脚备案始终完整可见 */
html.tutorial-list-view .page-scroll {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

html.tutorial-list-view .site-footer {
  flex: 0 0 auto;
}

html.tutorial-list-view .tutorial-page-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 20px 0 12px;
}

html.tutorial-list-view .tutorial-page-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 0;
}

html.tutorial-list-view .tutorial-page-section > .page-head {
  flex: 0 0 auto;
  margin-bottom: 16px;
}

html.tutorial-list-view .tutorial-page-section.container {
  max-width: 1280px;
}

.tutorial-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 20px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.tutorial-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.tutorial-detail {
  min-width: 0;
}

.tutorial-detail-head {
  margin-bottom: 20px;
}

.tutorial-detail-head h2 {
  font-size: 22px;
  color: var(--title);
  margin: 0 0 10px;
  line-height: 1.35;
}

.tutorial-detail-summary {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.65;
  max-width: 72ch;
}

.tutorial-detail-loading,
.tutorial-detail-placeholder {
  min-height: 120px;
}

.tutorial-detail-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: var(--text-dim);
  font-size: 14px;
}

.tutorial-detail-extra {
  margin-top: 20px;
}

.tutorial-toc {
  position: relative;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  align-self: stretch;
}

.tutorial-toc-head {
  flex: 0 0 auto;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--title);
  background: var(--panel-head);
  border-bottom: 1px solid var(--border);
}

.tutorial-toc-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  /* 普通文档流，避免 flex 子项被压扁导致标题裁切与点击热点错位 */
  display: block;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.tutorial-toc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  height: auto;
  min-height: calc(1.45em + 16px);
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 10px;
  margin: 0 0 2px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  z-index: 0;
}

.tutorial-toc-item-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tutorial-toc-type {
  flex: 0 0 auto;
  margin-bottom: 0;
  font-size: 10px;
  padding: 1px 6px;
  line-height: 1.4;
}

.tutorial-toc-item:last-child {
  margin-bottom: 0;
}

.tutorial-toc-item:hover {
  background: rgba(86, 156, 214, 0.12);
  color: var(--title);
}

.tutorial-toc-item.active {
  background: rgba(0, 122, 204, 0.18);
  color: var(--keyword);
}

.tutorial-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.tutorial-badge.article {
  background: rgba(78, 201, 176, 0.15);
  color: var(--green);
}

.tutorial-badge.video {
  background: rgba(86, 156, 214, 0.15);
  color: var(--keyword);
}

/* 教程列表：折叠钮/遮罩默认隐藏，仅移动端 .tutorial-list-view 内显示 */
.tutorial-sidebar-toggle,
.tutorial-sidebar-overlay {
  display: none;
}

.article-content {
  padding: 28px 32px;
  font-size: 15px;
  line-height: 1.8;
}

.article-content h3 {
  color: var(--title);
  margin: 24px 0 12px;
  font-size: 18px;
}

.article-content h3:first-child {
  margin-top: 0;
}

.article-content p {
  margin-bottom: 12px;
  color: var(--text);
}

.article-content img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin: 12px 0;
  display: block;
  background: transparent;
  object-fit: contain;
}

.video-player-wrap > .media-video {
  width: 100%;
  height: 100%;
  display: block;
  max-height: 520px;
  border-radius: 0;
  aspect-ratio: 16 / 9;
  background: #111;
  object-fit: contain;
}

.video-player-wrap > .media-video-embed,
.video-player-wrap > iframe.media-video {
  object-fit: unset;
  border: 0;
}

.video-player-wrap > .media-empty {
  padding: 28px 16px;
}

.page-loading {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
}

.site-footer {
  flex: 0 0 auto;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.site-copyright {
  margin-bottom: 6px;
  line-height: 1.6;
}

.site-icp {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 6px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  line-height: 1;
}

.site-icp a {
  color: var(--text-dim);
  text-decoration: none;
  word-break: keep-all;
}

.site-icp a:hover {
  color: var(--keyword);
  text-decoration: underline;
}

.site-icp-sep {
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  line-height: 1;
  flex-shrink: 0;
}

.site-icp-miit,
.site-icp-police {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  vertical-align: middle;
}

.site-icp-police-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  background: transparent;
}

.site-icp-police-icon[hidden] {
  display: none !important;
}

.download-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
}

.download-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.download-name {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--title);
  line-height: 1.4;
  word-break: break-word;
}

.download-passwords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.download-pwd {
  font-size: 13px;
  color: var(--text-dim);
}

.download-pwd code {
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(86, 156, 214, 0.12);
  color: var(--keyword);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  word-break: break-all;
}

.download-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.download-version {
  color: var(--keyword);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.download-btn {
  flex-shrink: 0;
  min-width: 88px;
  text-align: center;
  text-decoration: none;
}

.download-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.download-modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.download-modal {
  width: min(92vw, 420px);
  background:
    linear-gradient(180deg, rgba(0, 122, 204, 0.08) 0%, transparent 42%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 20px 56px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.download-modal-overlay.show .download-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.download-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-head);
}

.download-modal-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(145deg, var(--accent-hover), var(--accent));
  box-shadow: 0 4px 14px rgba(0, 122, 204, 0.35);
}

.download-modal-head-text {
  flex: 1;
  min-width: 0;
  padding-top: 1px;
}

.download-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--title);
  line-height: 1.35;
}

.download-modal-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.download-modal-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  margin: -4px -6px 0 0;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.download-modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--title);
}

.download-modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 链接密码 + 压缩包密码同一行；下方法律声明与二者宽度之和（含 gap）对齐 */
.download-modal-pwds {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.download-modal-pwds .download-modal-row {
  flex: 1 1 0;
  min-width: 0;
}

.download-modal-row {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.download-modal-row.is-ok {
  border-color: rgba(78, 201, 176, 0.35);
  background: rgba(78, 201, 176, 0.08);
}

.download-modal-row.is-warn {
  border-color: rgba(241, 76, 76, 0.35);
  background: rgba(241, 76, 76, 0.08);
}

.download-modal-row-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.download-modal-row.is-ok .download-modal-row-label {
  color: var(--green);
}

.download-modal-row.is-warn .download-modal-row-label {
  color: #f48771;
}

.download-modal-pwd {
  display: block;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #4fc3f7;
  word-break: break-all;
  line-height: 1.35;
}

.download-modal-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

.download-modal-actions {
  padding: 0 18px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.download-modal-actions .btn {
  min-width: 104px;
  padding: 10px 18px;
}

.download-modal-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .download-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .download-modal {
    width: 100%;
    max-width: none;
    border-radius: 14px 14px 0 0;
    max-height: min(92vh, 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .download-modal-actions {
    flex-direction: column-reverse;
  }

  .download-modal-actions .btn {
    width: 100%;
  }

  .download-meta {
    flex-wrap: wrap;
    gap: 10px;
  }

  .download-btn {
    width: 100%;
  }

  .card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .card-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .page-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .legal-notice,
  .hero p.legal-notice,
  .page-head p.legal-notice {
    font-size: 12px;
    line-height: 1.7;
  }

  .legal-notice--modal {
    width: 100%;
    margin: 0;
    font-size: 11px;
  }

  .hero h1 {
    font-size: clamp(24px, 7vw, 32px);
  }

  .page-head h1 {
    font-size: clamp(22px, 6.5vw, 28px);
  }

  .download-modal-pwd {
    font-size: 16px;
  }

  .download-modal-pwds {
    gap: 8px;
  }

  .download-modal-pwds .download-modal-row {
    padding: 10px 10px;
  }

  .download-modal-row-label {
    font-size: 11px;
  }

  .site-icp {
    font-size: 11px;
    gap: 4px 6px;
    line-height: 1.4;
  }
}

.empty-state {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  width: 100%;
}

@media (max-width: 768px) {
  .site-nav {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav-brand span {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-actions {
    margin-left: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0 12px;
    border-top: 1px solid var(--border);
    order: 10;
  }

  .site-nav.nav-open .nav-links {
    display: flex;
  }

  .nav-links a {
    padding: 12px 8px;
    font-size: 15px;
    border-radius: 6px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(86, 156, 214, 0.12);
  }

  .container {
    padding: 0 14px;
  }

  /* 教程列表：移动端侧栏目录（与编辑器侧栏交互一致） */
  html.tutorial-list-view {
    --tutorial-sidebar-width: min(280px, 86vw);
    --tutorial-sidebar-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --tutorial-sidebar-duration: 0.32s;
  }

  html.tutorial-list-view .tutorial-page-main {
    padding: 12px 0 8px;
  }

  html.tutorial-list-view .tutorial-page-section > .page-head {
    margin-bottom: 10px;
  }

  html.tutorial-list-view .tutorial-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
  }

  html.tutorial-list-view .tutorial-toc {
    position: fixed !important;
    top: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
    left: 0;
    bottom: 0;
    width: var(--tutorial-sidebar-width);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translate3d(-100%, 0, 0);
    transition: transform var(--tutorial-sidebar-duration) var(--tutorial-sidebar-ease), box-shadow var(--tutorial-sidebar-duration) var(--tutorial-sidebar-ease);
    height: auto;
    max-height: none;
    background: var(--panel);
    border: none;
    border-right: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    align-self: auto;
    will-change: transform;
    backface-visibility: hidden;
  }

  html.tutorial-list-view .tutorial-toc.open {
    transform: translate3d(0, 0, 0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.42);
  }

  html.tutorial-list-view .tutorial-toc-head {
    display: block;
  }

  html.tutorial-list-view .tutorial-toc-nav {
    flex: 1 1 auto;
    min-height: 0;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
  }

  html.tutorial-list-view .tutorial-toc-item {
    display: flex;
    width: 100%;
    max-width: none;
    min-height: calc(1.45em + 16px);
    margin: 0 0 2px;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
  }

  html.tutorial-list-view .tutorial-toc-item.active {
    background: rgba(0, 122, 204, 0.18);
    color: var(--keyword);
    border-color: transparent;
  }

  html.tutorial-list-view .tutorial-sidebar-toggle {
    display: flex;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translate3d(0, -50%, 0);
    width: 24px;
    height: 72px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    z-index: 1002;
    transition: transform var(--tutorial-sidebar-duration) var(--tutorial-sidebar-ease), width 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0 var(--glass-radius-xs, 12px) var(--glass-radius-xs, 12px) 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-left: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    will-change: transform;
    backface-visibility: hidden;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: inherit;
    font: inherit;
  }

  html.tutorial-list-view .tutorial-sidebar-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.92);
    transition: transform 0.25s var(--tutorial-sidebar-ease), color 0.2s ease;
  }

  html.tutorial-list-view .tutorial-sidebar-toggle-icon svg {
    width: 18px;
    height: 18px;
    display: block;
  }

  html.tutorial-list-view .tutorial-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    width: 28px;
  }

  html.tutorial-list-view .tutorial-sidebar-toggle.open {
    transform: translate3d(var(--tutorial-sidebar-width), -50%, 0);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  html.tutorial-list-view .tutorial-sidebar-toggle.open .tutorial-sidebar-toggle-icon {
    transform: rotate(180deg);
  }

  html.tutorial-list-view .tutorial-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--tutorial-sidebar-duration) var(--tutorial-sidebar-ease), visibility 0s linear var(--tutorial-sidebar-duration);
    will-change: opacity;
    backface-visibility: hidden;
  }

  html.tutorial-list-view .tutorial-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity var(--tutorial-sidebar-duration) var(--tutorial-sidebar-ease), visibility 0s linear 0s;
  }

  .page-main {
    padding: 20px 0 48px;
  }

  .hero {
    padding-top: 36px;
    padding-bottom: 28px;
  }

  .hero p {
    font-size: 15px;
    margin-bottom: 20px;
  }

  .legal-notice,
  .hero p.legal-notice,
  .page-head p.legal-notice {
    font-size: 13px;
    padding: 0 2px;
    color: #f14c4c;
  }

  .legal-notice--hero,
  .hero p.legal-notice--hero {
    margin-top: 18px;
  }

  .legal-notice--page,
  .page-head p.legal-notice--page {
    margin-top: 12px;
  }

  .legal-notice--modal {
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    font-size: 12px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-actions .btn,
  .card-actions .btn,
  .download-btn,
  .page-actions .btn {
    min-height: 44px;
    padding: 10px 16px;
    box-sizing: border-box;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .section {
    margin-top: 36px;
  }

  .section-head h2 {
    font-size: 20px;
  }

  .feature-grid,
  .screenshot-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-spotlight {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .home-panel-body {
    padding: 18px 16px 16px;
  }

  .home-panel-body h3 {
    font-size: 18px;
  }

  .home-panel-actions .btn {
    min-height: 44px;
  }

  .feature-card > .media-img {
    height: 160px;
  }

  .card-media h3 {
    font-size: 18px;
  }

  .article-content {
    padding: 18px 14px;
    font-size: 14px;
  }

  .article-content pre,
  .article-content table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .video-player-wrap > .media-video,
  .card-media > .media-video {
    max-height: none;
  }

  .download-card {
    flex-wrap: wrap;
    padding: 14px 14px;
    gap: 12px;
  }

  .download-info {
    flex: 1 1 100%;
  }

  .download-meta {
    width: 100%;
    justify-content: space-between;
  }

  .download-btn {
    min-width: 96px;
  }

  .download-modal-overlay {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .download-modal {
    width: min(100%, 420px);
  }

  .download-modal-close {
    width: 40px;
    height: 40px;
    margin: -6px -8px 0 0;
  }

  .site-footer {
    padding: 20px 14px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .page-loading {
    padding: 56px 16px;
  }

  /* 防止 iOS 聚焦输入框时强制缩放（即便 viewport 已锁） */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}
