
    :root {
      --ink: #172033;
      --muted: #6d7585;
      --line: #e7e8ec;
      --soft: #f6f7f9;
      --panel: #fff;
      --blue: #2864dc;
      --blue-dark: #1d4fae;
      --blue-soft: #edf4ff;
      --green: #16825d;
      --red: #c63f4b;
      --orange: #f59f45;
      --shadow: 0 18px 50px rgba(31, 39, 53, .08);
      --radius: 18px;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    }

    * { box-sizing: border-box; }
    html { min-width: 320px; background: #f5f5f3; }
    body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 85% 6%, #eaf2ff 0, transparent 26%), #f5f5f3; }
    button, textarea, input { font: inherit; }
    button { cursor: pointer; }
    button:focus-visible, textarea:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(40, 100, 220, .22); outline-offset: 2px; }

    .app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
    .sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; background: rgba(255,255,255,.9); border-right: 1px solid var(--line); backdrop-filter: blur(18px); }
    .brand { display: flex; align-items: center; gap: 11px; padding: 5px 8px 28px; }
    .brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; background: var(--ink); border-radius: 12px; }
    .brand-name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
    .brand-sub { margin-top: 2px; color: var(--muted); font-size: 11px; }
    .nav-label { padding: 0 10px 9px; color: #989eaa; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
    .nav { display: grid; gap: 6px; }
    .nav-btn { display: grid; grid-template-columns: 38px 1fr; align-items: center; width: 100%; padding: 10px; text-align: left; color: #545d6c; background: transparent; border: 0; border-radius: 13px; text-decoration: none; transition: 150ms ease; }
    .nav-btn:hover { background: var(--soft); color: var(--ink); }
    .nav-btn.is-active { color: var(--blue-dark); background: var(--blue-soft); }
    .nav-icon { display: grid; place-items: center; width: 30px; height: 30px; color: currentColor; background: rgba(255,255,255,.75); border: 1px solid rgba(0,0,0,.045); border-radius: 9px; }
    .nav-title { display: block; font-size: 14px; font-weight: 750; }
    .nav-desc { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
    .local-note { position: absolute; right: 18px; bottom: 20px; left: 18px; display: flex; align-items: center; gap: 8px; padding: 12px; color: #627064; background: #f3f8f3; border: 1px solid #e0eadf; border-radius: 12px; font-size: 11px; line-height: 1.45; }
    .local-dot { width: 8px; height: 8px; flex: none; background: #3aa675; border-radius: 50%; box-shadow: 0 0 0 4px rgba(58,166,117,.12); }

    .main { min-width: 0; padding: 40px clamp(24px, 5vw, 72px) 64px; }
    .topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; max-width: 1120px; margin: 0 auto 28px; }
    .eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .1em; }
    h1 { margin: 0; font-size: clamp(29px, 4vw, 43px); line-height: 1.08; letter-spacing: -.04em; }
    .subtitle { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
    .pill { display: flex; align-items: center; gap: 7px; flex: none; margin-top: 6px; padding: 9px 12px; color: #46604f; background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 99px; font-size: 11px; font-weight: 700; }
    .pill-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }
    .workspace { max-width: 1120px; margin: 0 auto; }
    .tool { display: none; animation: reveal 220ms ease; }
    .tool.is-active { display: block; }
    @keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
    .panel { overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
    .panel + .panel { margin-top: 18px; }
    .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
    .panel-head h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
    .panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
    .panel-body { padding: 22px; }
    .dropzone { display: grid; place-items: center; min-height: 210px; padding: 28px 20px; text-align: center; background: #fbfcfe; border: 1.5px dashed #b8c9e7; border-radius: 14px; transition: 150ms ease; }
    .dropzone:hover, .dropzone.is-dragging { background: var(--blue-soft); border-color: var(--blue); }
    .upload-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 13px; color: var(--blue); background: #fff; border: 1px solid #dfe8f8; border-radius: 15px; box-shadow: 0 8px 24px rgba(40,100,220,.1); }
    .dropzone strong { display: block; font-size: 16px; }
    .dropzone span { display: block; margin: 7px 0 17px; color: var(--muted); font-size: 12px; }
    .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; color: #4d5562; background: #fff; border: 1px solid #d9dce3; border-radius: 10px; font-size: 13px; font-weight: 750; transition: 140ms ease; }
    .btn:hover:not(:disabled) { background: var(--soft); transform: translateY(-1px); }
    .btn.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
    .btn.primary:hover:not(:disabled) { background: var(--blue-dark); }
    .btn.danger { color: var(--red); }
    .btn:disabled { cursor: not-allowed; opacity: .42; }
    .input-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 2px 8px; color: #4d5562; font-size: 12px; font-weight: 750; }
    textarea { display: block; width: 100%; min-height: 170px; resize: vertical; padding: 15px 16px; color: #263044; background: #fbfbfc; border: 1px solid #dfe1e6; border-radius: 12px; font: 12.5px/1.6 "SFMono-Regular", Consolas, monospace; transition: 150ms ease; }
    textarea:focus { background: #fff; border-color: #7da2ec; }
    .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 14px; }
    .toolbar .spacer { flex: 1; }
    .check { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; user-select: none; }
    .check input { width: 16px; height: 16px; accent-color: var(--blue); }
    .stats { display: flex; gap: 20px; }
    .stat { min-width: 70px; }
    .stat strong { display: block; font-size: 21px; font-variant-numeric: tabular-nums; }
    .stat span { color: var(--muted); font-size: 11px; }
    .result-list { min-height: 164px; max-height: 360px; overflow: auto; }
    .empty { display: grid; place-items: center; min-height: 164px; padding: 26px; color: var(--muted); text-align: center; font-size: 12px; }
    .result-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 42px; min-height: 44px; border-bottom: 1px solid #eff0f2; }
    .result-row:last-child { border-bottom: 0; }
    .row-num { display: grid; place-items: center; color: #a0a5ae; background: #fafafa; border-right: 1px solid #eff0f2; font-size: 11px; }
    .row-value { display: flex; align-items: center; min-width: 0; padding: 8px 13px; overflow: hidden; color: #384153; font: 12px "SFMono-Regular", Consolas, monospace; white-space: nowrap; text-overflow: ellipsis; }
    .row-copy { display: grid; place-items: center; color: #8b92a0; background: transparent; border: 0; }
    .row-copy:hover { color: var(--blue); background: var(--blue-soft); }
    .status { min-height: 19px; margin: 12px 2px 0; color: var(--muted); font-size: 12px; }
    .status.success { color: var(--green); }
    .status.error { color: var(--red); }
    .generator-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
    .settings { display: grid; align-content: start; gap: 15px; padding: 18px; background: var(--soft); border-radius: 14px; }
    .setting { display: grid; gap: 7px; }
    .setting label { color: #565e6c; font-size: 12px; font-weight: 750; }
    .setting input { width: 100%; height: 40px; padding: 0 11px; background: #fff; border: 1px solid #dfe1e6; border-radius: 9px; font-size: 13px; }
    select { height: 40px; padding: 0 32px 0 11px; color: var(--ink); background: #fff; border: 1px solid #dfe1e6; border-radius: 9px; font-size: 13px; }
    .format-preview { padding: 12px; color: #667080; background: #fff; border: 1px solid #e1e3e8; border-radius: 10px; font: 11px/1.6 "SFMono-Regular", Consolas, monospace; word-break: break-all; }
    .convert-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 14px; }
    .convert-options label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
    .convert-options input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); }
    .upload-dialog { width: min(520px, calc(100vw - 28px)); padding: 0; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 28px 80px rgba(20,28,45,.24); }
    .upload-dialog::backdrop { background: rgba(17,24,39,.42); backdrop-filter: blur(3px); }
    .dialog-head { padding: 21px 22px 17px; border-bottom: 1px solid var(--line); }
    .dialog-head h2 { margin: 0; font-size: 18px; }
    .dialog-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
    .dialog-body { display: grid; gap: 14px; padding: 20px 22px; }
    .dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
    .dialog-field { display: grid; gap: 7px; }
    .dialog-field label { color: #565e6c; font-size: 12px; font-weight: 750; }
    .dialog-field input, .dialog-field select { width: 100%; height: 40px; padding: 0 11px; background: #fff; border: 1px solid #dfe1e6; border-radius: 9px; font-size: 13px; }
    .remote-note { padding: 11px 12px; color: #5c6574; background: #f5f8fc; border: 1px solid #e5eaf2; border-radius: 10px; font-size: 11px; line-height: 1.55; }
    .dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 22px 20px; }
    a.btn { text-decoration: none; }
    .toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 12px 15px; color: #fff; background: #172033; border-radius: 11px; box-shadow: 0 14px 35px rgba(23,32,51,.22); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: 170ms ease; }
    .toast.show { opacity: 1; transform: translateY(0); }

    @media (max-width: 820px) {
      .app { grid-template-columns: 1fr; }
      .sidebar { position: static; z-index: 5; width: 100%; height: auto; padding: 13px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
      .brand { padding: 3px 5px 12px; }
      .brand-mark { width: 34px; height: 34px; }
      .brand-sub, .nav-label, .nav-desc, .local-note { display: none; }
      .nav { grid-template-columns: repeat(5, 1fr); }
      .nav-btn { display: flex; justify-content: center; gap: 7px; padding: 7px; text-align: center; }
      .nav-icon { width: 28px; height: 28px; }
      .nav-title { font-size: 12px; }
      .main { padding: 28px 16px 45px; }
      .topbar { margin-bottom: 21px; }
      .pill { display: none; }
      .generator-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 520px) {
      .nav-icon { display: none; }
      .panel-head { align-items: flex-start; flex-direction: column; }
      .panel-body { padding: 15px; }
      .toolbar .spacer { display: none; }
      .toolbar .btn { flex: 1; }
      .stats { width: 100%; }
      .result-row { grid-template-columns: 38px minmax(0, 1fr) 38px; }
      .dialog-grid { grid-template-columns: 1fr; }
    }
  
/* Deployment UI refinements */
.dropzone .btn { display: inline-flex; margin: 0; color: white; }
.sidebar { overflow-y: auto; display: flex; flex-direction: column; }
.local-note { position: static; margin-top: auto; }
.nav { margin-bottom: 24px; }
a:focus-visible, select:focus-visible { outline: 3px solid #b8cff6; outline-offset: 3px; }
@media (max-width: 820px) { .nav { display:flex; overflow-x:auto; margin:0; padding-bottom:4px; } .nav-btn { flex:0 0 auto; width:auto; min-height:40px; padding:8px 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
