/* 代码工作台 · 作用域化样式（源：code-workbench.html 内联样式） */
.cw-app{
      --bg: #e9edf3;
      --chrome: #10141b;
      --chrome-2: #171d27;
      --panel: #f8fafc;
      --paper: #ffffff;
      --line: #d9e0e9;
      --line-dark: rgba(255,255,255,.1);
      --text: #18202c;
      --muted: #6b7686;
      --muted-dark: #9ca7b7;
      --blue: #2563eb;
      --blue-soft: #eaf1ff;
      --green: #0b8f61;
      --amber: #b76508;
      --danger: #be3434;
      --radius: 14px;
      font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
      color: var(--text);
      background: var(--bg);
    }.cw-app *{ box-sizing: border-box; }.cw-app,.cw-app{ margin: 0; min-height: 100%; }.cw-app{ min-width: 320px; overflow: auto; }.cw-app button,.cw-app input,.cw-app textarea{ font: inherit; }.cw-app button{ cursor: pointer; }.cw-app button:focus-visible,.cw-app input:focus-visible,.cw-app textarea:focus-visible{ outline: 3px solid rgba(37,99,235,.28); outline-offset: 2px; }.cw-app [hidden]{ display: none !important; }.cw-app .app{
      min-height: 100vh;
      display: grid;
      grid-template-rows: 68px minmax(0, 1fr);
      background:
        radial-gradient(circle at 12% 8%, rgba(255,255,255,.95), transparent 31%),
        linear-gradient(135deg, #eef2f7, #e4e9f1);
    }.cw-app .topbar{
      position: relative;
      z-index: 20;
      display: flex;
      align-items: center;
      gap: 18px;
      padding: 0 18px;
      color: white;
      background: var(--chrome);
      border-bottom: 1px solid rgba(255,255,255,.08);
      box-shadow: 0 12px 38px rgba(15,23,42,.18);
    }.cw-app .brand{ display: flex; align-items: center; gap: 11px; min-width: 245px; }.cw-app .brand-mark{
      width: 38px; height: 38px; border-radius: 11px;
      display: grid; place-items: center;
      background: linear-gradient(145deg, #3b82f6, #1d4ed8);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 22px rgba(37,99,235,.26);
    }.cw-app .brand-mark svg{ width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }.cw-app .brand-mark svg.wb-k{ width: 24px; height: 24px; fill: none; stroke: none; }.cw-app .brand-mark svg.wb-k path{ fill: #fff; stroke: none; }.cw-app .brand strong{ display: block; font-size: 15px; line-height: 1.2; }.cw-app .brand small{ display: block; margin-top: 3px; color: #8f9bad; font-size: 11px; letter-spacing: .1em; }.cw-app .top-status{ display: flex; align-items: center; gap: 8px; color: #aeb8c7; font-size: 13px; }.cw-app .top-status i{ width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.12); }.cw-app .top-actions{ margin-left: auto; display: flex; align-items: center; gap: 9px; }.cw-app .top-actions-divider{ width: 1px; height: 22px; background: rgba(52,59,67,.18); margin: 0 2px; flex: 0 0 auto; }.cw-app .btn.btn-icon{ width: 38px; min-width: 38px; padding: 0; justify-content: center; flex: 0 0 auto; }.cw-app .btn.btn-icon svg{ margin: 0; }.cw-app .btn{
      min-height: 40px;
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 0 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      font-size: 13px;
      font-weight: 720;
      color: #293342;
      text-decoration: none;
      background: white;
      transition: .18s ease;
    }.cw-app .btn:hover{ transform: translateY(-1px); border-color: #b7c2d1; box-shadow: 0 7px 18px rgba(15,23,42,.08); }.cw-app .btn svg{ width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }.cw-app .btn.dark{ color: white; background: #111111; border-color: rgba(0,0,0,.18); }.cw-app .btn.dark:hover{ background: #000000; border-color: rgba(0,0,0,.3); box-shadow: none; }.cw-app .btn.primary{ color: white; background: #111111; border-color: #111111; }.cw-app .btn.primary:hover{ background: #000000; border-color: #000000; box-shadow: 0 8px 22px rgba(0,0,0,.18); }.cw-app .btn.subtle{ min-height: 34px; padding: 0 11px; color: var(--muted); background: #f8fafc; }.cw-app .workspace{
      height: calc(100vh - 68px);
      min-height: 0;
      display: grid;
      grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
      gap: 1px;
      background: #cfd6e0;
      overflow: hidden;
    }.cw-app .preview-pane,.cw-app .editor-pane{ min-width: 0; min-height: 0; }.cw-app .preview-pane{
      position: sticky;
      top: 0;
      height: calc(100vh - 68px);
      overflow: hidden;
    }.cw-app .preview-pane{ display: grid; grid-template-rows: 58px minmax(0, 1fr); background: #dfe5ed; }.cw-app .pane-toolbar{
      position: relative;
      z-index: 5;
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 0 16px;
      background: rgba(249,251,253,.94);
      border-bottom: 1px solid #cdd5e0;
      backdrop-filter: blur(16px);
    }.cw-app .pane-title{ min-width: 155px; }.cw-app .pane-title strong{ display: block; font-size: 14px; }.cw-app .pane-title span{ display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }.cw-app .device-tabs{ margin: auto; display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #eef2f6; }.cw-app .device-tab{
      min-height: 34px; padding: 0 13px; border: 0; border-radius: 8px;
      display: inline-flex; align-items: center; gap: 7px;
      color: #687486; background: transparent; font-size: 12px; font-weight: 730;
    }.cw-app .device-tab svg{ width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }.cw-app .device-tab.active{ color: #172033; background: white; box-shadow: 0 2px 7px rgba(15,23,42,.1); }.cw-app .viewport-meta{ min-width: 126px; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }.cw-app .preview-canvas{
      position: relative;
      width: 100%;
      max-width: 100%;
      min-height: 0;
      overflow-x: hidden;
      overflow-y: auto;
      padding: 22px;
      background-color: #dfe5ed;
      background-image: linear-gradient(rgba(111,125,145,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(111,125,145,.08) 1px, transparent 1px);
      background-size: 18px 18px;
    }.cw-app .device-positioner{ width: 100%; min-width: 0; min-height: 100%; display: flex; align-items: flex-start; justify-content: center; }.cw-app .device-stage{ position: relative; max-width: 100%; flex: 0 0 auto; transition: width .24s ease, height .24s ease; }.cw-app .device-shell{
      position: absolute; left: 0; top: 0; overflow: hidden;
      background: white; border: 1px solid rgba(15,23,42,.22);
      box-shadow: 0 24px 60px rgba(30,41,59,.18), 0 2px 7px rgba(15,23,42,.09);
      transform-origin: top left; transition: border-radius .24s ease;
      -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    }.cw-app .device-shell.desktop{ width: 1440px; height: 900px; border-radius: 10px; }.cw-app .device-shell.mobile{ width: 390px; height: 844px; border-radius: 24px; border-width: 6px; border-color: #232936; }.cw-app #previewFrame{ width: 100%; height: 100%; display: block; border: 0; background: white; image-rendering: auto; }.cw-app .preview-empty{
      position: absolute; inset: 0; z-index: 4;
      display: grid; place-items: center; padding: 30px; text-align: center;
      background: rgba(232,237,244,.86); backdrop-filter: blur(8px);
    }.cw-app .preview-empty div{ max-width: 340px; }.cw-app .preview-empty svg{ width: 46px; height: 46px; padding: 11px; border-radius: 14px; color: var(--blue); background: white; box-shadow: 0 10px 28px rgba(15,23,42,.1); fill: none; stroke: currentColor; stroke-width: 1.6; }.cw-app .preview-empty b{ display: block; margin-top: 15px; font-size: 16px; }.cw-app .preview-empty p{ margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }.cw-app .editor-pane{ display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--panel); }.cw-app .editor-head{ background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }.cw-app .editor-toolbar{ min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; }.cw-app .editor-toolbar-copy{ min-width: 0; }.cw-app .editor-toolbar-copy strong{ display: block; font-size: 14px; }.cw-app .editor-toolbar-copy span{ display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }.cw-app .editor-toolbar-actions{ margin-left: auto; display: flex; gap: 7px; }.cw-app .editor-toolbar-actions .btn{ min-height: 34px; padding-inline: 10px; font-size: 12px; }.cw-app .editor-scroll{ min-height: 0; overflow: auto; padding: 16px 16px 28px; scroll-padding-top: 16px; scroll-behavior: smooth; }.cw-app .group-list{ display: grid; gap: 14px; padding: 3px 2px 24px; }.cw-app .group-card{ border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 7px 22px rgba(15,23,42,.045); overflow: hidden; }.cw-app .group-card[open]{ border-color: #c8d4e5; box-shadow: 0 10px 28px rgba(15,23,42,.065); }.cw-app .group-card > summary{ min-height: 68px; display: flex; align-items: center; gap: 11px; padding: 11px 13px; list-style: none; cursor: pointer; user-select: none; background: white; }.cw-app .group-card > summary::-webkit-details-marker{ display: none; }.cw-app .group-card[open] > summary{ border-bottom: 1px solid #e7ecf2; background: #fbfcfe; }.cw-app .group-step{ flex: 0 0 auto; width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; color: #526176; background: #edf2f7; font-size: 11px; font-weight: 850; }.cw-app .group-card[open] .group-step{ color: white; background: var(--blue); box-shadow: 0 6px 14px rgba(37,99,235,.24); }.cw-app .group-title{ min-width: 0; flex: 1; }.cw-app .group-title strong{ display: block; font-size: 14px; }.cw-app .group-title small{ display: block; margin-top: 3px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.cw-app .group-count{ flex: 0 0 auto; min-width: 45px; height: 27px; padding: 0 8px; border-radius: 99px; display: grid; place-items: center; color: #617084; background: #eef2f7; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }.cw-app .group-chevron{ flex: 0 0 auto; width: 17px; height: 17px; fill: none; stroke: #8a96a7; stroke-width: 2; transition: transform .18s; }.cw-app .group-card[open] .group-chevron{ transform: rotate(180deg); }.cw-app .group-body{ padding: 12px; background: #f8fafc; }.cw-app .code-area{ display: block; width: 100%; min-height: 255px; max-height: 520px; resize: vertical; border: 1px solid #252e3b; border-radius: 10px 10px 0 0; outline: 0; padding: 14px; color: #d9e2ef; background: #121822; font: 12px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace; tab-size: 2; }.cw-app .code-area:focus{ border-color: #4c7eea; box-shadow: 0 0 0 3px rgba(37,99,235,.13); }.cw-app .code-actions{ display: flex; gap: 8px; padding: 10px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; background: white; }.cw-app .code-actions .btn.primary{ flex: 1; }.cw-app .code-tip{ margin-top: 10px; padding: 10px 12px; border: 1px solid #dce5f2; border-radius: 10px; color: #5e6c80; background: #f1f6fc; font-size: 12px; line-height: 1.6; }.cw-app .fields-toolbar{ position: sticky; top: -12px; z-index: 5; display: flex; align-items: center; gap: 9px; padding: 0 0 10px; background: linear-gradient(#f8fafc 82%, transparent); }.cw-app .field-search{ flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px 0 38px; color: var(--text); background: white; }.cw-app .search-wrap{ position: relative; flex: 1; }.cw-app .search-wrap svg{ position: absolute; left: 12px; top: 50%; width: 16px; transform: translateY(-50%); fill: none; stroke: #8a96a7; stroke-width: 1.8; pointer-events: none; }.cw-app .field-count{ height: 40px; min-width: 64px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: #59677a; background: white; font-size: 12px; font-weight: 700; }.cw-app .field-list{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }.cw-app .field-card{
      position: relative; min-width: 0; min-height: 112px; border: 1px solid #d5dde8; border-radius: 12px; padding: 11px 12px 10px;
      background: linear-gradient(145deg, #ffffff 0%, #fbfcfe 58%, #f1f5f9 100%);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 3px 0 #dce3ec, 0 10px 22px rgba(30,41,59,.075);
      transform: translateY(0) perspective(700px) rotateX(0);
      transition: border-color .18s, box-shadow .18s, transform .18s;
      overflow: hidden;
    }.cw-app .field-card::after{ content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent); pointer-events: none; }.cw-app .field-card:hover{ border-color: #aebdd0; transform: translateY(-3px) perspective(700px) rotateX(1deg); box-shadow: inset 0 1px 0 #fff, 0 4px 0 #d4dce7, 0 15px 28px rgba(30,41,59,.11); }.cw-app .field-card:focus-within{ border-color: #7da4f6; box-shadow: 0 0 0 3px rgba(37,99,235,.1), 0 4px 0 #cbd8ee, 0 15px 28px rgba(37,99,235,.12); transform: translateY(-2px); }.cw-app .field-card.preview-selected{ border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37,99,235,.14), 0 4px 0 #b8caf0, 0 18px 34px rgba(37,99,235,.16); animation: editorCardPulse .72s ease-in-out 2 alternate; }@keyframes editorCardPulse{ from { transform: translateY(0); } to { transform: translateY(-4px); } }.cw-app .field-meta{ display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }.cw-app .field-index{ width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #526176; background: #eef2f7; font-size: 9px; font-weight: 850; }.cw-app .field-name{ min-width: 0; flex: 1; font-size: 13px; font-weight: 780; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.cw-app .field-kind{ border-radius: 99px; padding: 4px 7px; color: #5f6c80; background: #f1f4f8; font-size: 10px; font-weight: 780; white-space: nowrap; }.cw-app .field-kind.mobile{ color: #7c3aed; background: #f1eafe; }.cw-app .field-kind.desktop{ color: #116599; background: #e8f4fb; }.cw-app .field-kind.background{ color: #a25705; background: #fff3df; }.cw-app .field-kind.color{ color: #a25705; background: #fff3df; }.cw-app .field-kind.size{ color: #075985; background: #e7f5fc; }.cw-app .field-kind.spacing{ color: #6d28d9; background: #f1eafe; }.cw-app .field-kind.type{ color: #9f1239; background: #ffe9f0; }.cw-app .field-kind.layout{ color: #0f766e; background: #e4f7f4; }.cw-app .device-badge{ flex: 0 0 auto; border: 1px solid transparent; border-radius: 999px; padding: 4px 7px; font-size: 10px; line-height: 1; font-weight: 800; white-space: nowrap; }.cw-app .device-badge.desktop{ color: #075985; border-color: #bae6fd; background: #e8f7ff; }.cw-app .device-badge.mobile{ color: #6d28d9; border-color: #ddd0fe; background: #f3edff; }.cw-app .field-input,.cw-app .field-textarea,.cw-app .field-select,.cw-app .field-number{
      display: block; width: 100%; border: 1px solid #d7dfe9; border-radius: 8px; padding: 9px 10px; color: var(--text); background: #fbfcfe; font-size: 13px; line-height: 1.45; transition: .16s;
    }.cw-app .field-input,.cw-app .field-select,.cw-app .field-number{ height: 38px; }.cw-app .field-textarea{ min-height: 68px; resize: vertical; }.cw-app .field-input:focus,.cw-app .field-textarea:focus,.cw-app .field-select:focus,.cw-app .field-number:focus{ border-color: #7ca2f1; background: white; outline: 0; }.cw-app .field-path{ margin-top: 6px; color: #8a95a5; font: 9px/1.4 "SFMono-Regular", Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.cw-app .field-footer{ display: flex; align-items: center; gap: 7px; margin-top: 7px; }.cw-app .field-footer .field-path{ flex: 1; min-width: 0; margin: 0; }.cw-app .reset-field{ flex: 0 0 auto; border: 0; padding: 2px 0; color: #718096; background: transparent; font-size: 11px; }.cw-app .reset-field:hover{ color: var(--blue); }.cw-app .image-control{ display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: center; }.cw-app .image-thumb{ width: 52px; height: 44px; border: 1px solid #d9e0e9; border-radius: 8px; object-fit: cover; background: linear-gradient(135deg,#e8edf4,#f8fafc); }.cw-app .image-thumb.empty{ border-style: dashed; }.cw-app .color-control{ display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; }.cw-app .color-picker{ width: 46px; height: 38px; border: 1px solid #d7dfe9; border-radius: 8px; padding: 4px; background: #fff; }.cw-app .measure-control{ display: grid; grid-template-columns: minmax(0, 1fr) 72px; gap: 7px; }.cw-app .empty-list{ grid-column: 1 / -1; }.cw-app .field-list.style-grouped-list{ display: block; }.cw-app .style-kind-tabs{ margin: 1px 0 14px; padding: 5px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; border: 1px solid #d6dee9; border-radius: 12px; background: #edf2f7; box-shadow: inset 0 1px 2px rgba(15,23,42,.05); }.cw-app .style-kind-tab{ min-width: 0; min-height: 42px; border: 1px solid transparent; border-radius: 9px; padding: 5px 7px; display: flex; align-items: center; justify-content: center; gap: 5px; color: #5d6979; background: transparent; font-size: 11px; font-weight: 800; white-space: nowrap; transition: box-shadow .16s ease, border-color .16s ease; }.cw-app .style-kind-tab.active{ color: #172033; border-color: #1f2937; background: #ffffff; box-shadow: inset 0 1px 0 #fff, 0 3px 0 #cbd2dc, 0 7px 15px rgba(15,23,42,.1); }.cw-app .style-kind-tab:disabled{ opacity: .36; cursor: not-allowed; }.cw-app .style-kind-tab-count{ border-radius: 999px; padding: 2px 5px; color: #111827; background: rgba(226,232,240,.96); font-size: 9px; font-variant-numeric: tabular-nums; }.cw-app .style-subgroup{ margin-bottom: 16px; }.cw-app .style-subgroup:last-child{ margin-bottom: 0; }.cw-app .style-subgroup-head{ min-height: 40px; margin-bottom: 9px; padding: 0 4px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid #dce3ec; }.cw-app .style-subgroup-icon{ width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; background: white; box-shadow: 0 2px 0 #d9e0e9, 0 7px 15px rgba(15,23,42,.07); font-size: 13px; }.cw-app .style-subgroup-title{ font-size: 13px; font-weight: 820; }.cw-app .style-subgroup-count{ margin-left: auto; border-radius: 999px; padding: 4px 8px; color: #687486; background: #e9eef5; font-size: 10px; font-weight: 800; }.cw-app .style-subgroup-grid{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }.cw-app .empty-list{ min-height: 210px; border: 1px dashed #cbd4e0; border-radius: 12px; display: grid; place-items: center; padding: 24px; text-align: center; background: rgba(255,255,255,.55); }.cw-app .empty-list svg{ width: 34px; height: 34px; color: #8794a6; fill: none; stroke: currentColor; stroke-width: 1.5; }.cw-app .empty-list b{ display: block; margin-top: 11px; font-size: 14px; }.cw-app .empty-list p{ max-width: 290px; margin: 6px auto 0; color: var(--muted); font-size: 12px; line-height: 1.65; }.cw-app .toast{
      position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
      min-width: 210px; max-width: min(430px, calc(100% - 32px)); padding: 12px 16px; border-radius: 11px;
      color: white; background: #17202c; box-shadow: 0 16px 40px rgba(15,23,42,.25); font-size: 13px; text-align: center;
      opacity: 0; pointer-events: none; transition: .22s ease;
    }.cw-app .toast.show{ opacity: 1; transform: translate(-50%, 0); }.cw-app .toast.error{ background: #9d2929; }.cw-app .group-card{
      display:none;
    }.cw-app .group-card.category-active{
      display:block;
    }.cw-app .category-rail{
      position:sticky;
      top:0;
      height:100%;
    }.cw-app .field-meta{ margin-bottom:9px; }.cw-app .field-card input,.cw-app .field-card textarea,.cw-app .field-card select{
      background:#ffffff;
      border-radius:10px;
    }.cw-app .field-list{ grid-template-columns:repeat(2,minmax(0,1fr)); }.cw-app .editor-workspace{
      min-height:0;
      display:grid;
      grid-template-columns:104px minmax(0,1fr);
    }.cw-app .category-rail{
      padding:14px 10px;
      border-right:1px solid var(--line);
      background:#f1f5f9;
      display:flex;
      flex-direction:column;
      gap:10px;
    }.cw-app .category-item{
      width:100%;
      min-height:72px;
      border:1px solid var(--line);
      border-radius:14px;
      background:white;
      color:#536174;
      display:flex;
      flex-direction:column;
      align-items:center;
      justify-content:center;
      gap:5px;
      font-size:12px;
      font-weight:700;
      transition:.18s;
    }.cw-app .category-item:hover{
      transform:translateX(3px);
      border-color:#93b4ff;
    }.cw-app .category-item.active{
      color:white;
      background:var(--blue);
      border-color:var(--blue);
      box-shadow:0 8px 20px rgba(37,99,235,.25);
    }.cw-app .category-item span{font-size:12px}.cw-app .editor-scroll{
      height:100%;
      min-height:0;
      overflow:auto;
    }@media (max-width: 1050px){.cw-app{ overflow: auto; }.cw-app .app{ min-height: 100vh; grid-template-rows: auto auto; }.cw-app .topbar{ min-height: 68px; flex-wrap: wrap; padding-block: 10px; }.cw-app .top-status{ display: none; }.cw-app .workspace{ grid-template-columns: 1fr; grid-template-rows: minmax(560px, 72vh) minmax(680px, auto); }.cw-app .editor-pane{ min-height: 760px; }.cw-app .field-list{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }@media (max-width: 660px){.cw-app .brand{ min-width: 0; }.cw-app .brand small{ display: none; }.cw-app .top-actions .btn.dark{ display: none; }.cw-app .top-actions .btn{ padding-inline: 11px; }.cw-app .top-actions .btn span{ display: none; }.cw-app .pane-title,.cw-app .viewport-meta{ display: none; }.cw-app .device-tabs{ margin: auto; }.cw-app .preview-canvas{ padding: 12px; }.cw-app .editor-toolbar-copy span{ max-width: 210px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.cw-app .editor-toolbar-actions .btn{ padding-inline: 8px; }.cw-app .field-list{ grid-template-columns: 1fr; }.cw-app .style-subgroup-grid{ grid-template-columns: 1fr; }.cw-app .style-kind-tabs{ grid-template-columns: repeat(2, minmax(0, 1fr)); }.cw-app .group-title small{ max-width: 190px; }
    }.cw-app{
      --bg: #f1f3f5;
      --chrome: rgba(255,255,255,.72);
      --chrome-2: #40464d;
      --panel: rgba(247,249,251,.68);
      --paper: rgba(255,255,255,.78);
      --line: rgba(57,64,72,.12);
      --text: #252a30;
      --muted: #77808b;
      --blue: #454c54;
      --blue-soft: rgba(69,76,84,.08);
    }.cw-app button:focus-visible,.cw-app input:focus-visible,.cw-app textarea:focus-visible{ outline-color: rgba(63,70,78,.2); }.cw-app .app{
      background:
        radial-gradient(circle at 14% 5%, rgba(255,255,255,.98) 0 17%, transparent 44%),
        radial-gradient(circle at 92% 16%, rgba(255,255,255,.82) 0 12%, transparent 38%),
        linear-gradient(135deg,#f6f7f8,#e9edf1);
    }.cw-app .app::before{
      content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .28;
      background-image: linear-gradient(rgba(55,63,72,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(55,63,72,.04) 1px,transparent 1px);
      background-size: 32px 32px;
    }.cw-app .topbar{
      margin: 14px 18px 0; min-height: 54px; padding: 0 15px; color: var(--text);
      border: 1px solid rgba(255,255,255,.9); border-radius: 20px 20px 0 0;
      background: rgba(255,255,255,.65); backdrop-filter: blur(26px) saturate(135%); -webkit-backdrop-filter: blur(26px) saturate(135%);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.98),0 16px 38px rgba(37,45,54,.075);
    }.cw-app .brand-mark{
      color: #fff; background: linear-gradient(145deg,#59616a,#3f464e);
      box-shadow: inset 0 1px 0 rgba(255,255,255,.28),0 8px 20px rgba(42,49,57,.14);
    }.cw-app .brand small{ color: #8a929d; }.cw-app .top-status{ color: #6f7884; }.cw-app .top-status i{ background: #55a886; box-shadow: 0 0 0 4px rgba(85,168,134,.12); }.cw-app .btn{ border-color: rgba(52,59,67,.12); color: #414850; background: rgba(255,255,255,.68); box-shadow: inset 0 1px 0 rgba(255,255,255,.95); backdrop-filter: blur(12px); }.cw-app .btn:hover{ color: #30363d; border-color: rgba(52,59,67,.22); background: rgba(255,255,255,.9); box-shadow: 0 9px 22px rgba(38,45,53,.075); }.cw-app .btn.dark{ color: #424950; background: rgba(255,255,255,.74); border-color: rgba(52,59,67,.14); }.cw-app .btn.dark:hover{ color: #30363d; background: rgba(255,255,255,.92); border-color: rgba(52,59,67,.23); box-shadow: 0 9px 22px rgba(38,45,53,.075); }.cw-app .btn.primary{ color: #fff; background: linear-gradient(145deg,#59616a,#40474f); border-color: #4b535c; box-shadow: inset 0 1px 0 rgba(255,255,255,.2),0 8px 18px rgba(44,51,59,.14); }.cw-app .btn.primary:hover{ background: linear-gradient(145deg,#525a63,#394047); border-color: #444b53; box-shadow: 0 10px 22px rgba(42,49,57,.17); }.cw-app .workspace{ height: calc(100vh - 68px); margin: 0 18px 14px; border: 1px solid rgba(255,255,255,.88); border-top: 0; border-radius: 0 0 20px 20px; background: rgba(64,72,81,.09); box-shadow: 0 20px 46px rgba(35,43,52,.07); }.cw-app .preview-pane{ height: calc(100vh - 68px); background: rgba(239,242,245,.6); }.cw-app .pane-toolbar,.cw-app .editor-head{ background: rgba(255,255,255,.62); border-color: rgba(54,61,69,.1); backdrop-filter: blur(22px) saturate(135%); -webkit-backdrop-filter: blur(22px) saturate(135%); }.cw-app .preview-canvas{ background-color: rgba(227,232,237,.62); background-image: linear-gradient(rgba(61,69,78,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(61,69,78,.04) 1px,transparent 1px); background-size: 24px 24px; }.cw-app .device-tabs{ border-color: rgba(55,62,70,.1); background: rgba(224,228,233,.62); backdrop-filter: blur(12px); }.cw-app .device-tab.active{ color: #fff; background: #4a5159; box-shadow: inset 0 1px 0 rgba(255,255,255,.18),0 5px 13px rgba(43,50,58,.13); }.cw-app .device-shell{ border-color: rgba(46,53,61,.16); box-shadow: 0 24px 60px rgba(38,46,55,.12),0 2px 7px rgba(25,31,38,.05); }.cw-app .device-shell.mobile{ border-color: #4b525a; }.cw-app .editor-pane,.cw-app .editor-scroll{ background: rgba(247,249,251,.62); }.cw-app .category-rail{ border-color: rgba(51,58,66,.1); background: rgba(241,244,247,.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }.cw-app .category-item{ color: #626b75; border-color: rgba(52,59,67,.12); background: rgba(255,255,255,.66); box-shadow: inset 0 1px 0 rgba(255,255,255,.98),0 7px 17px rgba(39,47,56,.04); }.cw-app .category-item:hover{ transform: translateX(2px); color: #454c54; border-color: rgba(52,59,67,.22); }.cw-app .category-item.active{ color: #fff; background: linear-gradient(145deg,#5b636c,#424950); border-color: #4c545d; box-shadow: inset 0 1px 0 rgba(255,255,255,.2),0 10px 22px rgba(43,50,58,.14); }.cw-app .group-card,.cw-app .group-card[open]{ border-color: rgba(52,59,67,.1); background: rgba(255,255,255,.64); box-shadow: inset 0 1px 0 rgba(255,255,255,.98),0 10px 30px rgba(38,46,55,.045); backdrop-filter: blur(18px); }.cw-app .group-card > summary,.cw-app .group-card[open] > summary,.cw-app .group-body{ border-color: rgba(52,59,67,.09); background: rgba(255,255,255,.5); }.cw-app .group-card[open] .group-step{ background: #525a63; box-shadow: 0 6px 14px rgba(43,50,58,.13); }.cw-app .fields-toolbar{ background: linear-gradient(rgba(248,250,252,.9) 82%,transparent); }.cw-app .field-search,.cw-app .field-count,.cw-app .field-input,.cw-app .field-textarea,.cw-app .field-select,.cw-app .field-number{ border-color: rgba(52,59,67,.11); background: rgba(255,255,255,.72); }.cw-app .field-card{ border-color: rgba(52,59,67,.11); background: linear-gradient(145deg,rgba(255,255,255,.86),rgba(247,249,251,.74)); box-shadow: inset 0 1px 0 rgba(255,255,255,.98),0 3px 0 rgba(57,65,74,.09),0 11px 25px rgba(38,46,55,.052); backdrop-filter: blur(15px); }.cw-app .field-card:hover{ border-color: rgba(48,55,63,.2); box-shadow: inset 0 1px 0 #fff,0 4px 0 rgba(57,65,74,.1),0 16px 31px rgba(38,46,55,.075); }.cw-app .field-card:focus-within,.cw-app .field-card.preview-selected{ border-color: #59616a; box-shadow: 0 0 0 3px rgba(69,76,84,.08),0 4px 0 rgba(69,76,84,.18),0 17px 34px rgba(38,46,55,.09); }.cw-app .style-kind-tabs{ border-color: rgba(52,59,67,.1); background: rgba(226,231,236,.58); backdrop-filter: blur(14px); }.cw-app .style-kind-tab.active{ color: #fff; border-color: #555d66; background: linear-gradient(145deg,#626a73,#484f57); box-shadow: inset 0 1px 0 rgba(255,255,255,.2),0 3px 0 #3e454c,0 8px 17px rgba(43,50,58,.13); }.cw-app .style-kind-tab .style-kind-tab-count,.cw-app .style-kind-tab.active .style-kind-tab-count{color:#111827!important;background:rgba(238,242,246,.96)!important;}.cw-app .style-subgroup-icon{ background: rgba(255,255,255,.76); box-shadow: 0 2px 0 rgba(52,59,67,.09),0 7px 15px rgba(38,46,55,.045); }.cw-app .code-area{ color: #edf0f2; background: #343a41; border-color: #30363d; }.cw-app .code-area:focus{ border-color: #59616a; box-shadow: 0 0 0 3px rgba(69,76,84,.1); }.cw-app .code-tip{ color: #69727d; border-color: rgba(52,59,67,.09); background: rgba(238,241,244,.64); }@media (max-width: 1050px){.cw-app .topbar{ margin: 10px 10px 0; }.cw-app .workspace{ margin: 0 10px 10px; height: auto; }.cw-app .preview-pane{ height: 72vh; }
    }.cw-app .group-card{
      border: 1px solid rgba(255,255,255,.72);
      border-radius: 18px;
      background: rgba(255,255,255,.58);
      box-shadow:
        0 18px 45px rgba(15,23,42,.08),
        inset 0 1px 0 rgba(255,255,255,.9);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }.cw-app .group-card > summary{
      background: rgba(255,255,255,.48);
      border-radius: 18px 18px 0 0;
    }.cw-app .group-card[open] > summary{
      background: rgba(255,255,255,.68);
      border-bottom: 1px solid rgba(220,226,236,.8);
    }.cw-app .group-card[open]{
      border-color: rgba(255,255,255,.9);
      box-shadow:
        0 22px 55px rgba(15,23,42,.12),
        inset 0 1px 0 rgba(255,255,255,.95);
    }.cw-app .group-body{
      background: rgba(247,249,252,.42);
    }.cw-app .group-step{
      background: rgba(240,243,248,.9);
    }.cw-app .group-card[open] .group-step{
      background:#111111;
      box-shadow:0 8px 18px rgba(0,0,0,.18);
    }.cw-app .sync-badge{font-size:10px;white-space:nowrap;background:#eef1ed;color:#496447;border:1px solid #d7e1d4;padding:3px 6px;border-radius:6px;}.cw-app .sync-badge.synced{background:#e7f3e7;color:#245f2a;border-color:#bdd8bd;}.cw-app .field-meta{flex-wrap:wrap;gap:6px;}.cw-app .hidden-input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;overflow:hidden}.cw-app .gen-panel{display:flex;flex-direction:column;gap:12px;padding:2px}.cw-app .gen-label{font-size:12px;font-weight:700;color:#414850}.cw-app .gen-prompt{min-height:118px;font-size:12px;border-radius:14px;resize:vertical}.cw-app .gen-model-picker{display:flex;flex-direction:column;gap:9px}.cw-app .gen-model-select-wrap{position:relative}.cw-app .gen-model-select,.cw-app .gen-task-select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b747d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:15px;appearance:none;-webkit-appearance:none;-moz-appearance:none;cursor:pointer}.cw-app .gen-model-select{width:100%;height:40px;border:1px solid rgba(52,59,67,.16);border-radius:11px;background-color:rgba(255,255,255,.92);color:#2f363d;padding:0 34px 0 13px;outline:none;font:inherit;font-size:12px;font-weight:650;transition:.15s}.cw-app .gen-model-select:hover{border-color:rgba(52,59,67,.34);background-color:#fff}.cw-app .gen-model-select:focus{border-color:#4a5159;box-shadow:0 0 0 3px rgba(74,81,89,.12)}.cw-app .gen-model-card{--mc:#4a5159;width:100%;display:flex;align-items:center;gap:8px;padding:7px 10px;border:1px solid rgba(52,59,67,.13);border-left:3px solid var(--mc);border-radius:11px;background:rgba(255,255,255,.92);position:relative;transition:.18s;font-family:inherit;text-align:left;cursor:pointer}.cw-app .gen-model-card:hover{border-color:var(--mc);box-shadow:0 8px 20px rgba(20,30,40,.08);transform:translateY(-1px)}.cw-app .gen-model-card.is-idle{opacity:.85}.cw-app .gen-model-icon{flex:none;width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:#f4f6f8;border:1px solid rgba(52,59,67,.06);overflow:hidden}.cw-app .gen-model-icon svg{width:19px;height:19px;display:block}.cw-app .gen-model-icon img{width:78%;height:78%;object-fit:contain;display:block}.cw-app .gen-model-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-app .gen-model-name-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.cw-app .gen-model-info b{font-size:12.5px;color:#2f363d;line-height:1.25}.cw-app .gen-model-price{font-size:10px;font-weight:700;color:#b45309;background:#fef3e2;border:1px solid #f6e0bd;padding:1px 7px;border-radius:99px;white-space:nowrap}.cw-app .gen-model-desc{font-size:10px;color:#6b747d;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-app .gen-model-status{flex:none;display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:750;padding:4px 10px;border-radius:999px;white-space:nowrap}.cw-app .gen-model-status i{width:7px;height:7px;border-radius:50%;background:#a7b0b9}.cw-app .gen-model-status.ready{background:#e7f4ec;color:#2b7a4b}.cw-app .gen-model-status.ready i{background:#2f9e5e;box-shadow:0 0 0 3px rgba(47,158,94,.16)}.cw-app .gen-model-status.idle{background:#f0f2f5;color:#8a939d}.cw-app .gen-model-id{display:none}.cw-app .gen-model-chevron{flex:none;display:inline-flex;flex-direction:column;align-items:center;gap:1px;color:var(--mc);font-weight:700}.cw-app .gen-model-chevron svg{width:15px;height:15px}.cw-app .gen-model-chevron small{font-size:9px;color:#8a939d;font-weight:700}.cw-app .gen-task-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.cw-app .gen-field{display:flex;flex-direction:column;gap:5px;min-width:0}.cw-app .gen-field-label{font-size:10px;font-weight:700;color:#7a838d;padding-left:2px}.cw-app .gen-task-select{width:100%;height:40px;border:1px solid rgba(52,59,67,.14);border-radius:11px;background-color:rgba(255,255,255,.92);color:#333a42;padding:0 34px 0 11px;outline:none;font:inherit;font-size:11px;transition:.15s}.cw-app .gen-task-select:focus{border-color:#4a5159;box-shadow:0 0 0 3px rgba(74,81,89,.1)}.cw-app .gen-assets{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.cw-app .gen-upload{display:inline-flex;align-items:center;gap:7px}.cw-app .gen-upload svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.cw-app .gen-thumb-list{display:flex;gap:7px;flex-wrap:wrap;align-items:center}.cw-app .gen-thumb{position:relative;width:54px;height:54px;border-radius:11px;overflow:hidden;border:1px solid rgba(52,59,67,.16);background:#edf1f4}.cw-app .gen-thumb img{width:100%;height:100%;object-fit:cover;display:block}.cw-app .gen-thumb-remove{position:absolute;right:2px;top:2px;width:18px;height:18px;border:0;border-radius:50%;background:rgba(20,24,29,.72);color:#fff;font-size:12px;line-height:1;cursor:pointer;padding:0}.cw-app .gen-ref-meta{display:inline-flex;align-items:center;gap:7px;color:#7f8994;font-size:10px}.cw-app .gen-ref-count{display:inline-flex;align-items:center;justify-content:center;min-width:46px;height:26px;padding:0 8px;border-radius:999px;background:#eef2f6;color:#111827;font-weight:800;font-variant-numeric:tabular-nums}.cw-app .gen-file-list{display:flex;gap:7px;flex-wrap:wrap;align-items:center;width:100%}.cw-app .gen-file-chip{display:inline-flex;align-items:center;gap:7px;max-width:220px;min-height:34px;padding:6px 8px;border:1px solid rgba(52,59,67,.14);border-radius:10px;background:rgba(255,255,255,.72);color:#4e5863;font-size:10px}.cw-app .gen-file-chip b{max-width:142px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:750}.cw-app .gen-file-chip small{color:#8a949f;white-space:nowrap}.cw-app .gen-file-remove{width:18px;height:18px;border:0;border-radius:50%;background:rgba(32,38,44,.1);color:#626d78;cursor:pointer;padding:0;line-height:18px}.cw-app .gen-file-remove:hover{background:#242a31;color:#fff}.cw-app .gen-memory-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:#7f8994;font-size:10px}.cw-app .gen-memory-pill{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border-radius:999px;background:#eef3ef;color:#38604a;border:1px solid rgba(56,96,74,.12);font-weight:700}.cw-app .gen-memory-clear{border:0;background:transparent;color:#8a939d;font-size:10px;cursor:pointer;padding:4px 5px;border-radius:7px}.cw-app .gen-memory-clear:hover{background:rgba(52,59,67,.07);color:#333a42}.cw-app .gen-progress{display:none;padding:10px 12px;border:1px solid rgba(52,59,67,.12);border-radius:13px;background:rgba(255,255,255,.66)}.cw-app .gen-progress.show{display:block}.cw-app .gen-progress-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;color:#626c77;font-size:10px}.cw-app .gen-progress-head b{font-size:11px;color:#333a42}.cw-app .gen-progress-track{height:8px;overflow:hidden;border-radius:999px;background:#e1e6eb}.cw-app .gen-progress-bar{width:0;height:100%;border-radius:999px;background:linear-gradient(90deg,#333a42,#707b86);transition:width .35s ease}.cw-app .gen-panel.is-busy #genBtn{opacity:.6;pointer-events:none}.cw-app .gen-stop{display:none}.cw-app .gen-panel.is-busy .gen-stop{display:inline-flex}.cw-app .gen-progress-meta{display:inline-flex;align-items:center;gap:6px;font-variant-numeric:tabular-nums}.cw-app .gen-elapsed{color:#87919c}.cw-app .gen-panel .code-actions{border-top:1px solid rgba(52,59,67,.12);border-radius:13px;padding:9px;background:rgba(255,255,255,.64)}.cw-app .gen-panel .code-tip{margin-top:0}.cw-app .group-card.category-active{margin-top:2px;overflow:hidden}.cw-app .knowledge-panel{display:grid;gap:12px}.cw-app .knowledge-upload-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.cw-app .knowledge-list{display:grid;gap:8px}.cw-app .knowledge-item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:11px 12px;border:1px solid rgba(52,59,67,.12);border-radius:13px;background:rgba(255,255,255,.72)}.cw-app .knowledge-item-copy{min-width:0}.cw-app .knowledge-item-copy b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#343b43;font-size:12px}.cw-app .knowledge-item-copy small{display:block;margin-top:4px;color:#85909b;font-size:10px}.cw-app .knowledge-delete{min-height:32px;padding:0 10px;border:1px solid rgba(164,63,63,.16);border-radius:9px;color:#9b4848;background:#fff7f7;cursor:pointer;font-size:11px}.cw-app .knowledge-empty{padding:16px;border:1px dashed rgba(52,59,67,.18);border-radius:13px;color:#87919b;text-align:center;font-size:11px}.cw-app .knowledge-status{color:#77818c;font-size:10px;line-height:1.5}@media (max-width:760px){.cw-app .gen-task-row{grid-template-columns:1fr}.cw-app .balance-detail{grid-template-columns:1fr}
    }.cw-app .balance-overlay{position:fixed;inset:0;z-index:130;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(13,18,26,.5);backdrop-filter:blur(3px);}.cw-app .balance-overlay[hidden]{display:none;}.cw-app .balance-modal{width:min(780px,100%);max-height:calc(100vh - 48px);overflow:auto;background:var(--paper);border:1px solid var(--line);border-radius:18px;box-shadow:0 30px 80px rgba(8,12,20,.42);}.cw-app .balance-modal-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:12px;padding:16px 20px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.96);backdrop-filter:blur(6px);}.cw-app .balance-modal-head h2{margin:0;font-size:16px;font-weight:800;color:#1a2230;}.cw-app .balance-modal-head small{display:block;margin-top:3px;color:var(--muted);font-size:11.5px;}.cw-app .balance-head-actions{margin-left:auto;display:flex;align-items:center;gap:8px;}.cw-app .balance-x{width:38px;height:38px;min-width:38px;border:1px solid var(--line);border-radius:10px;background:#fff;color:#44505f;display:grid;place-items:center;}.cw-app .balance-x svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}.cw-app .balance-x:hover{border-color:#b7c2d1;background:#f6f8fb;}.cw-app .balance-body{padding:18px 20px 6px;display:grid;gap:15px;}.cw-app .balance-card{border:1px solid var(--line);border-radius:15px;overflow:hidden;background:linear-gradient(180deg,#fcfdff,#f6f8fb);}.cw-app .balance-card-head{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px dashed var(--line);}.cw-app .balance-vendor-logo{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;background:#fff;border:1px solid var(--line);flex:0 0 auto;}.cw-app .balance-vendor-logo svg{width:25px;height:25px;}.cw-app .balance-vendor-logo img{width:78%;height:78%;object-fit:contain;display:block;}.cw-app .balance-vendor-name{font-size:14px;font-weight:800;color:#1c2531;}.cw-app .balance-vendor-sub{display:block;margin-top:2px;font-size:11px;color:var(--muted);}.cw-app .balance-pill{margin-left:auto;font-size:12px;font-weight:700;padding:5px 11px;border-radius:999px;white-space:nowrap;}.cw-app .balance-pill.ok{background:#e6f7ef;color:var(--green);}.cw-app .balance-pill.warn{background:#fdf2e0;color:var(--amber);}.cw-app .balance-pill.bad{background:#fbeaea;color:var(--danger);}.cw-app .balance-pill.off{background:#eef1f5;color:var(--muted);}.cw-app .balance-amount{padding:15px 16px 13px;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;}.cw-app .balance-amount b{font-size:30px;font-weight:800;letter-spacing:-.02em;color:#141c28;}.cw-app .balance-amount small{color:var(--muted);font-size:12px;}.cw-app .balance-detail{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--line);border-top:1px solid var(--line);}.cw-app .balance-detail div{background:#fff;padding:11px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12.5px;}.cw-app .balance-detail .k{color:var(--muted);}.cw-app .balance-detail .v{font-weight:700;color:#222c3a;}.cw-app .balance-detail .v.danger{color:var(--danger);}.cw-app .balance-note{margin:14px 16px 16px;padding:11px 13px;border-radius:10px;font-size:12px;line-height:1.6;}.cw-app .balance-note.off{background:#f0f3f7;color:#5d6877;}.cw-app .balance-note.err{background:#fbeaea;color:var(--danger);}.cw-app .balance-note code{background:rgba(0,0,0,.06);padding:1px 5px;border-radius:5px;font-size:11px;}.cw-app .balance-loading{padding:42px 20px;text-align:center;color:var(--muted);font-size:13px;}.cw-app .balance-loading .spinner{width:26px;height:26px;border-radius:50%;border:3px solid #d7dee7;border-top-color:var(--blue);margin:0 auto 12px;animation:balance-spin .8s linear infinite;}@keyframes balance-spin{to{transform:rotate(360deg);}}.cw-app .balance-foot{padding:12px 20px 18px;color:var(--muted);font-size:11.5px;line-height:1.7;}.cw-app .balance-foot a{color:var(--blue);text-decoration:none;font-weight:700;}.cw-app .balance-foot a:hover{text-decoration:underline;}

/* ============================================================
   主框架内嵌适配：只处理尺寸、圆角与留白
   配色沿用代码工作台自身的黑白磨砂灰，不改任何强调色
   ============================================================ */
#section-code-workbench{padding:0}
#section-code-workbench .cw-app{
  position:relative;
  height:calc(100vh - 130px);
  min-height:560px;
  min-width:0;
  overflow:hidden;
  border-radius:20px;
  background:transparent;
}
/* 删掉工具顶栏后由两行栅格收成一行，并填满容器 */
#section-code-workbench .cw-app .app{
  position:relative;
  inset:0;
  width:100%;
  max-width:100%;
  height:100%;
  min-height:0;
  grid-template-rows:minmax(0,1fr);
  overflow:hidden;
  border-radius:20px;
  background:
    radial-gradient(circle at 14% 5%, rgba(255,255,255,.98) 0 17%, transparent 44%),
    radial-gradient(circle at 92% 16%, rgba(255,255,255,.82) 0 12%, transparent 38%),
    linear-gradient(135deg,#f6f7f8,#e9edf1);
}
/* 原本贴在顶栏上的整屏网格光斑，内嵌后不再铺到侧栏 */
#section-code-workbench .cw-app .app::before{content:none}
#section-code-workbench .cw-app .workspace{
  height:100%;
  margin:0;
  border:1px solid rgba(255,255,255,.92);
  border-radius:20px;
  overflow:hidden;
  grid-template-columns:minmax(0,1.5fr) minmax(380px,1fr);
  background:rgba(64,72,81,.09);
  box-shadow:0 18px 44px rgba(35,43,52,.07);
}
#section-code-workbench .cw-app .preview-pane{
  position:relative;
  height:100%;
  min-width:0;
  overflow:hidden;
  background:rgba(239,242,245,.6);
}
#section-code-workbench .cw-app .editor-pane,
#section-code-workbench .cw-app .editor-scroll{
  min-width:0;
  max-width:100%;
  overflow-x:hidden;
}
#section-code-workbench .cw-app .field-list,
#section-code-workbench .cw-app .style-subgroup-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
#section-code-workbench .cw-app .style-kind-tabs{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
#section-code-workbench .cw-app .preview-canvas{
  padding:0 0 12px;
  background-color:rgba(227,232,237,.62);
  background-image:linear-gradient(rgba(61,69,78,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(61,69,78,.04) 1px,transparent 1px);
  background-size:24px 24px;
}
/* border 会吃掉 iframe 的 1–6px 视口，改成不占布局的外圈，保证内部严格是 1440×900 / 390×844 */
#section-code-workbench .cw-app .device-shell.desktop,
#section-code-workbench .cw-app .device-shell.mobile{border:0}
#section-code-workbench .cw-app .device-shell.desktop{
  box-shadow:0 0 0 1px rgba(46,53,61,.16),0 24px 60px rgba(38,46,55,.12),0 2px 7px rgba(25,31,38,.05);
}
#section-code-workbench .cw-app .device-shell.mobile{
  box-shadow:0 0 0 6px #4b525a,0 24px 60px rgba(38,46,55,.12),0 2px 7px rgba(25,31,38,.05);
}
/* 预览框贴住画布顶部，不再上下居中留出大块空白 */
#section-code-workbench .cw-app .device-positioner{align-items:flex-start}

