/* ============================================================
   WinIsland 官网样式
   单页、零依赖：浅色为默认，暗色由 <html data-theme="dark"> 切换
   （内联脚本会在首屏渲染前写入 data-theme，无需媒体查询兜底）
   ============================================================ */

:root {
  color-scheme: light;

  --bg: #f3f4f6;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --stroke: rgba(0, 0, 0, 0.07);
  --stroke-strong: rgba(0, 0, 0, 0.12);
  --text: #191919;
  --text-2: #5c5c5c;
  --text-3: #8b8b8b;
  --accent: #0a84ff;
  --accent-hover: #0071d9;
  --accent-text: #ffffff;
  --accent-soft: rgba(10, 132, 255, 0.1);
  --code-bg: rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07), 0 18px 40px rgba(0, 0, 0, 0.09);
  --radius: 12px;
  --radius-lg: 16px;
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #1b1b1b;
  --bg-alt: #232323;
  --card: #2a2a2a;
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-2: #c7c7c7;
  --text-3: #979797;
  --accent: #3aa0ff;
  --accent-hover: #5cb2ff;
  --accent-text: #ffffff;
  --accent-soft: rgba(58, 160, 255, 0.16);
  --code-bg: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI Variable Text', 'Segoe UI', 'Microsoft YaHei UI', 'PingFang SC', system-ui, -apple-system,
    sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.wrap--narrow {
  max-width: 720px;
}

.only-wide {
  display: none;
}

@media (min-width: 900px) {
  .only-wide {
    display: inline;
  }
}

/* ---------------- 顶栏 ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--stroke);
}

.nav__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  font-size: 15.5px;
  color: var(--text);
}

.nav__brand:hover {
  text-decoration: none;
}

.nav__brand img {
  border-radius: 7px;
}

.nav__links {
  display: flex;
  gap: 4px;
  margin-left: 6px;
}

.nav__links a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav__links a:hover {
  background: var(--code-bg);
  color: var(--text);
  text-decoration: none;
}

.nav__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--code-bg);
  color: var(--text);
  text-decoration: none;
}

.icon-moon,
:root[data-theme='dark'] .icon-sun {
  display: none;
}

:root[data-theme='dark'] .icon-moon {
  display: block;
}

@media (max-width: 720px) {
  .nav__links {
    display: none;
  }
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border: 1px solid var(--stroke-strong);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: color-mix(in srgb, var(--text) 5%, var(--card));
  text-decoration: none;
}

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

.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-text);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 32%, transparent);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--lg {
  padding: 12px 28px;
  font-size: 15px;
}

/* ---------------- Hero ---------------- */

.hero {
  padding: 88px 0 72px;
  text-align: center;
  background:
    radial-gradient(900px 380px at 50% -12%, var(--accent-soft), transparent 70%),
    var(--bg);
}

.hero__badge {
  display: inline-block;
  margin: 0 0 18px;
  padding: 5px 14px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}

.hero__title {
  margin: 0 0 16px;
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero__desc {
  max-width: 620px;
  margin: 0 auto 28px;
  color: var(--text-2);
  font-size: 16px;
}

.hero__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__meta {
  margin: 18px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

.hero__shot {
  margin: 52px auto 0;
  max-width: 460px;
}

.hero__shot img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-md);
}

/* ---------------- 通用区块 ---------------- */

.section {
  padding: 76px 0;
}

.section--alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
}

.section__title {
  margin: 0 0 10px;
  font-size: 27px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.section__lead {
  margin: 0 0 36px;
  color: var(--text-2);
  max-width: 640px;
}

/* ---------------- 截图 ---------------- */

.shots {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: start;
}

.shots__col {
  display: grid;
  gap: 20px;
}

.shot {
  margin: 0;
}

.shot img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
}

.shot figcaption {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 13px;
}

@media (max-width: 820px) {
  .shots {
    grid-template-columns: minmax(0, 1fr);
  }

  .shot--tall img {
    max-height: 520px;
    width: auto;
    margin: 0 auto;
  }
}

/* ---------------- 功能卡片 ---------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 16px;
}

.card {
  padding: 22px 22px 20px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--stroke-strong);
  box-shadow: var(--shadow-md);
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.card h3 {
  margin: 0 0 7px;
  font-size: 16px;
  font-weight: 650;
}

.card p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

/* ---------------- 插件 ---------------- */

.plugins {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.plugin {
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.plugin__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.plugin__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot, var(--accent));
  flex: 0 0 auto;
}

.plugin h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
}

