:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #182720;
  background: #f5f7f3;
  --line: #e3e9e2;
  --muted: #596961;
  --green: #1b654d;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible, body:has(#file-input:focus-visible) .open-button {
  outline: 2px solid #43a881;
  outline-offset: 3px;
}
.topbar {
  display: flex; align-items: center; gap: 17px; min-height: 65px;
  padding: 8px max(22px, calc((100% - 1120px) / 2));
  border-bottom: 1px solid var(--line); background: #fff; white-space: nowrap;
}
.brand { display: flex; align-items: center; gap: 9px; letter-spacing: -.3px; }
.brand-icon, .file-icon { display: grid; place-items: center; flex: none; border-radius: 9px; }
.brand-icon { width: 29px; height: 29px; background: #17543e; color: #cef3de; font-size: 19px; }
.divider { height: 20px; border-left: 1px solid var(--line); }
.crumb { color: var(--muted); font-size: 13px; }
.crumb span { color: #7c8d82; margin: 0 6px; }
main { width: min(1120px, calc(100% - 44px)); margin: 44px auto 36px; }
.intro { margin-bottom: 25px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(28px, 3.3vw, 40px); letter-spacing: -.04em; line-height: 1.24; }
.intro p { color: var(--muted); font-size: 14px; margin-top: 11px; }
.widget { background: #fff; border: 1px solid #dce5dc; border-radius: 17px; box-shadow: 0 12px 32px #203c2810; }
.filebar { display: flex; gap: 13px; align-items: center; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.file-icon { width: 43px; height: 43px; background: #e7f4e9; color: #1b654d; font-size: 29px; line-height: 1; }
.file-details { min-width: 0; flex: 1; }
h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.file-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); margin-top: 5px; font-size: 12px; }
#file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#file-source { white-space: nowrap; }
#file-source::before { content: "·"; margin-right: 8px; }
.button { background: #1b654d; color: white; border-radius: 8px; cursor: pointer; padding: 9px 12px; font-weight: 600; font-size: 12px; white-space: nowrap; }
.button:hover { background: #124b38; }
.status { margin: 13px 21px 0; padding: 9px 12px; border-radius: 8px; color: #7b381b; background: #fff3e6; font-size: 13px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 279px; gap: 23px; padding: 19px 21px 15px; }
.preview { min-width: 0; }
.stage {
  position: relative; height: clamp(340px, 41vw, 460px); border-radius: 12px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 38%, #274638 0%, #172e27 56%, #10231d 100%);
}
canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
canvas:active { cursor: grabbing; }
canvas:focus-visible { outline-offset: -4px; }
.view-switch, .view-tools { position: absolute; display: flex; background: #132821ec; border: 1px solid #ffffff36; border-radius: 9px; padding: 3px; }
.view-switch { top: 14px; left: 14px; gap: 3px; }
.view-tools { bottom: 14px; right: 14px; gap: 2px; }
.view-switch button, .view-tools button { border: 0; border-radius: 6px; background: transparent; color: #d6e9de; }
.view-switch button { font-size: 12px; font-weight: 600; padding: 7px 10px; }
.view-tools button { width: 32px; height: 31px; font-size: 19px; }
.view-switch button[aria-pressed=true] { background: #daeee1; color: #123827; }
.view-switch button[aria-pressed=false]:hover, .view-tools button:hover { background: #355749; }
.axis { position: absolute; bottom: 20px; left: 17px; color: #b8d6c7; font: 12px ui-monospace, monospace; pointer-events: none; }
.controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; align-items: center; padding-top: 14px; font-size: 12px; }
.controls label { font-weight: 650; }
#layer { width: 100%; margin: 0; accent-color: var(--green); cursor: pointer; }
#layer-number { padding: 5px 7px; min-width: 77px; text-align: center; border-radius: 5px; background: #e9f4ec; color: #1b654d; font: 12px ui-monospace, monospace; white-space: nowrap; }
.sidebar { min-width: 0; border-left: 1px solid var(--line); padding-left: 21px; }
h3 { font-size: 14px; }
.stats { display: grid; gap: 10px; margin-top: 16px; margin-bottom: 20px; }
.stats div { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 12px; }
dt { color: var(--muted); }
dd { text-align: right; font-weight: 640; font-variant-numeric: tabular-nums; }
.materials-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px solid var(--line); padding-top: 16px; }
.text-button { background: none; border: 0; padding: 4px 0; color: var(--green); font-size: 12px; }
.text-button:hover { text-decoration: underline; }
.material-caption { display: flex; justify-content: space-between; padding: 10px 2px 7px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.materials { padding: 0; list-style: none; margin: 0; max-height: 257px; overflow: auto; }
.materials li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 35px; padding: 3px 2px; font-size: 12px; border-bottom: 1px solid #eef1ed; }
.materials .material-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { width: 12px; height: 12px; border: 1px solid #0002; border-radius: 3px; }
.quantity { font-variant-numeric: tabular-nums; font-weight: 640; }
.widget-footer { display: flex; justify-content: space-between; gap: 12px; padding: 13px 21px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.footnote { margin-top: 15px; text-align: center; color: var(--muted); font-size: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-mode="feishu"] .topbar, [data-mode="feishu"] .intro, [data-mode="feishu"] .footnote { display: none; }
[data-mode="feishu"] main { width: 100%; margin: 0; }
[data-mode="feishu"] .widget { box-shadow: none; }
[data-mode="feishu"] #open-remote { text-decoration: none; }
[data-mode="feishu"]:not(.attachment-loaded) .workspace,
[data-mode="feishu"]:not(.attachment-loaded) .widget-footer { display: none; }
[data-mode="feishu"] .status:not([hidden]) { margin-bottom: 13px; }
@media (max-width: 760px) {
  main { margin-top: 27px; width: calc(100% - 24px); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 23px; }
  .sidebar { border-left: 0; border-top: 1px solid var(--line); padding: 15px 0 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div { flex-direction: column; gap: 3px; }
  .stage { height: clamp(270px, 75vw, 400px); }
}
@media (max-width: 410px) {
  .filebar, .workspace, .widget-footer { padding-left: 12px; padding-right: 12px; }
  .file-icon { display: none; }
  .widget-footer { flex-wrap: wrap; }
}
