/* 浏览页面共用视觉：浅灰背景、白色卡片、蓝色主操作，移动端优先收缩。 */
:root {
    --blue: #245bda;
    --blue-dark: #1948b4;
    --blue-soft: #edf3ff;
    --ink: #1d2b41;
    --muted: #69778a;
    --line: #e1e7ef;
    --bg: #f5f7fa;
    --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: 14px/1.6 "Segoe UI", "Microsoft YaHei", 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; }
pre, code { font-family: Consolas, "SFMono-Regular", monospace; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.app-shell { min-height: 100vh; }
.app-topbar { display: flex; align-items: center; gap: 28px; min-height: 72px; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); }
.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 small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.app-brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: #fff; background: var(--blue); font-weight: 700; }
.app-nav { display: flex; align-items: stretch; gap: 20px; flex: 1; align-self: stretch; }
.app-nav a { display: grid; place-items: center; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.app-nav a:hover, .app-nav a.is-active { color: var(--blue); border-bottom-color: var(--blue); }
.app-account { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.app-account-name { color: var(--muted); }
.app-main { width: min(1400px, 100%); margin: 0 auto; padding: 28px 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; }
.eyebrow { margin: 0 0 4px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.page-subtitle { margin: 5px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.page-actions, .format-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.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: 18px; padding: 22px; 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: 18px; }
.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: 36px; padding: 7px 14px; 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); }
.text-action { display: inline-block; padding: 2px 0; font-weight: 600; }
.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; }
.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-muted { color: #657386; background: #edf0f3; }

.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(--muted); background: #f8fafc; font-size: 12px; 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; }
.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; }
.device-detail-grid { grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); }
.metadata-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.metadata-grid > div, .compact-info > div { min-width: 0; }
.metadata-grid span, .compact-info span, .definition-list dt { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; }
.metadata-grid strong { overflow-wrap: anywhere; }
.compact-info { display: flex; flex-wrap: wrap; gap: 26px; }
.compact-info strong { margin-right: 20px; }
.device-hero-photo, .device-hero-placeholder { display: block; width: 100%; max-height: 300px; min-height: 180px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.device-hero-placeholder { display: grid; place-items: center; color: var(--muted); background: #f0f3f7; }
.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; }.constraint-list { display: grid; gap: 0; border-top: 1px solid var(--line); }.constraint-row { display: grid; grid-template-columns: minmax(110px, .35fr) minmax(90px, .35fr) minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }.constraint-row > span { min-width: 0; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.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; }

.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; }
.protocol-form fieldset { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }.protocol-form legend { padding: 0 6px; color: var(--ink); font-weight: 700; }.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 16px; }.protocol-form fieldset > .field { margin-bottom: 12px; }.parameter-field { margin-bottom: 12px; }
.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; }
.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; }.example-card { padding: 14px 0; border-bottom: 1px solid var(--line); }.example-card:last-child { border-bottom: 0; }.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }.example-grid pre, .definition-columns pre { min-height: 40px; margin: 5px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; }
.change-card, .plan-card { border-bottom: 1px solid var(--line); }.change-card:last-child, .plan-card:last-child { border-bottom: 0; }.change-card summary, .plan-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, .plan-card summary::marker { color: var(--blue); }.change-content { padding: 0 0 16px 20px; }.definition-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.definition-columns h3 { margin: 0; font-size: 14px; }.diff-output { padding: 12px; background: #f8fafc; border-radius: 7px; color: #344b6c; }.plain-steps, .generated-steps { margin: 8px 0 0; padding-left: 24px; }.plain-steps li, .generated-steps li { padding: 7px 0; }.generated-steps li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }.step-command { flex: 1 1 300px; padding: 7px; border-radius: 5px; background: #fff; overflow-wrap: anywhere; }
.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; }

/* 窄屏约束说明按名称、类型和允许范围纵向排列，避免数值被挤成单字符列。 */
@media (max-width: 600px) {
    .constraint-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
        padding: 12px 0;
    }
}

@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, .device-detail-grid { grid-template-columns: 1fr; }.form-columns, .example-grid, .definition-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-account-name { display: none; }.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; } }
