/* ============================================================
   应星官网 · 站点样式（/changelog/assets/site.css）
   布局参考 Nemostation：通栏场景（整幅点击切换风格）、
   居中品牌与介绍、1280px 双栏内容（左下载约 360-392px、右更新）；
   更新栏内部再分版本列（窄）与所选内容列（宽），两列独立滚动。
   无分区标题与卡片，仅以留白分组、细竖线分栏；
   窄屏回退为 680px 窄栏纵向堆叠（内部分栏保留）。
   主题：水墨（浅纸）/ 青绿（绢色），均为浅色底、同一布局。
   字体：系统可用中文字形（宋体系作标题声部，黑体系作正文）。
   ============================================================ */

:root,
html[data-theme="ink"] {
    --paper: #f7f7f7;
    --surface: #ffffff;
    --ink-strong: #202020;
    --ink-body: #383838;
    --ink-mute: #666666;
    --hairline: rgba(32, 32, 32, 0.16);
    --hairline-strong: rgba(32, 32, 32, 0.34);
    --accent: #222222;
    --accent-ink: #ffffff;
    --accent-hover: #383838;
    --seal: #555555;
    --wash: rgba(32, 32, 32, 0.045);
    --focus: #202020;
    --river-water: #969696;
    --river-water-far: #a7a7a7;
    --river-shore: #8e8e8e;
    --river-reed: #b0b0b0;
    --river-blue: #999999;
    --river-leaf: #999999;
    --river-earth: #aaaaaa;
}

html[data-theme="green"] {
    --paper: #f4f4ed;            /* 浅绢；矿物青绿集中在山水中 */
    --surface: #fafbf6;
    --ink-strong: #1c2e27;
    --ink-body: #2d423a;
    --ink-mute: #53685b;         /* 对绢 ≥ 4.5:1 */
    --hairline: rgba(28, 46, 39, 0.2);
    --hairline-strong: rgba(28, 46, 39, 0.42);
    --accent: #245d62;           /* 青绿主色的深色调 */
    --accent-ink: #f4f4ed;
    --accent-hover: #224b3c;
    --seal: #1f5f66;             /* 石青 */
    --wash: rgba(44, 95, 76, 0.07);
    --focus: #1c2e27;
    --river-water: #94aca0;
    --river-water-far: #a7bbb3;
    --river-shore: #8b9e91;
    --river-reed: #96ac9c;
    --river-blue: #8199a5;
    --river-leaf: #91a38d;
    --river-earth: #aaa58b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }


html {
    font-size: 16px;
    scroll-behavior: smooth;
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    background: var(--paper);
    color: var(--ink-body);
    line-height: 1.8;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* 品牌和正文从顶部自然排布，山水不再吸收视口剩余高度。 */
.hero {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

::selection { background: var(--ink-strong); color: var(--paper); }

a { color: inherit; }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 2px;
}

/* —— 跳转链接（键盘可达） —— */
.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100;
    padding: 0.55em 1.1em;
    background: var(--surface);
    border: 1px solid var(--hairline-strong);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--ink-strong);
    text-decoration: none;
    transform: translateY(-300%);
}

.skip-link:focus { transform: none; }

/* —— 品牌标识（居中呈现于 hero h1，唯一品牌位） —— */
.brand-mark { width: 22px; height: 22px; display: block; }

/* hero 锁定组合内随 h1 字号缩放 */
.hero-brand .brand-mark { width: 1.4em; height: 1.4em; }

.brand-name {
    font-family: "Songti SC", "STSong", "Noto Serif CJK SC",
        "Source Han Serif SC", "SimSun", serif;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: 0.18em;
}

/* —— 顶部通栏场景：控制高度，让主体在首屏内保持靠上 —— */
.scene-stage {
    position: relative;
    flex: 0 0 auto;
    height: clamp(192px, 34vh, 288px);
    height: clamp(192px, 34svh, 288px);
    border-bottom: 1px solid var(--hairline);
    background: var(--paper);
    transition: background-color 0.4s ease;
}

#scene-canvas {
    display: block;
    width: 100%;
    /* 画布随舞台撑满，不自带固定高度：舞台决定高度，隔离画布固有尺寸 */
    height: 100%;
    background: var(--paper);
}

/* 整幅山水即风格切换（水墨 ⇄ 青绿）；按钮绝对定位铺满舞台，不参与高度布局；
   禁用态等图片就绪后由脚本解除 */
.scene-switch {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    appearance: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: var(--paper);
    font: inherit;
    line-height: 0;
    cursor: pointer;
}

.scene-switch:disabled { cursor: default; }

