:root {
  color-scheme: light;
  --ink: #17273b;
  --navy: #1d4367;
  --muted: #53677b;
  --line: #dce4e9;
  --paper: #fff;
  --page: #f3f6f8;
  --selection: #eaf1f7;
  --focus: #3976a5;
  --green: #43783c;
  --danger: #932723;
  font: 14px/1.5 "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
body, h1, h2, p, fieldset { margin: 0; }
[hidden] { display: none !important; }
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1600px; min-height: 68px; margin: auto; padding: 0 38px; display: flex; gap: 20px; justify-content: space-between; align-items: center; }
.brand, .file-actions, .buttons, .project-status { display: flex; align-items: center; gap: 10px; }
.brand { gap: 14px; flex-shrink: 0; }
.brand img { width: 72px; height: auto; display: block; }
.brand-divider { height: 23px; border-left: 1px solid var(--line); }
.app-name { font-weight: 750; color: var(--navy); white-space: nowrap; }
main { max-width: 1600px; margin: auto; padding: 24px 38px 56px; }
.page-header { display: flex; justify-content: space-between; align-items: end; column-gap: 18px; margin-bottom: 17px; }
.project-status { color: var(--muted); gap: 10px; font-size: 12px; }
#source-name { overflow-wrap: anywhere; }
#source-name:not(:empty)::before { content: "／"; margin-right: 8px; color: #7e8c98; }
.local { color: var(--green); white-space: nowrap; }
.local span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; }
h1 { font-size: clamp(24px, 3vw, 37px); font-weight: 750; letter-spacing: -.035em; line-height: 1.25; margin-top: 6px; }
h2 { font-size: 15px; font-weight: 750; }
.page-caption { color: var(--muted); white-space: nowrap; font-size: 12px; padding-bottom: 4px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; border: 1px solid transparent; background: var(--navy); color: white; padding: 6px 13px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap; }
button:hover, .button:hover { background: #285879; }
button:disabled { opacity: .46; cursor: default; }
.secondary { border-color: var(--line); background: var(--paper); color: var(--navy); }
.secondary:not(:disabled):hover, .quiet:not(:disabled):hover, .icon-button:not(:disabled):hover { background: var(--selection); }
.quiet, .icon-button { color: var(--navy); border-color: transparent; background: transparent; }
.subtle { font-size: 12px; padding-inline: 6px; }
.icon-button { min-width: 30px; min-height: 30px; padding: 0; font-size: 22px; line-height: 1; border-color: var(--line); }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [role=tab]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(262px, 294px); gap: 16px; align-items: stretch; margin-bottom: 18px; }
.preview-section, .settings, .data-editor { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; overflow: hidden; min-width: 0; box-shadow: 0 3px 13px #162d4307; }
.preview-section { padding: 16px 16px 10px; display: flex; flex-direction: column; min-height: 486px; }
.preview-header, .preview-footer, .editor-header, .inspector-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-header { padding: 0 3px 13px; }
.preview-footer { padding: 6px 3px 0; }
.section-title { display: flex; gap: 9px; align-items: baseline; min-width: 0; }
.section-title span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.page-controls { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
#page-number { min-width: 44px; text-align: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.preview { display: grid; place-items: center; flex: 1; min-height: 340px; background: #eaf0f4 radial-gradient(#d6e1ea 0.7px, transparent 0.7px) 0 0 / 12px 12px; border: 1px solid #dce6ed; border-radius: 9px; padding: clamp(9px, 2vw, 20px); }
.preview > svg, #large-preview > svg { display: block; width: 100%; height: auto; background: white; box-shadow: 0 4px 20px #183b6325; }
.preview > svg { max-width: 1130px; }
.empty { max-width: min(100%, 430px); text-align: center; color: var(--muted); padding: 24px 10px; }
.empty strong { display: block; margin: 0 0 6px; color: var(--ink); font-size: 19px; font-weight: 750; }
.empty p { margin-bottom: 12px; font-size: 13px; }
.empty-illustration { display: grid; grid-template-columns: repeat(10, 1fr); grid-auto-rows: 8px; gap: 5px; width: 116px; margin: 0 auto 18px; padding: 14px 13px; border-radius: 12px; border: 1px solid #cddbe6; background: #f9fbfd; box-shadow: 0 3px 8px #173b6310; }
.empty-illustration i { border-radius: 5px; }
.empty-illustration i:nth-child(1) { grid-column: 1/8; background: #2e6a90; }
.empty-illustration i:nth-child(2) { grid-column: 4/10; background: #568273; }
.empty-illustration i:nth-child(3) { grid-column: 7/11; background: #96754c; }
#status { display: flex; align-items: center; font-size: 12px; color: var(--muted); }
#status.ready::before { content: ""; width: 7px; height: 7px; background: var(--green); border-radius: 50%; margin-right: 7px; flex: none; }
.error { color: var(--danger) !important; }

.settings { padding: 14px 17px 12px; }
.inspector-title { min-height: 33px; }
.settings-group { border: 0; margin: 0; min-width: 0; padding: 13px 0 0; }
.settings-group + .settings-group { margin-top: 12px; border-top: 1px solid #e9eff3; }
.settings-group legend { padding: 0; margin-bottom: 4px; font-size: 12px; color: var(--muted); font-weight: 750; }
.settings-group:has(legend) { padding-top: 0; border: 0; }
.project-fields { padding-top: 8px; }
.fields { display: grid; grid-template-columns: 1.32fr 1fr; gap: 9px; margin-top: 9px; }
label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
input:not([type=radio]), select, textarea { min-width: 0; width: 100%; min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; color: var(--ink); background: var(--paper); }
input::placeholder { color: #698094; }
.choices { display: grid; gap: 6px; }
.layout-choices { grid-template-columns: 1fr 1fr; }
.shape-choices { grid-template-columns: repeat(3, 1fr); }
.choices label { position: relative; }
.choices input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choices label span { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 36px; padding: 5px 2px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); }
.choices input:hover + span { border-color: #9db2c3; }
.choices input:checked + span { border-color: #46769b; background: var(--selection); color: var(--navy); box-shadow: inset 0 0 0 1px #46769b; }
.choices input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.page-glyph { position: relative; width: 11px; height: 13px; border: 1px solid currentColor; border-radius: 2px; }
.page-glyph::after { content: ""; position: absolute; top: 4px; height: 3px; left: 2px; right: 2px; border-block: 1px solid currentColor; opacity: .68; }
.layered { margin-right: 2px; box-shadow: 2px 2px 0 var(--selection), 3px 3px 0 -0.4px #7794ac; }
.shape-choices label span { flex-direction: column; gap: 4px; min-height: 46px; }
.bar-glyph { display: block; width: 27px; height: 7px; background: #367297; }
.rounded { border-radius: 2px; }
.capsule { border-radius: 20px; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.45; margin-top: 7px; }
.colors > select { margin-top: 4px; }
.color-swatches { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; margin-top: 9px; }
.color-swatches label { justify-items: center; gap: 3px; font-size: 11px; }
.color-swatches input[type=color] { cursor: pointer; padding: 2px; height: 24px; min-height: 24px; border-radius: 6px; }
.color-swatches input::-webkit-color-swatch-wrapper { padding: 1px; }
.color-swatches input::-webkit-color-swatch { border: 0; border-radius: 3px; }
summary { cursor: pointer; width: fit-content; color: var(--navy); font-weight: 650; font-size: 12px; }
.segment-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 8px 0 4px; }
.segment-row label:first-child { grid-column: 1 / -1; }
.segment-row button { justify-self: start; }
.text-button { font-size: 12px; min-height: 25px; padding: 3px 6px; }
.segments > button { margin-top: 4px; }

.tabs { display: flex; gap: 6px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tabs button { min-height: 45px; position: relative; background: transparent; color: var(--muted); border-radius: 0; padding: 7px 12px; }
.tabs button[aria-selected=true] { color: var(--navy); }
.tabs button[aria-selected=true]::after { content: ""; bottom: -1px; position: absolute; left: 5px; right: 5px; height: 2px; background: var(--navy); border-radius: 2px; }
.tabs .count { background: #edf2f6; padding: 0 6px; border-radius: 10px; color: var(--navy); font-weight: 650; font-size: 11px; }
.editor-header { padding: 11px 17px; }
.editor-header .task-query { width: min(310px, 47%); }
.links-hint { color: var(--muted); font-size: 12px; }
.table-scroll { overflow: auto; max-height: 470px; }
table { border-collapse: separate; border-spacing: 0; width: 100%; text-align: left; min-width: 1020px; font-size: 12px; }
th { position: sticky; top: 0; z-index: 1; padding: 8px 6px; color: var(--navy); background: #eaf0f5; font-weight: 750; white-space: nowrap; }
td { padding: 5px 6px; border-bottom: 1px solid #e8eef2; }
td:first-child, th:first-child { padding-left: 16px; }
tbody tr:nth-child(even) { background: #f7fafc; }
tbody tr.has-issue { background: #fff4e2; }
td.no-rows { padding: 18px 17px; color: var(--muted); }
td input:not([type=radio]), td select { font-size: 12px; }
td input[type=checkbox] { width: 16px; height: 16px; min-height: 0; margin-left: 12px; accent-color: var(--navy); vertical-align: middle; }
.actions { display: flex; gap: 3px; }
.actions button { min-width: 25px; padding: 3px 5px; }
.links table { table-layout: fixed; min-width: 1070px; }
.links th:nth-child(1), .links th:last-child { width: 63px; }
.links th:nth-child(2), .links th:nth-child(3) { width: 20%; }
.links th:nth-child(4) { width: 120px; }
.links th:nth-child(5), .links th:nth-child(6) { width: 95px; }
[aria-invalid=true] { border-color: #bb6557 !important; }
.issues { margin: 0; max-height: 160px; overflow: auto; padding: 9px 28px 9px 38px; background: #fff5e6; color: #794115; font-size: 12px; }
.issues button { color: inherit; text-decoration: underline; min-height: 0; padding: 0; border: 0; background: transparent; font: inherit; text-align: left; white-space: normal; }
dialog { max-width: min(530px, 94vw); width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 21px; color: var(--ink); }
dialog::backdrop { background: #132c466e; }
dialog .dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
dialog fieldset { padding: 0; border: 0; display: grid; gap: 9px; }
dialog .buttons { justify-content: flex-end; margin-top: 14px; }
#detail-source { font-size: 12px; color: var(--muted); margin-top: 7px; }
.slide-dialog { max-width: min(1330px, 94vw); }
#large-preview { max-height: 76vh; overflow: auto; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 247px; gap: 11px; }
  main, .top-inner { padding-inline: 20px; }
  .preview { padding: 8px; min-height: 250px; }
  .preview-section, .settings { padding-inline: 11px; }
}
@media (max-width: 660px) {
  main, .top-inner { padding-inline: 14px; }
  .top-inner { flex-wrap: wrap; justify-content: start; padding-block: 9px; gap: 8px; }
  .file-actions { gap: 5px; flex-wrap: wrap; }
  .file-actions > * { padding-inline: 8px; }
  .workspace { grid-template-columns: 1fr; }
  .preview-section { min-height: 0; }
  .preview { min-height: 185px; }
  .page-caption { display: none; }
  #large-preview > svg { min-width: 720px; }
  .editor-header { flex-wrap: wrap; gap: 7px; padding-inline: 12px; }
  .editor-header .task-query { width: 100%; }
}

