:root {
  color-scheme: light;
  font-family: Geist, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #132822;
  background: #f1f5f4;
  font-synthesis: none;
  --paper: #fff;
  --ink: #132822;
  --muted: #506760;
  --line: #dce7e2;
  --soft: #f2f7f5;
  --accent: #14684f;
  --accent-dark: #0d523d;
  --accent-soft: #e4f2eb;
  --error: #a33229;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; font-size: 14px; }
h1, h2, h3, p, ul { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
::selection { background: #caead9; color: #102c23; }

.shell { width: min(1200px, calc(100% - 72px)); margin-inline: auto; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; font-size: 18px; letter-spacing: -.035em; font-weight: 760; }
.brand > span:last-child { color: var(--accent); }
.brand-mark {
  width: 32px;
  height: 32px;
  display: flex;
  margin-right: 10px;
  gap: 3px;
  justify-content: center;
  align-items: center;
  border-radius: 7px;
  background: var(--accent-dark);
}
.brand-mark i { width: 3px; height: 9px; border-radius: 2px; background: #dbf4e6; transform: rotate(21deg); }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 11px; }
.local-status { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--accent-dark); }
.local-status span { width: 7px; height: 7px; border-radius: 50%; background: #269470; box-shadow: 0 0 0 3px var(--accent-soft); }

.intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin: 27px 0 22px;
  padding: 36px 37px;
  border-radius: 12px;
  background: #12372c;
  color: #f3fbf7;
}
.intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 auto;
  width: 33%;
  opacity: .32;
  background-image: radial-gradient(#89bda8 1px, transparent 1px);
  background-size: 15px 15px;
  mask-image: linear-gradient(90deg, transparent, #000);
  pointer-events: none;
}
.intro h1 { font-size: clamp(28px, 3.8vw, 43px); line-height: 1.2; letter-spacing: -.03em; font-weight: 730; }
.intro p { margin-top: 13px; color: #c5dfd2; line-height: 1.65; max-width: 48em; }
.intro .demo-button { color: #e8f8ef; background: #1c493a; border-color: #467361; white-space: nowrap; }
.intro .demo-button:hover:not(:disabled) { background: #245843; border-color: #63937d; }
.intro .demo-button:focus-visible { outline-color: #bef0d9; }

.workbench { display: grid; align-items: start; grid-template-columns: 288px minmax(0, 1fr); gap: 20px; margin-bottom: 36px; }
.surface { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.sidebar { padding: 19px 16px 15px; min-width: 0; }
.sidebar-heading { display: flex; align-items: center; gap: 8px; padding: 0 3px; margin-bottom: 15px; }
.sidebar-heading h2 { font-size: 16px; }
.counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 23px;
  border-radius: 5px;
  padding: 2px 5px;
  background: var(--soft);
  color: var(--muted);
  font: 11px/1.25 var(--mono);
}
.drop-zone {
  display: grid;
  place-items: center;
  width: 100%;
  gap: 7px;
  padding: 18px 8px 16px;
  border: 1px dashed #a7c8b9;
  border-radius: 8px;
  background: #f5faf7;
  color: var(--accent-dark);
  text-align: center;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.upload-symbol { margin-bottom: 4px; }
.drop-hint { color: var(--muted); font-size: 11px; line-height: 1.45; }
.import-status, .import-errors { font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.import-status { color: var(--muted); margin: 12px 3px 0; }
.import-errors { color: var(--error); margin: 12px 0 0; padding-left: 20px; }
.import-errors li + li { margin-top: 5px; }
.files { display: grid; gap: 5px; list-style: none; padding: 0; margin-top: 13px; max-height: 356px; overflow: auto; }
.files:empty { margin-top: 0; }
.file-row { display: flex; align-items: center; gap: 1px; min-width: 0; border: 1px solid transparent; border-radius: 7px; }
.file-row:hover { background: var(--soft); }
.file-row.active { border-color: #cce4d8; background: #eaf5ef; }
.file-select {
  min-width: 0;
  display: flex;
  flex: 1;
  gap: 9px;
  align-items: center;
  padding: 9px 4px 9px 8px;
  color: var(--ink);
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
}
.file-select .icon { flex-shrink: 0; color: var(--accent); }
.file-detail { min-width: 0; }
.file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px/1.5 var(--mono); }
.file-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.remove-file {
  width: 27px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  margin-right: 3px;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 5px;
}
.remove-file:hover { color: var(--ink); background: #d7e9df; }
.sidebar-foot { margin-top: 15px; padding: 13px 3px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.editor { min-width: 0; }
.empty { min-height: 420px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 24px; }
.empty-icon, .file-icon { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty-icon { width: 57px; height: 57px; border-radius: 9px; margin-bottom: 16px; }
.empty-icon .icon { transform: scale(1.28); }
.empty h2 { font-size: 18px; }
.empty p { color: var(--muted); font-size: 13px; line-height: 1.6; margin-top: 8px; }
.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  gap: 14px;
  padding: 18px 23px;
}
.file-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-icon { width: 41px; height: 41px; flex: 0 0 auto; border-radius: 7px; }
.file-title-text { min-width: 0; }
.file-title h2 { font: 600 clamp(13px, 1.6vw, 17px)/1.4 var(--mono); overflow-wrap: anywhere; }
.file-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); margin-top: 4px; font: 11px/1.55 var(--mono); }
.file-facts span + span::before { content: "·"; margin-right: 8px; color: #658678; }
.badge { flex: 0 0 auto; background: var(--soft); color: var(--accent-dark); border: 1px solid var(--line); border-radius: 5px; padding: 4px 7px; font-size: 11px; }
.tabs { display: flex; gap: 22px; padding: 0 23px; border-block: 1px solid var(--line); background: #fbfdfc; }
.tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 45px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 0 1px;
}
.tabs button:hover, .tabs button[aria-pressed="true"] { color: var(--accent-dark); }
.tabs button[aria-pressed="true"]::after { content: ""; position: absolute; height: 2px; inset: auto 0 -1px; background: var(--accent); }

#common-panel { display: grid; padding: 22px 23px; gap: 18px; }
.field-group { min-width: 0; }
.field-group + .field-group { border-top: 1px solid var(--line); padding-top: 16px; }
.field-group h3 { font-size: 14px; margin-bottom: 11px; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.field { min-width: 0; }
.field label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 6px; margin: 0 0 5px; font-size: 12px; color: var(--muted); }
.field label span { color: #294139; font-weight: 600; }
.field label code { font: 10px/1.4 var(--mono); overflow-wrap: anywhere; }
.control {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid #cfdfd7;
  background: #fbfdfc;
  color: var(--ink);
  line-height: 1.45;
  font-size: 13px;
}
.control::placeholder { color: #6b7e76; opacity: 1; }
.control:hover { border-color: #a6c2b3; }
.control:focus-visible { outline-offset: 1px; }
.control.changed { background: #eff9f3; border-color: #85b99f; }
.control[aria-invalid="true"] { border-color: #bf6a60; background: #fff5f3; }
.field-error { margin-top: 5px; color: var(--error); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }

#all-panel { padding: 16px 23px 14px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 290px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid #cfdfd7;
  color: var(--muted);
  background: #fbfdfc;
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search input { min-width: 0; min-height: 35px; width: 100%; padding: 5px 0; background: transparent; border: 0; color: var(--ink); outline: none; font-size: 13px; }
.search input:focus-visible { outline: none; }
.keyword-table { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
thead { position: sticky; top: 0; z-index: 1; }
th { background: var(--soft); color: var(--muted); text-align: left; font-size: 12px; font-weight: 600; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
th:first-child { width: 37%; }
tbody tr:last-child td { border-bottom: 0; }
td { vertical-align: middle; }
td code { font: 11px/1.45 var(--mono); overflow-wrap: anywhere; }
td .control { display: block; min-height: 34px; resize: vertical; }
.readonly-value { font-size: 13px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.readonly-badge { display: inline-block; margin-left: 5px; color: var(--muted); font-size: 10px; }
.table-note { margin-top: 10px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.no-keywords { padding: 20px 9px; color: var(--muted); text-align: center; }

.editor-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 23px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 11px 11px;
  background: var(--paper);
}
.export-info { min-width: 0; }
#edit-status { font-size: 12px; font-weight: 600; line-height: 1.35; }
.output-name { font: 11px/1.55 var(--mono); margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #cfdfd7;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 630;
  line-height: 1.4;
  white-space: nowrap;
}
.button:hover:not(:disabled) { background: var(--soft); }
.button:disabled { opacity: .66; }
.button-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }

dialog { width: min(412px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 12px; padding: 22px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: #112b22a6; }
dialog h2 { margin-bottom: 16px; font-size: 18px; }
dialog .dialog-field { display: block; margin: 12px 0 5px; color: var(--muted); font-size: 12px; }
dialog textarea { resize: vertical; }
dialog .actions { margin-top: 16px; }

.icon { display: inline-block; position: relative; width: 15px; height: 15px; flex: 0 0 auto; }
.icon::before, .icon::after { content: ""; position: absolute; }
.icon-file { width: 12px; height: 15px; border: 1.4px solid currentColor; border-radius: 2px; }
.icon-file::before { inset: 4px 2px auto; height: 3px; border-block: 1px solid currentColor; }
.icon-search { width: 13px; }
.icon-search::before { width: 7px; height: 7px; border: 1.4px solid currentColor; border-radius: 50%; top: 1px; left: 0; }
.icon-search::after { width: 5px; height: 1.4px; background: currentColor; bottom: 3px; right: 0; transform: rotate(45deg); }
.icon-plus::before, .icon-plus::after, .icon-close::before, .icon-close::after { background: currentColor; inset: 7px 2px auto; height: 1.4px; border-radius: 1px; }
.icon-plus::after { transform: rotate(90deg); }
.icon-close::before { transform: rotate(45deg); }
.icon-close::after { transform: rotate(-45deg); }
.icon-upload, .icon-download { border-bottom: 1.5px solid currentColor; }
.icon-upload::before, .icon-download::before { width: 1.5px; height: 9px; left: calc(50% - .75px); top: 1px; background: currentColor; }
.icon-upload::after, .icon-download::after {
  width: 5px;
  height: 5px;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  left: calc(50% - 3.25px);
  top: 2px;
  transform: rotate(45deg);
}
.icon-download::after { top: 4px; transform: rotate(225deg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 920px) {
  .shell { width: calc(100% - 44px); }
  .workbench { grid-template-columns: 230px minmax(0, 1fr); gap: 14px; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 28px); }
  .topbar-inner { min-height: 58px; }
  .intro { margin-top: 15px; margin-bottom: 13px; padding: 23px 17px; align-items: flex-start; flex-direction: column; gap: 14px; }
  .intro p { margin-top: 8px; font-size: 13px; }
  .workbench { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .sidebar { padding: 13px; }
  .sidebar-heading { margin-bottom: 9px; }
  .files { max-height: 186px; }
  .empty { min-height: 235px; }
  .editor-heading, .editor-footer { padding-inline: 13px; }
  .tabs { padding-inline: 13px; }
  #common-panel, #all-panel { padding-inline: 13px; }
}

@media (max-width: 365px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-footer { align-items: stretch; flex-direction: column; }
  .file-icon { display: none; }
}