.scene-switch:focus-visible {
    outline-offset: -3px;
    border-radius: 0;
}

/* 屏幕阅读器专用说明（scene-switch 的 aria-describedby） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* 评审模式（?review=1）专用对照工具：默认隐藏，公共页面不可见 */
.review-tools {
    position: absolute;
    left: 0.85rem;
    bottom: 0.85rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.45em 0.85em;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--paper);
}

.review-format { display: inline-flex; gap: 0.4rem; }

.review-format button {
    appearance: none;
    border: 1px solid var(--hairline-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--ink-mute);
    font: inherit;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    padding: 0.22em 0.85em;
    cursor: pointer;
}

.review-format button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.review-stats {
    font-size: 0.6875rem;
    color: var(--ink-mute);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* —— 居中介绍（仅品牌 + 定位语，无操作按钮）；上下留出从容间距 —— */
.hero-intro {
    max-width: 42rem;
    margin-inline: auto;
    padding: clamp(1.1rem, 2.4vw, 1.6rem) 1.25rem 0;
    text-align: center;
}

.hero-intro h1 {
    font-family: "Songti SC", "STSong", "Noto Serif CJK SC",
        "Source Han Serif SC", "SimSun", serif;
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.12em;
    color: var(--ink-strong);
}

/* 图标 + 应星 居中锁定组合（hero 内唯一品牌标识） */
.hero-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    white-space: nowrap;
}

.hero-brand .brand-name {
    font-size: 1em; /* 继承 h1 的 clamp 字号，覆盖角落小字尺寸 */
    margin-right: -0.18em; /* 视觉居中修正 */
}

.positioning {
    margin-top: 0.55rem;
    font-size: 0.875rem;
    line-height: 1.5;
    letter-spacing: 0.12em;
    margin-right: -0.12em;
    color: var(--ink-mute);
}

/* —— 双栏内容（桌面：左下载栏约 360-392px、右更新占余量；顶部对齐，无卡片；
      非增长 flex 子项、自然流高度；不随窗口高度下移） —— */
.content-columns {
    --content-left-edge: max(0px, calc((100% - 1280px) / 2));
    position: relative;
    z-index: 1;
    width: calc(100% - var(--content-left-edge));
    max-width: 1600px;
    margin-inline: var(--content-left-edge) 0;
    margin-block: 0;
    padding-inline: clamp(1.25rem, 6vw, 6rem);
    padding-right: clamp(1.25rem, 2vw, 3rem);
    display: grid;
    grid-template-columns: minmax(22.5rem, 24.5rem) minmax(0, 1fr);
    column-gap: clamp(4rem, 6vw, 6rem);
    align-items: start;
}

/* 中等桌面（881-1024）：下载列收窄一档，保护右侧阅读列的有效宽度 */
@media (min-width: 881px) and (max-width: 1024px) {
    .content-columns {
        grid-template-columns: minmax(19.5rem, 22rem) minmax(0, 1fr);
        column-gap: clamp(2.5rem, 4vw, 3rem);
    }
}

/* 无分区标题：品牌介绍到内容、内容到页脚以紧凑留白衔接（不压缩行距与文字） */
.section {
    min-width: 0;
    padding-top: clamp(1.25rem, 2vw, 2rem);
    scroll-margin-top: 1.5rem;
}

.section:last-of-type { padding-bottom: 0.5rem; }

.load-status {
    font-size: 0.875rem;
    color: var(--ink-mute);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.load-status:empty { display: none; }

/* 固定兼容说明；加载与错误提示由独立状态区承担 */
.download-note {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ink-mute);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.5rem;
}

.download-note:empty { display: none; }

.retry-button {
    appearance: none;
    border: 1px solid var(--hairline-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--ink-body);
    font: inherit;
    font-size: 0.875rem;
    letter-spacing: 0.06em;
    padding: 0.4em 1.1em;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.retry-button:hover { background: var(--surface); color: var(--ink-strong); }

/* —— 下载（两列名称/操作，非卡片、无分行细线；行距以留白撑开） —— */
.download-row {
    display: grid;
    grid-template-areas: "name action";
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 1.25rem;
    padding-block: 0.85rem;
}

.download-name { grid-area: name; min-width: 0; }

.download-name h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.05em;
    color: var(--ink-strong);
}

.download-name p {
    margin-top: 0.3rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ink-mute);
}

/* 平台图标：内联 SVG 装饰，灰阶 currentColor；M 芯片方标、Intel 长标按比例 */
.platform-icon {
    flex: none;
    width: 1.25em;
    height: 1.25em;
    color: currentColor;
}