.plugin p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.tag {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
}

.tag--builtin {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------------- 下载 ---------------- */

.download {
  padding: 30px 28px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.download__reqs {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.download__reqs li {
  position: relative;
  padding-left: 26px;
  color: var(--text-2);
  font-size: 14.5px;
}

.download__reqs li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 9px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.download__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.download__note {
  margin: 18px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--code-bg);
  font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
  font-size: 0.92em;
}

/* ---------------- 页脚 ---------------- */

.footer {
  padding: 48px 0 32px;
  background: var(--bg-alt);
  border-top: 1px solid var(--stroke);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}

.footer__brand {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.footer__brand img {
  border-radius: 6px;
  margin-top: 3px;
}

.footer__brand p {
  margin: 2px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
}

.footer__links a {
  color: var(--text-2);
}

.footer__links a:hover {
  color: var(--accent);
}

.footer__legal {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--stroke);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  color: var(--text-3);
  font-size: 12.5px;
}

@media (max-width: 640px) {
  .hero {
    padding: 64px 0 56px;
  }

  .section {
    padding: 56px 0;
  }

  .wrap {
    padding: 0 18px;
  }
}

/* ---------------- 下载页 ---------------- */

.nav__links a.is-current {
  color: var(--text);
  background: var(--code-bg);
}

.dl-head {
  padding: 64px 0 8px;
  text-align: center;
}

.dl-head h1 {
  margin: 0 0 14px;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -0.02em;
}

.dl-head p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-2);
}

.dl-head__meta {
  margin-top: 14px !important;
  color: var(--text-3) !important;
  font-size: 12.5px;
}

.dl-body {
  padding-top: 36px;
}

.dl-status {
  padding: 18px 20px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-2);
  font-size: 14px;
}

.dl-status--error {
  border-color: color-mix(in srgb, #d13438 45%, var(--stroke));
}

.dl-card {
  padding: 26px 26px 22px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.dl-card__head {
  margin-bottom: 20px;
}

.dl-card__tag {
  margin: 0 0 6px;
  font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.dl-card__name {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.dl-card__meta {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dl-rows {
  display: grid;
  gap: 10px;
}

.dl-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--text) 2%, var(--card));
}

.dl-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dl-row__info strong {
  font-size: 15px;
}

.dl-row__hint,
.dl-row__meta {
  color: var(--text-3);
  font-size: 12.5px;
}

.dl-row__actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dl-row__actions .btn {
  padding: 8px 16px;
  font-size: 13.5px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .dl-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dl-row__actions {
    margin-left: 0;
  }

  .dl-row__actions .btn {
    flex: 1;
  }
}

/* 更新说明 */
.dl-notes {
  margin-top: 22px;
  border-top: 1px solid var(--stroke);
}

.dl-notes > summary {
  padding-top: 14px;
  cursor: pointer;
  font-weight: 640;
  font-size: 14.5px;
  color: var(--text);
  list-style: none;
}

.dl-notes > summary::-webkit-details-marker {
  display: none;
}

.dl-notes > summary::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 8px;
  color: var(--text-3);
  transition: transform 0.15s ease;
}

.dl-notes[open] > summary::before {
  transform: rotate(90deg);
}

.md {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
}

.md h3,
.md h4,
.md h5,
.md h6 {
  margin: 18px 0 6px;
  color: var(--text);
  font-size: 14.5px;
}

.md p {
  margin: 0 0 8px;
}

.md ul {
  margin: 0 0 10px;
  padding-left: 22px;
}

.md li {
  margin: 3px 0;
}

.md blockquote {
  margin: 0 0 10px;
  padding: 6px 14px;
  border-left: 3px solid var(--accent-soft);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: 0 8px 8px 0;
}

.md code {
  font-size: 0.9em;
}

/* 历史版本 */
.dl-history__title {
  margin: 42px 0 14px;
  font-size: 18px;
  font-weight: 660;
}

.dl-history__item {
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 10px;
  overflow: hidden;
}

.dl-history__item > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.dl-history__item > summary::-webkit-details-marker {
  display: none;
}

.dl-history__item > summary:hover {
  background: color-mix(in srgb, var(--text) 3%, transparent);
}

.dl-history__tag {
  font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.dl-history__name {
  color: var(--text);
  font-size: 14px;
}

.dl-history__date {
  margin-left: auto;
  color: var(--text-3);
  font-size: 12.5px;
}

.dl-history__body {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--stroke);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .card,
  .btn {
    transition: none;
  }
}
