html, body { margin: 0; min-height: 100%; }
body { font-family: Arial, Helvetica, sans-serif; }
* { box-sizing: border-box; }


/* ZTX Unisoc Web UI overrides: keep text readable on the dark tool surface. */
:root { color-scheme: dark; }
html, body, #root { min-height: 100%; }
body {
  background: #0b1220;
  color: #e5e7eb;
  overflow-x: hidden;
}
button, input, select { font: inherit; }

.brand-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  font-weight: 900;
  letter-spacing: .08em;
  box-shadow: 0 8px 24px rgba(37,99,235,.28);
}

/* Tailwind CDN may leave some dark-mode text utilities unresolved depending on cache. */
.text-gray-900, .text-gray-800, .text-gray-700 { color: #e5e7eb !important; }
.text-gray-600, .text-gray-500 { color: #cbd5e1 !important; }
.text-gray-300 { color: #d1d5db !important; }
.text-blue-900 { color: #dbeafe !important; }
.text-blue-800 { color: #bfdbfe !important; }
.text-green-800 { color: #bbf7d0 !important; }
.text-amber-700 { color: #fde68a !important; }

.bg-white { background-color: #182235 !important; }
.bg-gray-50 { background-color: #111a2a !important; }
.bg-gray-100 { background-color: #202c3f !important; }
.border-gray-200, .border-gray-300 { border-color: #334155 !important; }

input[type="file"] {
  color: #e5e7eb !important;
  background: #1e293b !important;
  border-color: #475569 !important;
}
input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 7px;
  padding: 7px 11px;
  background: #334155;
  color: #fff;
  cursor: pointer;
}

@media (max-width: 640px) {
  .brand-mark { width: 46px; height: 46px; border-radius: 12px; }
}

/* ZTX Unisoc Web - compact professional tool UI */
.ztx-app{min-height:100vh;background:#0a1120;color:#e7edf7;padding:18px 14px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.ztx-shell{width:min(1120px,100%);margin:0 auto;background:#111b2b;border:1px solid #26354b;border-radius:16px;box-shadow:0 18px 55px rgba(0,0,0,.32);overflow:hidden}
.ztx-header{display:flex;align-items:center;justify-content:space-between;padding:17px 20px;border-bottom:1px solid #26354b;background:#141f31}
.ztx-brand{display:flex;align-items:center;gap:12px}.ztx-logo{width:42px;height:42px;border-radius:11px;display:grid;place-items:center;background:linear-gradient(135deg,#2563eb,#06b6d4);font-weight:900;letter-spacing:.05em;color:#fff;box-shadow:0 6px 18px rgba(37,99,235,.25)}
.ztx-brand h1{font-size:18px;line-height:1.1;margin:0;color:#fff}.ztx-brand p{font-size:11px;color:#91a2bb;margin:4px 0 0}.ztx-status{font-size:11px;color:#aab8cb;border:1px solid #30415b;border-radius:999px;padding:6px 9px}.ztx-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#22c55e;margin-right:6px}
.ztx-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:8px;background:#0e1726;border-bottom:1px solid #26354b}.ztx-tabs button{border:0;background:transparent;color:#91a2bb;border-radius:9px;padding:9px;font-size:13px;font-weight:700;cursor:pointer}.ztx-tabs button.active{background:#24344b;color:#60a5fa;box-shadow:inset 0 0 0 1px #315073}
.ztx-info-banner{margin:14px 16px 0;padding:11px 13px;border:1px solid #234f8c;background:#102544;border-radius:10px}.ztx-info-banner strong{font-size:13px;color:#cfe2ff}.ztx-info-banner span{font-size:12px;color:#7fb3ef;margin-left:5px}.ztx-info-banner small{display:block;color:#8ea8c7;font-size:11px;margin-top:4px}
.ztx-grid{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);gap:12px;padding:14px 16px 0}.ztx-panel{background:#151f30;border:1px solid #2a3a52;border-radius:12px;padding:14px;min-width:0}.ztx-panel-title{font-size:15px;font-weight:700;margin-bottom:12px}.ztx-panel label{display:block;font-size:12px;color:#b7c4d6;margin-bottom:6px}.ztx-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:11px}.ztx-panel-head h2{font-size:14px;margin:0;color:#f4f7fb}.ztx-panel-head p{font-size:10px;color:#8497b1;margin:3px 0 0}.ztx-badge,.ztx-preview{font-size:9px;font-weight:800;letter-spacing:.07em;color:#7fb4ff;border:1px solid #31527d;border-radius:999px;padding:4px 7px;white-space:nowrap}.ztx-preview{color:#f5c86b;border-color:#72582a}
.ztx-file{display:block;width:100%;padding:7px;border:1px solid #34455f;border-radius:8px;background:#0e1726;color:#dce6f3;font-size:11px}.ztx-file::file-selector-button{border:0;border-radius:6px;background:#2a3c56;color:#fff;padding:6px 9px;margin-right:8px;font-size:11px;cursor:pointer}.ztx-working{font-size:11px;color:#60a5fa;margin-top:8px}
.ztx-pac-card{margin-top:11px;padding:11px;border:1px solid #2b3d56;border-radius:10px;background:#101a2a}.ztx-pac-title{display:flex;justify-content:space-between;gap:8px;align-items:center}.ztx-pac-title strong{display:block;font-size:12px;color:#fff}.ztx-pac-title span{display:block;font-size:9px;color:#8093ad;margin-top:3px}.ztx-ok,.ztx-warn{font-size:9px!important;font-weight:800!important;border-radius:999px;padding:4px 7px!important;background:#123c29;color:#72e0a4!important;white-space:nowrap}.ztx-warn{background:#49361a;color:#f5cf77!important}.ztx-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:9px}.ztx-stats div,.ztx-plan-stats div{background:#182538;border:1px solid #263952;border-radius:7px;padding:6px 8px}.ztx-stats span,.ztx-plan-stats span{display:block;font-size:9px;color:#8295ae}.ztx-stats b{font-size:12px;color:#eaf1fb}.ztx-meta{margin-top:8px;font-size:9px;color:#8396b0;display:flex;gap:7px}.ztx-meta span{word-break:break-all;color:#b7c6d9}.ztx-hints{margin-top:8px;padding:7px 8px;border-radius:7px;background:#172337;color:#b9c8db;font-size:9px;line-height:1.55}.ztx-hints b{color:#dce8f7}.ztx-list-title{font-size:10px;font-weight:700;color:#bdcadd;margin:10px 0 5px}.ztx-scroll-list{height:126px;overflow:auto;background:#0b1422;border:1px solid #22334a;border-radius:7px;padding:5px}.ztx-scroll-list div{display:flex;justify-content:space-between;gap:8px;padding:3px 5px;color:#d8e3f0;font:10px ui-monospace,SFMono-Regular,Menlo,monospace;border-bottom:1px solid #17253a}.ztx-scroll-list em{font-style:normal;color:#70849f;font-size:9px}.ztx-muted{color:#71849d;font-size:10px}.ztx-preflight{margin-top:8px;padding:8px;border:1px solid #2b3d56;border-radius:8px;background:#0d1725;font-size:9px;line-height:1.45}.ztx-preflight.is-ok{border-color:#245a42}.ztx-preflight.is-error{border-color:#6b3030}.ztx-preflight-head{display:flex;justify-content:space-between;color:#dce8f7}.ztx-preflight-head span{font-weight:800}.ztx-preflight.is-ok .ztx-preflight-head span{color:#72e0a4}.ztx-preflight.is-error .ztx-preflight-head span{color:#ff8585}.ztx-preflight-meta{margin-top:4px;color:#8ea2bc}.ztx-preflight-error{color:#ff8b8b;margin-top:3px}.ztx-preflight-warning{color:#f2c76d;margin-top:3px}.ztx-preflight-table{display:grid;gap:2px;margin-top:5px;color:#b8c7da;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ztx-preflight-table span{padding:2px 4px;background:#162337;border-radius:4px}
.ztx-warning{margin-top:7px;color:#f2c76d;font-size:9px;line-height:1.4}
.ztx-empty{height:190px;display:grid;place-items:center;text-align:center;color:#71849d;font-size:11px;border:1px dashed #30425b;border-radius:9px;background:#101a2a}.ztx-plan-stats{display:grid;grid-template-columns:1fr 1fr;gap:7px}.ztx-plan-stats div{padding:9px}.ztx-plan-stats b{font-size:17px;color:#fff}.ztx-plan-list{height:190px;overflow:auto;background:#0b1422;border:1px solid #22334a;border-radius:8px;margin-top:8px;padding:5px}.ztx-plan-list div{display:flex;align-items:center;gap:8px;padding:5px 4px;border-bottom:1px solid #17253a}.ztx-plan-list strong{font:10px ui-monospace,SFMono-Regular,Menlo,monospace;color:#dce7f4}.ztx-type{font:8px;font-weight:800;color:#6faeff;background:#172d4c;border-radius:4px;padding:3px 5px;min-width:46px;text-align:center}.ztx-requirements{margin-top:8px;color:#f1c86a;font-size:9px;line-height:1.5}
.ztx-device{margin:12px 16px 0;padding:10px 12px;display:grid;grid-template-columns:auto auto auto 1fr;gap:10px;align-items:center;background:#10271e;border:1px solid #24583d;border-radius:10px;color:#a8d9bd;font-size:10px}.ztx-device strong{display:block;color:#7ee2a5;font-size:11px}.ztx-device span{display:block;color:#709985;font-size:9px;margin-top:2px}.ztx-device b{color:#d0e8d9}.ztx-device-response{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ztx-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px 16px 0}.ztx-primary,.ztx-secondary{border:0;border-radius:8px;padding:10px 12px;font-size:12px;font-weight:700;cursor:pointer}.ztx-primary{background:#2563eb;color:#fff;box-shadow:0 5px 14px rgba(37,99,235,.18)}.ztx-primary:hover{background:#3474f0}.ztx-primary:disabled{opacity:.45;cursor:not-allowed}.ztx-secondary{background:#202d40;color:#d8e4f2;border:1px solid #344862}.ztx-secondary:hover{background:#28384f}
.ztx-log-wrap{padding:12px 16px 0}.ztx-log-head{display:flex;justify-content:space-between;font-size:10px;font-weight:700;color:#aebdd0;margin-bottom:5px}.ztx-log{height:118px;overflow:auto;background:#0b1422;border:1px solid #26374f;border-radius:8px;padding:8px;font:10px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;color:#dce6f2}.ztx-progress{height:5px;background:#27364b;border-radius:99px;margin-top:6px;overflow:hidden}.ztx-progress div{height:100%;background:#3b82f6;transition:width .3s ease}.ztx-shell footer{padding:11px 16px;margin-top:12px;border-top:1px solid #26354b;text-align:center;color:#657991;font-size:9px}
@media(max-width:800px){.ztx-grid{grid-template-columns:1fr}.ztx-plan-list,.ztx-empty{height:145px}.ztx-device{grid-template-columns:1fr 1fr}.ztx-device-response{grid-column:1/-1}.ztx-app{padding:8px}.ztx-header{padding:14px}.ztx-grid,.ztx-actions,.ztx-log-wrap{padding-left:10px;padding-right:10px}.ztx-info-banner{margin-left:10px;margin-right:10px}.ztx-device{margin-left:10px;margin-right:10px}}
@media(max-width:480px){.ztx-status{display:none}.ztx-brand h1{font-size:16px}.ztx-brand p{font-size:9px}.ztx-tabs button{font-size:11px}.ztx-actions{grid-template-columns:1fr}.ztx-device{grid-template-columns:1fr}.ztx-device-response{grid-column:auto}.ztx-info-banner span{display:block;margin:3px 0 0}.ztx-stats{grid-template-columns:repeat(3,1fr)}}

.ztx-pac-table-wrap{width:100%;overflow:auto;border:1px solid rgba(148,163,184,.18);border-radius:10px;background:#07101e}
.ztx-pac-table{width:100%;border-collapse:collapse;font-size:11px;min-width:700px}
.ztx-pac-table th{position:sticky;top:0;text-align:left;padding:8px 9px;background:#101d31;color:#8fb7e8;font-weight:700;border-bottom:1px solid rgba(148,163,184,.2);z-index:1}
.ztx-pac-table td{padding:7px 9px;border-bottom:1px solid rgba(148,163,184,.1);color:#d8e4f3;white-space:nowrap}
.ztx-pac-table tr:last-child td{border-bottom:0}
.ztx-pac-table .ztx-name-cell{font-weight:600;color:#f1f5f9;white-space:normal;word-break:break-word}
.ztx-flash-yes,.ztx-flash-no{display:inline-block;padding:2px 6px;border-radius:999px;font-size:9px;font-weight:800;letter-spacing:.04em}
.ztx-flash-yes{background:rgba(34,197,94,.14);color:#86efac}
.ztx-flash-no{background:rgba(148,163,184,.12);color:#94a3b8}
@media(max-width:760px){.ztx-pac-table{min-width:620px}.ztx-pac-table th,.ztx-pac-table td{padding:6px 7px}}

/* v7 real-device operation controls */
.ztx-device-panel { margin-top: 12px; }
.ztx-op-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.ztx-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.ztx-form-grid > div { min-width: 0; }
.ztx-form-grid label { display:block; margin-bottom:5px; font-size:11px; font-weight:700; color:#aebbd0; }
.ztx-text, .ztx-select { width:100%; margin-top:6px; border:1px solid #33445e; border-radius:8px; background:#0d1727; color:#e5edf8; padding:9px 10px; outline:none; }
.ztx-text:focus, .ztx-select:focus { border-color:#4d83ff; }
.ztx-file-name { min-height:40px; align-self:end; border:1px dashed #33445e; border-radius:8px; padding:10px; color:#9fb0c8; font-size:12px; }
.ztx-danger { border:1px solid #7f3038; border-radius:8px; padding:10px 12px; background:#431a20; color:#fecaca; font-weight:700; cursor:pointer; }
.ztx-danger:hover { background:#542027; }
.ztx-danger:disabled, .ztx-secondary:disabled, .ztx-primary:disabled { opacity:.45; cursor:not-allowed; }
.ztx-mini-table { max-height:220px; overflow:auto; margin-top:12px; border:1px solid #263650; border-radius:8px; }
.ztx-mini-table table { width:100%; border-collapse:collapse; font-size:12px; }
.ztx-mini-table th { position:sticky; top:0; background:#152238; color:#9fb0c8; text-align:left; padding:8px; }
.ztx-mini-table td { padding:7px 8px; border-top:1px solid #1f2d43; color:#dbe5f2; }
.ztx-mini-table tr.selected td { background:#162e55; color:#fff; }
.ztx-mini-table tbody tr { cursor:pointer; }
.ztx-mini-table tbody tr:hover td { background:#132743; }
@media (max-width: 720px) {
  .ztx-op-grid, .ztx-form-grid { grid-template-columns:1fr; }
}

/* v8 compact two-menu smartphone UI */
.ztx-main-area{display:grid;gap:12px;padding:14px 16px 0}
.ztx-main-tabs{padding:7px 10px}
.ztx-main-tabs button{font-size:13px;letter-spacing:.03em}
.ztx-big-action{width:100%;margin-top:11px;min-height:42px;font-size:12px;letter-spacing:.03em}
.ztx-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:4px;background:#0c1625;border:1px solid #27384f;border-radius:9px;margin-bottom:10px}
.ztx-mode-switch button{border:0;border-radius:7px;background:transparent;color:#8295ae;padding:8px;font-size:10px;font-weight:800;cursor:pointer}
.ztx-mode-switch button.active{background:#233b5a;color:#69a9ff}
.ztx-full-note{padding:10px 11px;border:1px solid #354761;background:#101c2d;border-radius:8px;color:#aebed2;font-size:10px;line-height:1.5}
.ztx-inline-status,.ztx-selected-bar{margin-top:9px;padding:8px 10px;border-radius:7px;background:#0d1828;border:1px solid #26374f;color:#8296b0;font-size:10px}
.ztx-inline-status b,.ztx-selected-bar b{color:#e4edf8}
.ztx-small-btn{padding:7px 9px!important;font-size:9px!important}
.ztx-gpt-table{max-height:310px;overflow:auto;border:1px solid #26374f;border-radius:8px;background:#091321}
.ztx-gpt-table table{width:100%;border-collapse:collapse;min-width:570px;font-size:11px}
.ztx-gpt-table th{position:sticky;top:0;z-index:1;background:#142239;color:#8fb0d4;text-align:left;padding:8px;border-bottom:1px solid #2a3c56}
.ztx-gpt-table td{padding:7px 8px;color:#d8e4f2;border-bottom:1px solid #17263a}
.ztx-gpt-table tbody tr{cursor:pointer}
.ztx-gpt-table tbody tr:hover td{background:#10233d}
.ztx-gpt-table tbody tr.selected td{background:#17345b;color:#fff}
.ztx-gpt-table input{accent-color:#4d8fff}
.ztx-three-actions{grid-template-columns:repeat(3,1fr)}
.ztx-log-head button{border:0;background:transparent;color:#6faeff;font-size:9px;font-weight:700;cursor:pointer;padding:0}
.ztx-status.is-ready{color:#a7e8bf;border-color:#2c6248}
@media(max-width:720px){.ztx-main-area{padding-left:10px;padding-right:10px}.ztx-three-actions{grid-template-columns:1fr}.ztx-gpt-table{max-height:260px}.ztx-pac-table{min-width:760px}}
.ztx-sub-tabs{border-top:1px solid #1a2739;background:#0b1320}
.ztx-inline-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:9px;padding:8px 10px;border:1px solid #26374f;border-radius:7px;background:#0d1828;color:#8296b0;font-size:10px}
.ztx-inline-tools .ztx-secondary{margin:0}

.ztx-status.is-busy{color:#f5cf77;border-color:#72582a;background:#2a2110}.ztx-status.is-error{color:#fecaca;border-color:#7f3038;background:#2a1519}
.ztx-log-head{align-items:center;gap:10px}.ztx-log-head>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