.platform-icon[data-platform="intel"] { width: 2.5rem; height: auto; max-height: 1.25em; object-fit: contain; }

/* 施工中状态：虚线描边示意未就绪，非链接、无交互承诺 */
.download-pending {
    grid-area: action;
    font-size: 0.875rem;
    line-height: 1.5;
    letter-spacing: 0.08em;
    color: var(--ink-mute);
    border: 1px dashed var(--hairline-strong);
    border-radius: 8px;
    padding: 0.45em 1.2em;
    white-space: nowrap;
}

/* 版本号位于名称块内（描述行下方），默认隐藏；
   仅当该架构缺少下载时由脚本显现（如 v0.x.x · 暂无下载） */
.download-version {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ink-mute);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.download-link {
    grid-area: action;
    display: inline-block;
    border: 1px solid var(--hairline-strong);
    border-radius: 8px;
    padding: 0.45em 1.2em;
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    color: var(--ink-strong);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.download-link:hover {
    background: var(--surface);
    border-color: var(--ink-strong);
}

a.download-link[aria-disabled="true"],
a.download-link[aria-disabled="true"]:hover {
    border-color: var(--hairline);
    background: transparent;
    color: var(--ink-mute);
    cursor: not-allowed;
}

.noscript-note {
    font-size: 0.875rem;
    color: var(--ink-mute);
    margin-top: 0.75rem;
}

/* —— 更新阅读器（左版本栏、右所选内容；两列在共享高度内独立滚动） ——
   桌面高度容纳 5 个版本，避免底部多留一段空位；长内容独立滚动 */
.update-reader {
    display: grid;
    grid-template-columns: 7.25rem minmax(0, 1fr);
    column-gap: 2rem;
    height: 18rem;
}

.version-nav {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
    scrollbar-width: thin;
}

.version-list { list-style: none; }

/* 版本条目以留白分组，无逐行细线 */
.version-item { padding-block: 0.2rem; }

/* 原生按钮选择版本；行内布局 + 从容纵向内距（0.85rem，5 项仍免滚动）；
   选中态仅以墨色左侧短线 + 深字色示意 */
.version-option {
    appearance: none;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.45rem;
    width: 100%;
    border: 0;
    border-left: 2px solid transparent;
    background: transparent;
    color: var(--ink-mute);
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    padding: 0.85rem 0.35rem 0.85rem 0.6rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.version-option:hover { color: var(--ink-strong); }

.version-option[aria-pressed="true"] {
    color: var(--ink-strong);
    border-left-color: var(--ink-strong);
}

.version-number {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-strong);
    font-variant-numeric: tabular-nums;
}

/* 版本栏内的编号弱化，跟随按钮选中态着色；「最新」标签同行排布 */
.version-option .version-number {
    color: inherit;
    font-size: 0.9375rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.version-tag {
    font-size: 0.625rem;
    letter-spacing: 0.14em;
    color: var(--seal);
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 0.06em 0.55em 0.06em 0.68em;
    white-space: nowrap;
}

/* 内容列：可聚焦后键盘滚动 */
.version-content {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding-left: 1.5rem;
    scrollbar-width: thin;
}

/* 内容不再重复所选版本标题：日期独占一行、安静地右对齐，无分隔头 */
.version-date {
    display: block;
    text-align: right;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ink-mute);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.changelog-body { padding: 0.4rem 0.25rem 0.25rem 0; }

.changelog-group + .changelog-group { margin-top: 1.5rem; }

.changelog-group ul { list-style: none; }

.changelog-group li {
    position: relative;
    padding-left: 1.05em;
    font-size: 0.9375rem;
    line-height: 1.9;
    margin-block: 0.6rem;
    overflow-wrap: anywhere; /* 长串字符（如链接）换行，窄屏不撑破 */
}

.changelog-group li::before {
    content: "";
    position: absolute;
    left: 0.1em;
    top: 0.82em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--hairline-strong);
}

/* —— 页脚：宽屏同一行置底，窄屏按组自然换行 —— */
.site-footer {
    position: relative;
    isolation: isolate;
    margin-top: auto;
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.35rem 1rem;
    transition: background-color 0.4s ease;
}

/* 江面作为较高的底景向内容区渐淡，不占用额外布局高度。 */
.footer-river {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: max(360px, 33.7239583333vw); /* 1536×518 紧边画框，去掉水纹下方的透明空区 */
    overflow: hidden;
    pointer-events: none;
    user-select: none;
    z-index: -1;
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.07) 12%, rgba(0, 0, 0, 0.25) 28%, rgba(0, 0, 0, 0.58) 48%, rgba(0, 0, 0, 0.85) 72%, #000 100%);
}

