/* 浏览页面共用视觉：浅灰背景、白色卡片、蓝色主操作，移动端优先收缩。 */
:root {
    --blue: #1677ff;
    --blue-dark: #0963df;
    --blue-soft: #edf5ff;
    --ink: #172d4b;
    --muted: #70819a;
    --line: #dde7f3;
    --bg: #f3f8fd;
    --card: #ffffff;
    --green: #137a50;
    --orange: #a15e00;
    --danger: #b42318;
    --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 16px/1.6 "Microsoft YaHei", "Segoe UI", sans-serif; }
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select, input, textarea { max-width: 100%; }
button { cursor: pointer; }
/* Consolas 没有中文字形，中文改用正文的微软雅黑，避免落到宋体；与版本号组件一致。 */
pre, code { font-family: Consolas, "SFMono-Regular", "Microsoft YaHei", monospace; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.app-shell { min-height: 100vh; }
.app-topbar { display: flex; align-items: center; gap: 32px; min-height: 80px; padding: 0 36px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 3px 15px rgb(51 96 145 / 3%); }
.app-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 205px; color: var(--ink); }
.app-brand strong, .app-brand small { display: block; white-space: nowrap; }
.app-brand strong { font-size: 24px; }
.app-brand-mark { display: grid; flex-shrink: 0; width: 46px; height: 46px; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #248cff, #0872ff); }
.app-brand-mark .icon { width: 28px; height: 28px; }
.icon { display: inline-block; flex-shrink: 0; width: 20px; height: 20px; vertical-align: middle; }
.app-nav { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex: 1; align-self: stretch; min-width: 0; }
.nav-primary, .nav-actions { display: flex; align-items: center; gap: 10px; }
.app-nav a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border: 1px solid transparent; border-radius: 7px; color: #47607f; font-weight: 500; white-space: nowrap; }
.app-nav a:hover, .app-nav a.is-active { color: var(--blue); background: var(--blue-soft); }
.nav-actions a { border-color: var(--line); }
.app-account { position: relative; white-space: nowrap; }
.app-account summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.app-account summary::-webkit-details-marker { display: none; }
.app-account summary > .icon { width: 15px; }
/* 账号按钮显示当前用户名，窄屏下过长时截断。 */
.app-account-name { max-width: 10em; overflow: hidden; text-overflow: ellipsis; }
.account-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #eaf0f8; color: #697e9b; }
.account-menu { position: absolute; right: 0; top: calc(100% + 12px); z-index: 40; width: 160px; padding: 6px; background: white; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 35px rgb(40 70 110 / 12%); }
.account-menu a, .account-menu button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 5px; background: transparent; text-align: left; color: var(--ink); }
.account-menu a:hover, .account-menu button:hover { background: var(--blue-soft); color: var(--blue); }
.account-menu form { margin: 0; }
.account-menu-role { margin: 0 0 4px; padding: 6px 12px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.app-main { width: min(1400px, 100%); margin: 0 auto; padding: 32px 36px 48px; min-width: 0; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; min-width: 0; }
.page-header h1 { margin: 0; color: var(--ink); font-size: clamp(24px, 4vw, 32px); line-height: 1.25; }
.page-subtitle { margin: 5px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* 页头中需要整组换行的同类按钮。 */
.page-action-group { display: inline-flex; gap: 8px; align-items: center; }
/* 路径导航（navigation_tags.path_nav）：上级为蓝色链接，当前页加粗深色，无对应页面的分类和分隔符为灰字。 */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 20px; color: var(--muted); font-size: 15px; }
.breadcrumbs > * { min-width: 0; overflow-wrap: anywhere; }
.breadcrumbs a { color: var(--blue); }
.breadcrumbs strong { color: var(--ink); font-weight: 700; }
.path-nav-separator { color: #a9b6c7; }
.breadcrumbs a:hover, .primary-link, .link-list a, .text-action { color: var(--blue); }
.breadcrumbs a:hover, .primary-link:hover, .link-list a:hover, .text-action:hover { text-decoration: underline; }

.card { min-width: 0; margin-bottom: 20px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 8px rgb(30 50 80 / 3%); }
.toolbar-card { padding: 16px 20px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 21px; }
.section-heading p { margin: 3px 0 0; }
.muted { color: var(--muted); }
.small-text { font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--blue); font-weight: 600; line-height: 1.3; }
.button:hover { background: var(--blue-soft); }
.button-primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button-primary:hover { color: #fff; background: var(--blue-dark); border-color: var(--blue-dark); }
.button-quiet { background: #fff; border-color: var(--line); }
.button-small { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.button-danger { color: var(--danger); }
/* 页面上的删除类操作：红字红框，放在按钮组最后并用 .action-divider 竖线隔开；确认删除的提交按钮为红底。 */
.button.button-danger { color: var(--danger); border-color: #e9aaa6; background: #fff; }
.button.button-danger:hover { color: var(--danger); border-color: var(--danger); background: #fff2f3; }
.button.button-primary.button-danger { color: #fff; border-color: #b33b47; background: #b33b47; }
.button.button-primary.button-danger:hover { color: #fff; border-color: #9a2f3a; background: #9a2f3a; }
.action-divider { flex: 0 0 1px; align-self: stretch; min-height: 26px; margin: 0 4px; background: #c9d6e6; }
.action-divider.is-wrapped { visibility: hidden; }
/* 桌面按确认图恢复正文和操作控件尺度；窄屏继续使用各模块既有收缩规则。 */
@media (min-width: 1000px) {
    body { font-size: 18px; }
    .app-brand strong { font-size: 26px; }
    .app-brand-mark { width: 50px; height: 50px; }
    .app-brand-mark .icon { width: 30px; height: 30px; }
    .page-header h1 { font-size: 36px; }
    .section-heading h2 { font-size: 24px; }
    .button:not(.button-small) { min-height: 48px; }
}
.text-action { display: inline-block; padding: 2px 0; font-weight: 600; }
/* 列表行内的多个操作链接；删除类链接用警示色。 */
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.text-action.text-danger { color: var(--danger); }
.inline-form { display: inline; }
.notice { margin: 0 0 16px; padding: 11px 13px; border: 1px solid #c8d9f8; border-radius: 7px; color: #204b94; background: #f1f6ff; overflow-wrap: anywhere; }
.notice-error, .error { color: var(--danger); background: #fff4f2; border-color: #f1c6c0; }
.notice-success { color: var(--green); background: #effaf5; border-color: #bfe4d1; }
.notice-warning { color: #8a5100; background: #fff8e9; border-color: #efd89e; }
.notice-muted { color: #526985; background: #f6f8fb; border-color: #dfe7f0; }
.message-stack { margin-bottom: 18px; }
.badge { display: inline-flex; align-items: center; min-height: 22px; margin: 2px 4px 2px 0; padding: 2px 7px; border-radius: 999px; background: #f0f3f7; color: #566577; font-size: 12px; white-space: nowrap; }
.badge-blue { color: #1e52bf; background: var(--blue-soft); }
.badge-green { color: var(--green); background: #e8f7ef; }
.badge-orange { color: var(--orange); background: #fff2dc; }
.badge-red { color: var(--danger); background: #ffeded; }
.badge-muted { color: #657386; background: #edf0f3; }
/* 内容可能很长的徽标（如特殊返回说明）允许换行，避免撑出容器后被截掉。 */
.badge-wrap { max-width: 100%; border-radius: 10px; white-space: normal; overflow-wrap: anywhere; }

.toolbar, .toolbar-form, .filter-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.toolbar > input, .toolbar > select, .toolbar > textarea { min-height: 38px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: var(--ink); }
.filter-grid > label { flex: 1 1 180px; }
.filter-grid .align-end { align-self: flex-end; }
.search-box { display: block; flex: 1 1 260px; }
.search-box-wide { flex-basis: 500px; }
label, .field { display: flex; flex-direction: column; gap: 5px; color: var(--ink); font-weight: 600; }
label > input, label > select, label > textarea, .field > input, .field > select, .field > textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff; color: var(--ink); font-weight: 400; }
label > textarea, .field > textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgb(36 91 218 / 20%); outline-offset: 1px; border-color: var(--blue); }
.field i { color: var(--danger); font-style: normal; }
.field small { color: var(--muted); font-weight: 400; }
.field-help { margin: 0; color: var(--muted); font-size: 12px; font-weight: 400; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table, .card table { width: 100%; min-width: 720px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: var(--ink); background: #f0f6fc; font-size: 14px; font-weight: 700; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.table-actions { white-space: nowrap; }.table-actions a, .table-actions button { display: inline; padding: 0; border: 0; background: transparent; color: var(--blue); font-weight: 600; }.table-actions a:hover, .table-actions button:hover { text-decoration: underline; }
.table-actions > * + * { margin-left: 14px; }
.table-actions .button-danger { color: var(--danger); }
.truncate-cell { max-width: 280px; overflow-wrap: anywhere; }
.photo-column { width: 76px; }
.thumb { display: block; width: 54px; height: 42px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.photo-placeholder { display: grid; width: 54px; height: 42px; place-items: center; border-radius: 6px; color: var(--muted); background: #f0f3f7; font-size: 11px; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.pagination-status { color: var(--muted); font-size: 13px; }
.pagination[hidden] { display: none; }
.empty-state { padding: 42px 12px; text-align: center; color: var(--muted); }
.empty-state h2 { margin: 9px 0 3px; color: var(--ink); font-size: 18px; }
.empty-state p { margin: 0; }
.empty-icon { display: inline-grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 24px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); gap: 18px; align-items: start; }
.compact-info > div { min-width: 0; }
.compact-info span, .definition-list dt { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; }
.compact-info { display: flex; flex-wrap: wrap; gap: 26px; }
.compact-info strong { margin-right: 20px; }
.definition-list { display: grid; grid-template-columns: minmax(70px, .35fr) minmax(0, 1fr); gap: 12px 15px; margin: 20px 0 0; }
.definition-list dd { margin: 0; overflow-wrap: anywhere; }
.subheading { margin: 22px 0 8px; font-size: 15px; }
.stack-list, .link-list, .mini-list { display: grid; gap: 0; }
.list-row, .mini-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.list-row:first-child, .mini-row:first-child { padding-top: 0; }
.list-row:last-child, .mini-row:last-child { padding-bottom: 0; border-bottom: 0; }
.list-row-main { min-width: 0; flex: 1; }
.list-row-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 2px; white-space: nowrap; color: var(--muted); }
.list-row-meta strong { color: var(--ink); font-size: 18px; }
.row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.list-row p, .mini-row small { display: block; margin: 3px 0 0; overflow-wrap: anywhere; }
.mini-row { align-items: center; }
.mini-row strong, .mini-row small { display: block; }
.mini-row:hover { background: #fbfcff; }
.link-list a { padding: 11px 0; border-bottom: 1px solid var(--line); }
.link-list a:last-child { border-bottom: 0; }
.trace-list { display: grid; gap: 0; }
.trace-row { position: relative; display: flex; align-items: flex-start; gap: 14px; min-height: 72px; padding: 5px 0 20px 0; }
.trace-row.is-current { font-weight: 700; }
.trace-index { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); }
.trace-arrow { position: absolute; left: 11px; bottom: 0; color: #a8b4c3; }

.markdown-body { overflow-wrap: anywhere; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.2em 0 .45em; line-height: 1.3; }
.markdown-body h1 { font-size: 24px; }.markdown-body h2 { font-size: 20px; }.markdown-body h3 { font-size: 17px; }
.markdown-body p { margin: .65em 0; }.markdown-body ul, .markdown-body ol { padding-left: 1.6em; }.markdown-body blockquote { margin: 1em 0; padding: 4px 14px; border-left: 3px solid #bed0f4; color: var(--muted); background: #f8faff; }
.markdown-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }.markdown-body th, .markdown-body td { padding: 7px 10px; border: 1px solid var(--line); }.markdown-body code { padding: 2px 4px; border-radius: 4px; background: #f0f3f7; }.markdown-body pre { padding: 12px; border-radius: 7px; background: #f5f7fa; }
/* 长文本默认折叠到 6 行（text-clamp.js 加 is-clamped），首尾段落不留外边距以便准确测量。 */
.clamp-text.is-clamped { max-height: 9.75em; overflow: hidden; }
.clamp-text > :first-child { margin-top: 0; }
.clamp-text > :last-child { margin-bottom: 0; }
.clamp-toggle { margin-top: 4px; padding: 0; border: 0; background: none; cursor: pointer; }
/* .text-action 自带 display，需显式让 hidden 生效。 */
.clamp-toggle[hidden] { display: none; }
.clamp-text.clamp-lines-3.is-clamped { max-height: 4.875em; }
/* 更新说明区块（components/changelog.html）：白底细边框，与浅蓝灰底的版本号框区分；标题行只略大于正文。 */
.changelog-block { margin-top: 8px; padding: 10px 14px; border: 1px solid #dce8f8; border-radius: 6px; background: #fff; }
.changelog-block .markdown-body { font-size: 15px; line-height: 1.625; }
.changelog-block .markdown-body h1, .changelog-block .markdown-body h2, .changelog-block .markdown-body h3,
.changelog-block .markdown-body h4, .changelog-block .markdown-body h5, .changelog-block .markdown-body h6 { margin: .9em 0 .35em; font-size: 16px; line-height: 1.5; }
.changelog-block .markdown-body > :first-child { margin-top: 0; }
/* 设备主照片小图（components/device_thumb.html）：桌面 64×48，手机 48×36；可悬停设备上浮出大图。 */
.device-thumb { position: relative; display: inline-grid; flex-shrink: 0; place-items: center; width: 64px; height: 48px; border: 1px solid var(--line); border-radius: 6px; background: #f1f4f8; }
.device-thumb > img { width: 100%; height: 100%; border-radius: 5px; object-fit: cover; }
.device-thumb-empty { color: #8a99ad; font-size: 12px; line-height: 1.3; text-align: center; }
.device-thumb-preview { position: absolute; top: 50%; left: calc(100% + 10px); z-index: 30; display: none; width: 260px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 10px 35px rgb(40 70 110 / 18%); transform: translateY(-50%); pointer-events: none; }
.device-thumb-preview img { display: block; width: 100%; height: auto; border-radius: 5px; }
@media (hover: hover) {
    .device-thumb:hover .device-thumb-preview { display: block; }
}
.device-thumb:focus-visible .device-thumb-preview { display: block; }
@media (max-width: 700px) {
    .device-thumb { width: 48px; height: 36px; }
    .device-thumb-empty { font-size: 11px; }
    .device-thumb-preview { display: none !important; }
}

.search-results { display: grid; gap: 0; }.search-result { display: flex; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }.search-result:last-child { border-bottom: 0; }.search-result-kind { flex: 0 0 48px; color: var(--muted); font-size: 12px; }.search-result-main { min-width: 0; }.search-result-main p { margin: 3px 0 0; overflow-wrap: anywhere; }
.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 16px; }.parameter-field { margin-bottom: 12px; }
/* 参数标签不按 label 的纵向排列，必填星号紧跟名称和单位。 */
.parameter-field > .field-label { display: block; }
.array-field { display: grid; gap: 7px; }.array-items { display: grid; gap: 7px; }.array-item { display: flex; gap: 7px; align-items: center; }.array-item input { flex: 1 1 auto; min-width: 0; }.array-item .button { flex: 0 0 auto; }
/* 动态数组项标签保持完整，输入框承担窄屏收缩；标签与输入的关联由模板及脚本维护。 */
.array-item > label {
    flex: 0 0 auto;
    white-space: nowrap;
}
/* 窄屏允许数组控件的父级收缩，避免标签、输入框和删除按钮的固有宽度撑开卡片。 */
@media (max-width: 480px) {
    .parameter-field,
    .array-field,
    .array-field > [data-array-items],
    .array-field > [data-array-items] > .array-item {
        min-width: 0;
    }
}
.check-row { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; }.check-row input[type="checkbox"], .check-row input[type="radio"], input[type="checkbox"], input[type="radio"] { width: auto; min-height: unset; }
.button:disabled, button:disabled { color: #8d98a8; background: #edf0f3; border-color: #d8dee6; cursor: not-allowed; }
.result-panel { margin-top: 18px; padding: 14px; border: 1px solid #c8d9f8; border-radius: 8px; background: #f7faff; }.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.command-output { margin: 10px 0 0; padding: 12px; border-radius: 6px; color: #20385e; background: #fff; overflow-wrap: anywhere; }
.change-card { border-bottom: 1px solid var(--line); }.change-card:last-child { border-bottom: 0; }.change-card summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px 0; cursor: pointer; list-style-position: inside; }.change-card summary::marker { color: var(--blue); }.change-content { padding: 0 0 16px 20px; }.diff-output { padding: 12px; background: #f8fafc; border-radius: 7px; color: #344b6c; }
.account-card { width: min(560px, 100%); margin: 40px auto; }.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }.app-toast { position: fixed; right: 18px; bottom: 18px; z-index: 10; max-width: calc(100vw - 36px); padding: 10px 14px; border-radius: 7px; color: #fff; background: #1d2b41; opacity: 0; transform: translateY(10px); transition: opacity .16s, transform .16s; pointer-events: none; }.app-toast.is-visible { opacity: 1; transform: translateY(0); }
.issue code, .issue .path, .error code { overflow-wrap: anywhere; word-break: break-word; }
/* 问题位置合成一行，各项之间用“·”分隔；编辑页的行号按钮看起来像链接。 */
.issue-location span + span::before { content: "·"; margin: 0 6px; }
.issue-line { padding: 0; border: 0; color: inherit; background: none; font: inherit; text-decoration: underline; cursor: pointer; }

/* 设备与版本资料布局：号码始终保留原文换行，窄屏按内容层次堆叠。 */
.preserve-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.page-header > *, .section-heading > * { min-width: 0; }
.page-header h1, .breadcrumbs > *, .row-title, .section-heading { overflow-wrap: anywhere; }
.button { gap: 7px; }
.count-label { margin-left: 12px; color: var(--muted); font-size: 14px; font-weight: 400; }
.search-with-icon { position: relative; }
.search-with-icon > .icon { position: absolute; top: 11px; left: 12px; color: var(--muted); }
.search-with-icon input { padding-left: 41px; }
.search-with-icon textarea { min-height: 42px; padding-left: 41px; max-height: 160px; }
.search-hint { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.search-hint a { font-weight: 400; }
.list-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; margin-top: 18px; }
.list-footer .pagination { margin: 0; }
.page-size-form { display: flex; align-items: center; gap: 8px; }
.empty-actions { text-align: center; margin: -10px 0 20px; }
.branch-name { margin-right: 12px; font-size: 21px; font-weight: 600; }
.badge-purple { background: #f0e9ff; color: #7942c7; }
.version-number { display: flex; align-items: flex-start; gap: 10px; min-width: 0; width: 100%; padding: 9px 12px; border: 1px solid #dce8f8; border-radius: 6px; background: #f4f8fd; }
.version-number-text { display: block; flex: 1; min-width: 0; white-space: break-spaces; overflow-wrap: anywhere; font: 14px/1.7 Consolas, "Microsoft YaHei", monospace; }
.number-copy { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 3px; margin-top: -2px; border: 0; border-radius: 4px; background: transparent; color: #526e94; }
.number-copy:hover { color: var(--blue); background: #e4efff; }
.number-copy .icon { width: 18px; height: 18px; }
.clipboard-fallback { position: fixed; opacity: 0; width: 1px; height: 1px; }
.branch-overview, .version-context { display: flex; align-items: center; gap: 28px; }
.version-context-main { flex: 1; min-width: 0; }
.context-photo-link { display: block; flex: 0 0 210px; max-width: 25%; }
.context-photo { display: block; width: 100%; height: 130px; object-fit: contain; border-radius: 7px; background: #f4f7fb; }
.version-context h2 { margin: 0 0 10px; font-size: 23px; overflow-wrap: anywhere; }
.version-context p { margin: 0; color: #526985; }
.context-number { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 15px; align-items: center; }
.overview-fields, .version-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 0; }
.overview-fields { padding: 16px 20px; border-radius: 7px; background: #f5f9fe; }
.overview-fields > div, .version-fields > div { min-width: 0; }
.overview-fields dt { margin-bottom: 7px; color: var(--muted); font-size: 13px; }
.overview-fields dd, .version-fields dd { margin: 0; overflow-wrap: anywhere; }
.version-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.version-fields dt { margin-bottom: 8px; font-weight: 600; }
.version-fields dd { font-size: 16px; }
.version-fields > div + div { border-left: 1px solid var(--line); padding-left: 24px; }
.version-fields .badge { font-size: 14px; padding: 3px 12px; }
.version-filter { flex: 0 1 560px; justify-content: flex-end; align-items: center; }
.version-filter .search-box { flex: 1 1 220px; }
.version-table { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 18px; }
.version-position { padding: 22px 10px; text-align: center; color: var(--muted); }
.notes-section { padding-top: 18px; margin-top: 22px; border-top: 1px solid var(--line); }
.notes-section h2 { margin: 0; font-size: 17px; }
.relation-section { border: 1px solid var(--line); padding: 15px; }
.relation-section + .relation-section { border-top: 0; }
.relation-section h3 { margin: 0 0 10px; font-size: 14px; }
.relation-section p { margin: 0; }
.relation-section .version-number + .version-number { margin-top: 8px; }
.material-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.material-counts a { display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); padding: 14px 20px; border-radius: 7px; }
.material-counts a > span { flex: 1; }
.material-counts .icon { color: var(--blue); }
.material-counts a > .icon:first-child { width: 30px; height: 30px; }
.material-counts strong { display: block; color: var(--blue); font-size: 25px; }
.material-counts small { font-size: 13px; font-weight: 400; color: var(--muted); }
.card .preview-table { min-width: 0; table-layout: fixed; }
.preview-table td { overflow-wrap: anywhere; }
.timeline-node { position: relative; padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 8px; }
.timeline-node::before { content: ""; position: absolute; left: -37px; top: 28px; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px #cce1ff; }
.timeline-node.is-current { border-color: var(--blue); background: #f7fbff; }
.search-result-card { display: flex; align-items: flex-start; gap: 20px; }
.result-type { border-radius: 5px; padding: 4px 12px; }
.result-body { flex: 1; min-width: 0; }
.result-body h2 { font-size: 18px; }
.result-body .section-heading { align-items: center; margin-bottom: 9px; }
.result-body p { margin: 6px 0 0; overflow-wrap: anywhere; }
.result-branch { display: inline-block; margin-left: 16px; }
.result-snippet { color: #526985; }
mark { background: #fff0a5; color: inherit; }

.comparison-device { margin: -5px 0 20px; font-size: 18px; font-weight: 600; }
.comparison-versions { display: grid; gap: 15px; }
.comparison-versions > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 18px; }
.change-card summary { flex-wrap: wrap; }
.line-diff > summary { padding: 8px 12px; background: #f4f8fd; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.change-content pre { max-height: 600px; overflow: auto; }

.origin-number { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 15px; align-items: center; }

@media (max-width: 1000px) {
    .overview-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .overview-fields > div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .branch-overview, .version-context { gap: 15px; }
    .context-photo-link { flex-basis: 110px; }
    .context-photo { height: 85px; }
    .version-context h2 { font-size: 19px; }
    .context-number { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .version-position { padding: 22px 0; }
    .material-counts a { padding: 12px; gap: 8px; }
    .material-counts a > .icon:last-child { display: none; }
    .search-result-card { gap: 10px; flex-wrap: wrap; }
    .result-body { flex-basis: 100%; }
    .result-branch { display: block; margin-left: 0; }

    .comparison-versions > div { grid-template-columns: minmax(0, 1fr); gap: 5px; }
    .origin-number { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 430px) {
    .overview-fields, .version-fields, .material-counts { grid-template-columns: minmax(0, 1fr); }
    .version-fields > div + div { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
    .context-photo-link { flex: 0 0 75px; }
    .context-photo { height: 65px; }
    .version-context:has(.context-number) { flex-wrap: wrap; }
    .version-context:has(.context-number) .version-context-main { flex-basis: 100%; }
    .branch-overview { flex-wrap: wrap; }
    .branch-overview > .context-photo-link { display: none; }
    .timeline-node { padding: 12px; }
    .timeline-node::before { left: -27px; }
    .count-label { display: block; margin: 4px 0 0; }
}

/* 照片编辑和共用大图查看器；原图入口仍为图片资源。 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; }
.photo-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.photo-card.is-dragging { opacity: .5; }
.photo-card-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.photo-preview-wrap { position: relative; aspect-ratio: 4 / 3; background: #f4f7fb; border-radius: 6px; overflow: hidden; }
.photo-preview-wrap > a { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.photo-preview { display: block; width: 100%; height: 100%; object-fit: contain; }
.new-photo-placeholder { display: grid; place-items: center; color: var(--muted); }
/* 新加或更换过、尚未保存的照片的角标，由 photos.js 加上。 */
.photo-unsaved-badge { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 5px; color: #9a4b00; background: #fff1dc; border: 1px solid #f5c98a; font-size: 12px; pointer-events: none; }
.photo-primary-badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 5px; color: white; background: var(--blue); font-size: 12px; pointer-events: none; }
.photo-card-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.photo-card-body .button { padding-left: 5px; padding-right: 5px; }
.photo-toolbar { display: flex; align-items: center; gap: 18px; margin: 18px 0; }
.photo-save-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.photo-replace { cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
.has-photo-viewer { overflow: hidden; }
.photo-viewer { width: min(880px, calc(100% - 40px)); max-height: calc(100dvh - 40px); padding: 22px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 100px rgb(10 30 65 / 20%); color: var(--ink); }
.photo-viewer::backdrop { background: rgb(32 58 93 / 45%); }
.photo-viewer[open] { display: flex; flex-direction: column; }
.viewer-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 14px; }
.viewer-heading h2 { margin: 0; font-size: 21px; }
.viewer-heading p { margin: 3px 0 0; font-size: 13px; }
.viewer-stage-wrap { position: relative; min-height: 120px; }
.viewer-stage { display: flex; width: 100%; height: min(54dvh, 540px); overflow: auto; border-radius: 8px; background: #f2f5f9; }
.viewer-image { display: block; max-width: none; flex: 0 0 auto; object-fit: contain; margin: auto; }
.viewer-image[hidden], .viewer-error[hidden] { display: none; }
.viewer-error { display: flex; flex-direction: column; align-items: center; justify-content: center; position: absolute; inset: 0 45px; background: #f2f5f9; text-align: center; }
.viewer-error h3, .viewer-error p { margin: 0 0 12px; }
.viewer-step { position: absolute; top: calc(50% - 20px); width: 40px; height: 40px; padding: 0; background: white; border: 1px solid var(--line); border-radius: 50%; font: 30px/1 sans-serif; color: var(--blue); box-shadow: 0 3px 9px rgb(40 60 100 / 8%); }
.viewer-previous { left: 10px; }
.viewer-next { right: 10px; }
.viewer-tools { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 13px 0; }
.viewer-tools > span { min-width: 45px; text-align: center; font-size: 13px; }
.viewer-thumbnails { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.viewer-thumbnails button { width: 72px; height: 55px; padding: 4px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.viewer-thumbnails button[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.viewer-thumbnails img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 430px) {
    .photo-viewer { width: calc(100% - 16px); max-height: calc(100dvh - 16px); padding: 13px; }
    .viewer-stage { height: 44dvh; }
    .viewer-thumbnails button { width: 45px; height: 38px; }
    .photo-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 账号页沿用已确认的三张效果图，表单与密码要求在窄屏自然上下排列。 */
.login-page { background: radial-gradient(ellipse at 55% 25%, #e7f2ff 0, transparent 56%), var(--bg); }
.login-page .app-main { padding-top: clamp(50px, 15vh, 150px); }
.login-card { width: min(430px, 100%); margin: 0 auto; padding: 34px 36px 38px; border-color: #d0e1f8; box-shadow: 0 8px 32px rgb(65 110 166 / 5%); }
.login-card h1 { margin: 0; font-size: 30px; line-height: 1.4; }
.login-feedback { min-height: 27px; margin: 6px 0 14px; color: var(--danger); font-size: 13px; }
.login-feedback p { margin: 0; }
.account-field { min-width: 0; margin-bottom: 22px; }
.account-field label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--ink); }
.account-field input { display: block; width: 100%; height: 48px; padding: 10px 14px; border: 1px solid #cedbeb; border-radius: 7px; background: #fff; color: var(--ink); }
.account-field input::placeholder { color: #9ba8b9; }
.account-field input:focus { border-color: var(--blue); outline: 3px solid rgb(22 119 255 / 10%); }
.account-field input[aria-invalid="true"] { border-color: #d97872; }
.input-with-icon, .password-input { position: relative; }
.input-with-icon > .icon { position: absolute; top: 14px; left: 13px; color: #8192a8; }
.input-with-icon input { padding-left: 42px; }
.password-input input { padding-right: 48px; }
.password-toggle { position: absolute; top: 1px; right: 1px; display: grid; place-items: center; width: 45px; height: 46px; padding: 0; border: 0; border-radius: 6px; color: #8091a7; background: transparent; }
.password-toggle:hover { color: var(--blue); background: #f5f9ff; }
.password-toggle .eye-strike { display: none; }
.password-toggle[aria-pressed="true"] .eye-strike { display: block; }
.field-errors { margin-top: 6px; color: var(--danger); font-size: 13px; }
.field-errors ul { margin: 0; padding-left: 18px; }
.field-help { margin: 7px 0 0; font-size: 13px; color: var(--muted); }
.login-button { width: 100%; min-height: 48px; margin-top: 2px; font-size: 16px; }
.account-page { width: min(1050px, 100%); margin: 12px auto; }
.account-page .breadcrumbs { margin-bottom: 26px; }
.password-card { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr); gap: 30px; padding: 26px; }
.password-form-area { min-width: 0; padding: 8px 0 8px 6px; }
.password-form-area h1 { display: flex; align-items: center; gap: 13px; margin: 0 0 32px; font-size: 27px; }
.password-form-area h1 .icon { width: 30px; height: 30px; color: var(--blue); }
.password-form-area .account-field { margin-bottom: 28px; }
.password-requirements { padding: 32px; border-left: 1px solid #e3edfa; border-radius: 0 7px 7px 0; background: #f1f7fe; }
.password-requirements h2 { margin: 0 0 22px; font-size: 20px; }
.password-requirements ul { display: grid; gap: 18px; margin: 0; padding-left: 19px; }
.password-requirements li { padding-left: 5px; }
.password-requirements li::marker { color: var(--blue); }
.password-requirements-inline { display: none; }
.account-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; margin-top: 35px; }
.account-actions .button { min-height: 44px; min-width: 126px; }
.account-actions .button-quiet { border-color: var(--blue); }
.password-success { width: min(610px, 100%); margin: 72px auto 0; padding: 48px 30px 54px; text-align: center; }
.success-symbol { display: grid; width: 92px; height: 92px; margin: 0 auto 22px; place-items: center; color: #0ab76f; background: #e1faed; border-radius: 50%; }
.success-symbol .icon { width: 44px; height: 44px; stroke-width: 3px; }
.password-success h1 { margin: 0 0 10px; font-size: 30px; }
.password-success p { margin: 0 0 34px; color: var(--muted); font-size: 16px; }
.password-success .button { min-height: 46px; gap: 12px; padding: 10px 24px; }
:focus-visible { outline: 3px solid #9cc7ff; outline-offset: 3px; }

@media (min-width: 821px) and (max-width: 1100px) {
    .app-topbar { gap: 18px; padding: 0 22px; }
    .app-brand strong { font-size: 16px; }
    .app-nav a { padding: 8px; gap: 5px; }
    .nav-primary, .nav-actions { gap: 3px; }
    .app-account .account-avatar { display: none; }
}
@media (max-width: 700px) {
    .password-card { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .password-form-area { padding: 0; }
    .password-requirements { padding: 22px; border-left: 0; border-radius: 7px; }
    /* 手机宽度下表单与要求上下排列，要求移到新密码框上方，避免保存被拒后才看到。 */
    .password-requirements-side { display: none; }
    .password-requirements-inline { display: block; margin-bottom: 24px; padding: 16px 18px; }
    .password-requirements.password-requirements-inline h2 { margin-bottom: 10px; font-size: 17px; }
    .password-requirements-inline ul { gap: 6px; font-size: 15px; }
    .password-success { margin-top: 35px; }
}

@media (max-width: 820px) { .app-topbar { flex-wrap: wrap; gap: 10px 18px; padding: 12px 20px; }.app-nav { order: 3; flex-basis: 100%; min-height: 36px; gap: 17px; overflow-x: auto; }.app-account { margin-left: auto; }.app-main { padding: 22px 18px 38px; }.detail-grid { grid-template-columns: 1fr; }.form-columns { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .app-topbar { padding: 12px 14px; }.app-brand { min-width: 0; }.app-brand strong { font-size: 13px; }.app-main { padding: 18px 12px 32px; }.card { padding: 16px; }.page-header { display: block; }.page-header .page-actions, .page-header > .button, .page-header > .badge { margin-top: 12px; }.section-heading { display: block; }.section-heading > * + * { margin-top: 12px; }.toolbar-form, .filter-grid { align-items: stretch; }.toolbar-form .button, .filter-grid .button { width: 100%; }.search-box, .search-box-wide { flex-basis: 100%; }.compact-info { display: grid; gap: 12px; }.list-row { display: block; }.list-row-meta { align-items: flex-start; margin-top: 10px; }.definition-list { grid-template-columns: 1fr; gap: 3px; }.definition-list dd { margin-bottom: 10px; }.data-table { min-width: 650px; }.change-content { padding-left: 0; }.trace-row { min-height: 70px; } }

/* 六个导航入口在手机上保持可见，账号菜单不挤占主导航行。 */
@media (max-width: 480px) {
    .app-topbar { gap: 10px; }
    .app-brand strong { font-size: 16px; }
    .app-brand-mark { width: 32px; height: 32px; border-radius: 8px; }
    .app-brand-mark .icon { width: 21px; height: 21px; }
    .account-avatar { display: none; }
    .app-account summary { gap: 3px; font-size: 13px; }
    .app-nav { gap: 8px; justify-content: space-between; }
    .nav-primary, .nav-actions { gap: 4px; }
    .app-nav a { padding: 7px 8px; font-size: 13px; }
    .app-nav a .icon { display: none; }
    .login-card { padding: 27px 24px 32px; }
    .password-card { padding: 22px; }
    .password-form-area h1 { margin-bottom: 26px; font-size: 24px; }
    .password-form-area .account-field { margin-bottom: 22px; }
    .account-actions .button { min-width: 105px; }
    .password-success { padding: 35px 20px; }
    .password-success h1 { font-size: 26px; }
}

.mono-text { font-family: Consolas, "Microsoft YaHei", monospace; }
.share-dialog { width: min(600px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; box-shadow: 0 24px 90px rgb(15 35 65 / 30%); overflow: auto; }
.share-dialog::backdrop { background: rgb(30 47 70 / 52%); }
.share-dialog-open { overflow: hidden; }
.share-dialog-content { padding: 26px; }
.share-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.share-dialog-header h2 { margin: 0 0 6px; font-size: 23px; }
.share-dialog-header p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.dialog-close { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; padding: 0; border: 0; border-radius: 5px; background: white; color: #456181; font-size: 27px; line-height: 1; }
.dialog-close:hover { background: var(--blue-soft); }
.share-dialog .version-number { font-size: 13px; }
.share-dialog .notice { margin-top: 15px; }
.share-dialog ul { margin: 0; padding-left: 22px; }
.share-dialog-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.share-dialog-footer .button { min-width: 110px; min-height: 40px; }
@media (max-width: 430px) {
    .share-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
    .share-dialog-content { padding: 18px 14px; }
    .share-dialog-header h2 { font-size: 20px; }
    .share-dialog-footer { gap: 8px; }
    .share-dialog-footer .button { flex: 1; min-width: 0; }
}

/* 公开资料空间独立页头、访问状态与资料工具，不引入管理端导航。 */
.public-space .app-topbar { justify-content: space-between; }
.public-space .app-brand { min-width: 0; }
.field-error { margin: 6px 0; color: var(--danger); font-size: 13px; text-align: left; }

.parsed-reading { padding: 12px 0; }
.parsed-reading > span { display: block; color: var(--muted); font-size: 12px; }
.parsed-reading > strong { font-size: 28px; color: var(--blue); }
.parsed-reading small { font-size: 16px; font-weight: normal; }
.parsed-reading p, .parsed-message { margin: 6px 0; white-space: pre-wrap; }

.viewer-step[hidden], .viewer-thumbnails[hidden], .viewer-tools[hidden] { display: none; }
@media (max-width: 480px) {
    .public-space .app-topbar { flex-wrap: wrap; }
    .public-space .app-brand strong { font-size: 17px; }
}

@media (max-width: 480px) {
    .page-header > .toolbar { margin-top: 15px; }
}

/* 恢复状态页（独立维护页），不使用虚构的执行进度。 */
.maintenance-card { max-width: 650px; margin: 110px auto 40px; padding: 48px 40px; text-align: center; }
.maintenance-icon { display: grid; place-items: center; width: 110px; height: 110px; margin: 0 auto 22px; border-radius: 50%; background: #edf2f9; color: #657b9c; }
.maintenance-icon .icon { width: 62px; height: 62px; }
.maintenance-card h1 { font-size: 28px; margin: 12px 0; }
.maintenance-card > p { color: var(--muted); font-size: 17px; margin: 14px 0 32px; white-space: pre-wrap; overflow-wrap: anywhere; }
.maintenance-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.maintenance-actions .button { min-width: 180px; min-height: 46px; font-size: 16px; }
/* 恢复状态图标：排队和恢复中为时钟，成功为对勾，失败、已回滚、需要人工处理和任务记录不存在为警告，没有恢复任务为灰色信息图标。 */
.maintenance-icon > span { display: none; }
[data-restore-state="queued"] .restore-icon-waiting,
[data-restore-state="running"] .restore-icon-waiting,
[data-restore-state="succeeded"] .restore-icon-success,
[data-restore-state="failed"] .restore-icon-warning,
[data-restore-state="rolled_back"] .restore-icon-warning,
[data-restore-state="recovery_required"] .restore-icon-warning,
[data-restore-state="missing"] .restore-icon-warning,
[data-restore-state="idle"] .restore-icon-idle { display: block; }
[data-restore-state="succeeded"] .maintenance-icon { background: #e8f7ef; color: #138055; }
[data-restore-state="failed"] .maintenance-icon,
[data-restore-state="rolled_back"] .maintenance-icon,
[data-restore-state="recovery_required"] .maintenance-icon,
[data-restore-state="missing"] .maintenance-icon { background: #fff1df; color: #a45d00; }
[data-restore-state="idle"] .maintenance-icon { background: #f1f4f8; color: #8a99ad; }
/* 403、404 错误页：与“密码已更新”相同的居中小卡片；HTTP 状态码为灰色小字。 */
.error-card { width: min(610px, 100%); margin: 72px auto 0; padding: 44px 30px 50px; text-align: center; }
.error-symbol { display: grid; width: 92px; height: 92px; margin: 0 auto 18px; place-items: center; color: #8a99ad; background: #f1f4f8; border-radius: 50%; }
.error-symbol .icon { width: 44px; height: 44px; }
.error-code { margin: 0 0 6px; color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.error-card h1 { margin: 0 0 10px; font-size: 30px; }
.error-card > p:not(.error-code) { margin: 0 0 30px; color: var(--muted); font-size: 16px; }
.error-card .button { min-height: 46px; padding: 10px 28px; }
.maintenance-card .error-code { margin: 0; font-size: 14px; }
@media (max-width: 480px) { .error-card { margin-top: 32px; padding: 32px 20px 36px; }.error-card h1 { font-size: 26px; } }
[data-restore-refresh][hidden] { display: none; }
@media (max-width: 480px) {
    .maintenance-card { margin: 35px auto 20px; padding: 32px 20px; }
    .maintenance-icon { width: 85px; height: 85px; }
    .maintenance-icon .icon { width: 48px; height: 48px; }
    .maintenance-page .app-brand strong { font-size: 18px; }
}

/* 桌面端：顶栏的桌面会话标识、版本号后的【源】【固】路径图标和版本页的文件路径卡片。 */
.app-desktop-badge { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 4px 12px; border-radius: 999px; color: var(--blue-dark); background: var(--blue-soft); font-size: 14px; font-weight: 700; white-space: nowrap; }
.app-desktop-badge .icon { width: 16px; height: 16px; }
/* 桌面软件页头的后退按钮，位于站名左侧；无可后退页面时变灰。 */
.app-back { display: inline-grid; flex-shrink: 0; width: 38px; height: 38px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.app-back:hover:not(:disabled) { color: var(--blue); border-color: #bfd4f5; background: var(--blue-soft); }
.app-back:disabled { color: #b8c4d3; cursor: default; }
.version-paths { display: inline-flex; flex: 0 0 auto; align-self: flex-start; gap: 4px; margin-left: 2px; vertical-align: middle; }
.board-link-table .version-paths { margin-left: 8px; }
.path-icon { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid #b8cdea; border-radius: 4px; color: var(--blue-dark); background: #fff; font: 700 13px/1 "Microsoft YaHei", sans-serif; cursor: pointer; user-select: none; }
.path-icon:hover { border-color: var(--blue); background: #e4efff; }
.path-icon.is-empty { border-color: #dfe5ec; color: #aab4c1; background: #f5f7fa; }
.version-path-list { display: grid; gap: 0; margin: 0; }
.version-path-row { display: grid; grid-template-columns: minmax(80px, 110px) minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.version-path-row:last-child { border-bottom: 0; }
.version-path-row dt { color: var(--muted); font-size: 14px; }
.version-path-row dd { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; }
.version-path-text { min-width: 0; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; overflow-wrap: anywhere; font: 14px/1.6 Consolas, "Microsoft YaHei", monospace; }
button.version-path-text { color: var(--blue-dark); cursor: pointer; user-select: none; }
button.version-path-text:hover { text-decoration: underline; }
/* 路径检查：每组一张卡片，每条两行；“未设置路径”组默认折叠，点标题展开。 */
.path-check-group { padding-top: 16px; padding-bottom: 8px; }
.path-check-group h2 { display: inline; margin: 0; font-size: 18px; }
.path-check-group summary { cursor: pointer; }
.path-check-group + .path-check-group { margin-top: 16px; }
.path-check-note { margin: 4px 0 0; font-size: 14px; }
.path-check-list { margin: 10px 0 0; padding: 0; list-style: none; }
.path-check-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #edf1f6; }
.path-check-row-main { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.path-check-title { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.path-check-path { color: var(--muted); overflow-wrap: anywhere; font: 13px/1.6 Consolas, "Microsoft YaHei", monospace; }
.path-check-path .version-path-text { color: var(--muted); font-size: 13px; }
.path-check-row > .button { flex-shrink: 0; }
@media (max-width: 480px) {
    .version-path-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* 指令集变更表格（components/instruction_changes.html）：动作、类型、名称、说明四列，删除行浅红底；
   字段差异的修改前后按普通文字保留换行，宽度不够时上下排列。窄屏下表格按行堆叠，不横向滚动。 */
.ins-change-heading { margin: 0 0 12px; font-size: 18px; }
/* 用 table.ins-change-table 盖过“.card table”的 720px 最小宽度，卡片内的变更表随卡片收窄。 */
table.ins-change-table { width: 100%; min-width: 0; border-collapse: collapse; table-layout: fixed; }
.ins-change-table th, .ins-change-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.ins-change-table th { color: var(--muted); background: #f6f9fd; font-size: 13px; font-weight: 600; }
.ins-change-table th:nth-child(1) { width: 76px; }
/* 类型列按“组合操作”四个字留足宽度，不折成两行。 */
.ins-change-table th:nth-child(2) { width: 104px; }
.ins-change-table td:nth-child(2) { white-space: nowrap; }
.ins-change-table th:nth-child(3) { width: 28%; }
.ins-change-table .badge { margin: 0; }
.ins-change-remove td { background: #fff7f6; }
.ins-change-name { font-weight: 600; }
.ins-change-name a { color: var(--blue); }
.ins-change-name a:hover { text-decoration: underline; }
.ins-change-details { margin-top: 4px; font-size: 13px; }
.ins-change-details > summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.ins-diff { display: grid; gap: 10px; margin-top: 8px; }
.ins-diff-label { margin-bottom: 4px; color: var(--ink); font-weight: 600; }
.ins-diff-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; }
.ins-diff-values > div { min-width: 0; padding: 6px 8px; border-radius: 6px; }
.ins-diff-values span { display: block; color: var(--muted); font-size: 12px; }
.ins-diff-values pre { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 Consolas, "Microsoft YaHei", monospace; }
.ins-diff-before { background: #fff3f2; }
.ins-diff-before pre { color: #a5281c; }
.ins-diff-after { background: #edf8f1; }
.ins-diff-after pre { color: #1d6b3d; }
.ins-change-totals { margin: 12px 0 0; color: var(--muted); }
@media (max-width: 700px) {
    .ins-change-table thead { display: none; }
    .ins-change-table, .ins-change-table tbody, .ins-change-table tr, .ins-change-table td { display: block; width: auto; }
    .ins-change-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
    .ins-change-table td { padding: 3px 0 3px 52px; border: 0; position: relative; }
    .ins-change-table td::before { content: attr(data-label); position: absolute; left: 0; color: var(--muted); font-size: 13px; }
    .ins-change-table td:empty { display: none; }
    .ins-change-remove td { background: none; }
    .ins-change-remove { background: #fff7f6; }
}

/* 站内确认弹窗（confirm-dialog.js）：外观与删除版本弹窗一致。 */
.confirm-dialog { width: min(560px, calc(100vw - 32px)); max-width: calc(100vw - 32px); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 20px 70px rgb(24 41 67 / 24%); }
.confirm-dialog::backdrop { background: rgb(24 41 67 / 38%); }
.confirm-dialog-content { padding: 24px; color: #243653; }
.confirm-dialog-content > p { margin: 18px 0 0; }
.confirm-dialog-heading { position: relative; padding-right: 40px; }
.confirm-dialog-heading-main { display: flex; align-items: flex-start; gap: 12px; }
.confirm-dialog-heading h2 { margin: 0; font-size: 22px; }
.confirm-dialog-heading p { margin: 5px 0 0; color: #687991; overflow-wrap: anywhere; }
.confirm-dialog-icon { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 30px; border: 2px solid currentColor; border-radius: 50%; color: var(--danger); font-weight: 800; }
.confirm-dialog-icon-warning { color: #e27800; }
.confirm-dialog-close { position: absolute; top: -6px; right: -6px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #687991; font-size: 25px; line-height: 1; }
.confirm-dialog-close:hover { background: #f0f5fb; color: #243653; }
.confirm-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