/* 轻提示：dock 占住底部，提示改到内容区顶部显示，配色保持深灰 */
#section-code-workbench .cw-app .toast{
  display:block;
  top:14px;
  bottom:auto;
  left:50%;
  right:auto;
  width:max-content;
  min-width:0;
  max-width:min(440px, calc(100% - 60px));
  padding:10px 16px;
  line-height:1.5;
  white-space:normal;
  transform:translateX(-50%);
  visibility:hidden;
  opacity:0;
  color:#fff;
  background:#343a41;
}
#section-code-workbench .cw-app .toast.show{
  visibility:visible;
  opacity:1;
  transform:translateX(-50%);
}
#section-code-workbench .cw-app .toast.error{background:#9d2929}

/* 脚本需要的隐藏触发点 */
.cw-proxies{display:none}

/* 本视图面板较高：收敛内容区为 dock 预留的留白，避免整卡出现多余滚动条 */
.content:has(#section-code-workbench:not([hidden])){padding-bottom:26px}

/* 可修改内容：双列卡片与更清晰的信息层级 */
#section-code-workbench .cw-app .editor-toolbar{min-height:64px;padding:12px 16px}
#section-code-workbench .cw-app .editor-toolbar-copy strong{font-size:16px;letter-spacing:-.01em}
#section-code-workbench .cw-app .editor-toolbar-copy span{font-size:12.5px}
#section-code-workbench .cw-app .group-card > summary{min-height:74px;padding:12px 15px;gap:12px}
#section-code-workbench .cw-app .group-title strong{font-size:16px}
#section-code-workbench .cw-app .group-title small{font-size:12.5px}
#section-code-workbench .cw-app .group-step{width:34px;height:34px;font-size:11.5px}
#section-code-workbench .cw-app .group-count{font-size:11.5px}
#section-code-workbench .cw-app .field-search,
#section-code-workbench .cw-app .field-count{height:42px}
#section-code-workbench .cw-app .field-card{min-height:120px;padding:13px 14px 12px;border-radius:14px}
#section-code-workbench .cw-app .field-meta{gap:8px;margin-bottom:10px}
#section-code-workbench .cw-app .field-index{width:24px;height:24px;border-radius:7px;font-size:10px}
#section-code-workbench .cw-app .field-name{font-size:14px;font-weight:800}
#section-code-workbench .cw-app .field-kind{padding:4px 8px;font-size:11px}
#section-code-workbench .cw-app .device-badge{padding:4px 8px;font-size:10.5px}
#section-code-workbench .cw-app .field-input,
#section-code-workbench .cw-app .field-textarea,
#section-code-workbench .cw-app .field-select,
#section-code-workbench .cw-app .field-number{padding:10px 11px;border-radius:9px;font-size:14px}
#section-code-workbench .cw-app .field-input,
#section-code-workbench .cw-app .field-select,
#section-code-workbench .cw-app .field-number{height:40px}
#section-code-workbench .cw-app .field-path{font-size:9.5px}
#section-code-workbench .cw-app .reset-field{font-size:11.5px}
#section-code-workbench .cw-app .color-control{grid-template-columns:50px minmax(0,1fr);gap:9px}
#section-code-workbench .cw-app .color-picker{width:50px;height:40px}
#section-code-workbench .cw-app .image-control{grid-template-columns:56px minmax(0,1fr);gap:9px}
#section-code-workbench .cw-app .image-thumb{width:56px;height:46px}
#section-code-workbench .cw-app .category-item span{font-size:13px}
#section-code-workbench .cw-app .style-kind-tabs{grid-template-columns:repeat(auto-fit,minmax(112px,1fr));gap:6px;padding:6px;margin-bottom:16px}
#section-code-workbench .cw-app .style-kind-tab{min-height:46px;padding:6px 9px;gap:6px;font-size:14px}
#section-code-workbench .cw-app .style-kind-tab-count{padding:3px 7px;font-size:10px}
#section-code-workbench .cw-app .style-subgroup{margin-bottom:18px}
#section-code-workbench .cw-app .style-subgroup-head{min-height:44px;margin-bottom:10px;gap:10px}
#section-code-workbench .cw-app .style-subgroup-icon{width:30px;height:30px;font-size:14px}
#section-code-workbench .cw-app .style-subgroup-title{font-size:15px;font-weight:850}
#section-code-workbench .cw-app .style-subgroup-count{padding:5px 9px;font-size:10.5px}
@media (max-width:760px){
  #section-code-workbench .cw-app .field-list,
  #section-code-workbench .cw-app .style-subgroup-grid{grid-template-columns:1fr}
  #section-code-workbench .cw-app .style-kind-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* 代码工作台专属 ShopCC 数据弹窗 */
#cw-shopcc-domain-modal{
  z-index:140;
}
#cw-shopcc-domain-modal[hidden]{display:none!important}
#cw-shopcc-domain-modal .modal-card{
  width:min(560px,calc(100vw - 32px));
  max-height:min(760px,calc(100vh - 32px));
  padding:24px;
  border-radius:22px;
  text-align:left;
}
#cw-shopcc-domain-modal .modal-heading{
  gap:16px;
  margin-bottom:17px;
}
#cw-shopcc-domain-modal .eyebrow{
  display:block;
  color:#8a949e;
  font-size:9.5px;
  font-weight:800;
  letter-spacing:.18em;
}
#cw-shopcc-domain-modal .modal-heading h2{
  margin:7px 0 0;
  font-size:22px;
  line-height:1.2;
  letter-spacing:-.035em;
}
#cw-shopcc-domain-modal .icon-close{
  flex:none;
  margin-top:-4px;
}
#cw-shopcc-domain-modal .modal-form{
  margin-top:0;
  gap:12px;
  text-align:left;
}
#cw-shopcc-domain-modal .ds-label{
  display:block;
  margin:0 0 8px;
  color:#737f8b;
  font-size:10.5px;
  font-weight:800;
  letter-spacing:.08em;
}
#cw-shopcc-domain-modal .ds-options{
  display:grid;
  gap:9px;
}
#cw-shopcc-domain-modal .ds-option{
  position:relative;
  display:block;
  padding:13px 16px 13px 44px;
  border:1px solid rgba(60,74,88,.14);
  border-radius:13px;
  background:rgba(255,255,255,.64);
  color:#29323c;
  cursor:pointer;
  transition:background .18s ease,border-color .18s ease,box-shadow .18s ease;
}
#cw-shopcc-domain-modal .ds-option:hover{
  border-color:rgba(60,74,88,.28);
  background:rgba(255,255,255,.82);
}
#cw-shopcc-domain-modal .ds-option:has(input:checked){
  border-color:#353d46;
  background:#fff;
  box-shadow:0 0 0 1px #353d46 inset,0 10px 24px rgba(30,40,50,.06);
}
#cw-shopcc-domain-modal .ds-option input{
  position:absolute;
  left:15px;
  top:15px;
  width:17px;
  height:17px;
  min-height:17px;
  margin:0;
  padding:0;
  border:1px solid #bdc6d0;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#fff;
  box-shadow:inset 0 1px 2px rgba(17,28,40,.06);
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
}
#cw-shopcc-domain-modal .ds-option input::after{
  content:"";
  width:7px;
  height:7px;
  border-radius:50%;
  background:#353d46;
  transform:scale(0);
  transition:transform .16s cubic-bezier(.2,.8,.2,1);
}
#cw-shopcc-domain-modal .ds-option input:checked{
  border-color:#353d46;
  background:#f2f4f6;
}
#cw-shopcc-domain-modal .ds-option input:checked::after{
  transform:scale(1);
}
#cw-shopcc-domain-modal .ds-option input:focus-visible{
  outline:2px solid rgba(53,61,70,.28);
  outline-offset:2px;
}
#cw-shopcc-domain-modal .ds-name{
  display:block;
  color:#29323c;
  font-size:13px;
  font-weight:700;
  line-height:1.35;
}
#cw-shopcc-domain-modal .ds-option small{
  display:block;
  margin-top:4px;
  color:#87929d;
  font-size:10.5px;
  font-weight:400;
  line-height:1.55;
}
#cw-shopcc-domain-modal #cw-shopcc-domain-field{
  display:grid;
  gap:7px;
  margin-top:2px;
  color:#7e8994;
  font-size:10.5px;
  font-weight:700;
}
#cw-shopcc-domain-modal #cw-shopcc-domain-field[hidden]{display:none!important}
#cw-shopcc-domain-modal #cw-shopcc-domain-input{
  width:100%;
  height:42px;
  padding:0 12px;
  border:1px solid rgba(60,74,88,.16);
  border-radius:11px;
  outline:0;
  color:#26313c;
  background:rgba(255,255,255,.82);
  font-size:12px;
}
#cw-shopcc-domain-modal #cw-shopcc-domain-input:focus{
  border-color:#59636e;
  box-shadow:0 0 0 3px rgba(53,61,70,.08);
}
#cw-shopcc-domain-modal .equal-modal-actions{
  margin-top:2px;
  gap:9px;
}
#cw-shopcc-domain-modal .equal-modal-actions>button{
  width:116px;
  min-width:116px;
  height:42px;
  min-height:42px;
  padding:0 14px;
  border-radius:11px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
}