.footer-river svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; transform: translateY(2px); } /* 抵消字形抗锯齿留下的底边像素，画面出血由外层裁切 */
.footer-river .river-green,
.footer-river .river-mobile { display: none; }
html[data-theme="green"] .footer-river .river-ink { display: none; }
html[data-theme="green"] .footer-river .river-green.river-desktop { display: block; }
.footer-river .river-source-art { fill: var(--river-shore); }
.footer-river .river-water-near { fill: var(--river-water); }
.footer-river .river-water-far { fill: var(--river-water-far); }
.footer-river .river-tone-blue { fill: var(--river-blue); }
.footer-river .river-tone-leaf { fill: var(--river-leaf); }
.footer-river .river-tone-earth { fill: var(--river-earth); }
.footer-river text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 6.5px;
    letter-spacing: 0;
    white-space: pre;
}
.site-footer > p { text-shadow: 0 0 3px var(--paper), 0 0 6px var(--paper), 0 0 9px var(--paper); }
.content-columns { text-shadow: 0 0 3px var(--paper), 0 0 5px var(--paper); }
.river-water { animation: river-current 28s ease-in-out infinite alternate; animation-play-state: paused; }
.river-water-far { animation-duration: 41s; animation-direction: alternate-reverse; }
.footer-river[data-active="true"] .river-water { animation-play-state: running; }
html[data-motion-paused] .footer-river .river-water { animation-play-state: paused; }

/* 宽屏画幅变高后，上半部继续留给品牌与阅读，下半部再渐显。 */
@media (min-width: 1600px) {
    .footer-river {
        mask-image: linear-gradient(to bottom, transparent 0%, transparent 30%, rgba(0, 0, 0, 0.08) 45%, rgba(0, 0, 0, 0.28) 60%, rgba(0, 0, 0, 0.58) 76%, rgba(0, 0, 0, 0.85) 90%, #000 100%);
    }
}

@keyframes river-current {
    from { transform: translateX(-16px); }
    to { transform: translateX(16px); }
}

@media (max-width: 880px) {
    /* 窄屏采用同一原画的纵向取景，避免把整幅横图缩成底部窄条。 */
    .footer-river {
        height: clamp(300px, 90vw, 440px);
    }
    .footer-river .river-desktop,
    html[data-theme="green"] .footer-river .river-green.river-desktop { display: none; }
    html[data-theme="ink"] .footer-river .river-ink.river-mobile,
    html[data-theme="green"] .footer-river .river-green.river-mobile { display: block; }
}

.footer-copy {
    margin-top: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ink-mute);
}

.footer-legal-line {
    margin-top: 0;
    font-size: 0.875rem;
}

.footer-legal-line,
.footer-filing {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0.75rem;
}

.footer-legal-line a,
.footer-filing a {
    color: var(--ink-mute);
    text-decoration: underline;
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
    transition: color 0.15s ease;
}

.footer-legal-line a { margin-inline: 0; }

.footer-legal-line a:hover,
.footer-filing a:hover { color: var(--ink-strong); }

.footer-filing {
    margin-top: 0;
    font-size: 0.875rem;
    color: var(--ink-mute);
}

.footer-filing a { margin-inline: 0; }

.footer-filing img {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-right: 0.3em;
}

/* —— 窄屏 / 平板：外层双栏纵向堆叠（回退 680px 窄栏）；
   更新阅读器保留内部分栏：窄版本栏在左、内容在右 —— */
@media (max-width: 880px) {
    .content-columns {
        --content-left-edge: 0px;
        width: 100%;
        max-width: 680px;
        margin-inline: auto;
        padding-inline: clamp(1.25rem, 6vw, 6rem);
        grid-template-columns: minmax(0, 1fr);
    }

    .update-reader {
        grid-template-columns: 5.625rem minmax(0, 1fr);
        column-gap: 1rem;
        height: auto; /* 高度随内容增长，约至 23rem 后各自滚动 */
    }

    /* 窄栏把“最新”标签换到下一行，版本号本身保持完整。 */
    .version-option { flex-wrap: wrap; }
    .version-option .version-number { white-space: nowrap; }

    .version-nav { max-height: 23rem; }

    .version-content {
        max-height: 23rem;
        padding-left: 1.1rem;
    }
}

/* —— 窄屏 —— */
@media (max-width: 640px) {
    .scene-stage {
        height: clamp(192px, 29vh, 272px);
        height: clamp(192px, 29svh, 272px);
    }

    .review-tools { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
}

/* —— 减少动态 —— */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
