:root{color-scheme:light;--bg: #eef2f7;--surface: rgba(255, 255, 255, .86);--text: #121826;--muted: #627083;--line: rgba(113, 128, 150, .22);--brand: #1f8a5b;--brand-strong: #156546;--blue: #315fce;--amber: #bd6b18;--shadow: 0 20px 48px rgba(15, 23, 42, .11);--small-shadow: 0 10px 24px rgba(15, 23, 42, .08);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}*{box-sizing:border-box}body{margin:0;min-height:100vh;color:var(--text);background:radial-gradient(circle at 20% 0%,rgba(31,138,91,.18),transparent 32rem),radial-gradient(circle at 100% 10%,rgba(49,95,206,.16),transparent 34rem),linear-gradient(140deg,#f8fafc,#eef2f7 52%,#f6f7fb)}button,input,select{font:inherit}button{cursor:pointer}.app-shell{display:grid;grid-template-columns:292px minmax(0,1fr);min-height:100vh}.sidebar{position:sticky;top:0;height:100vh;padding:24px;display:flex;flex-direction:column;gap:26px;color:#f8fafc;background:linear-gradient(180deg,#111827f5,#102530f5),#111827;border-right:1px solid rgba(255,255,255,.08)}.brand{display:flex;align-items:center;gap:12px;padding:8px}.brand-mark{display:grid;place-items:center;width:46px;height:46px;border-radius:8px;background:linear-gradient(145deg,#35c989,#2f6fed);box-shadow:0 16px 30px #2f6fed3d;font-weight:900}.brand strong,.brand span{display:block}.brand strong{letter-spacing:.01em}.brand span{margin-top:2px;color:#aeb8c7;font-size:13px}.nav-list,.provider-list{display:grid;gap:8px}.nav-item,.provider-pill{width:100%;border:1px solid transparent;border-radius:8px;padding:12px 14px;background:transparent;color:#cbd5e1;text-align:left;transition:transform .16s ease,background .16s ease,border-color .16s ease,color .16s ease}.nav-item:hover,.provider-pill:hover{transform:translateY(-1px);border-color:#ffffff1f;background:#ffffff0f;color:#fff}.nav-item.is-active,.provider-pill.is-active{background:#ffffff1f;border-color:#ffffff24;color:#fff;box-shadow:inset 3px 0 #35c989}.provider-pill{display:flex;justify-content:space-between;align-items:center}.provider-pill>span,.all-provider-label{display:inline-flex;align-items:center;gap:9px}.provider-pill .provider-logo{min-height:26px}.provider-pill .provider-mark{width:28px;height:28px;border-radius:7px;font-size:10px}.provider-pill .provider-word{color:inherit;font-size:13px}.provider-pill strong{display:grid;place-items:center;min-width:26px;height:24px;border-radius:999px;background:#ffffff1a;font-size:12px}.provider-dot{width:9px;height:9px;border-radius:999px;background:#94a3b8}.provider-dot.ezviz{background:#35c989}.provider-dot.tuya{background:#2f6fed}.provider-dot.ewelink{background:#d88a2d}.provider-logo{display:inline-flex;align-items:center;gap:8px;min-height:30px}.provider-mark{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;color:#fff;font-size:12px;font-weight:900;letter-spacing:0}.provider-word{color:var(--text);font-weight:900}.provider-logo.ezviz .provider-mark{background:linear-gradient(145deg,#35c989,#15845b)}.provider-logo.tuya .provider-mark{background:linear-gradient(145deg,#2f6fed,#13a7c4)}.provider-logo.ewelink .provider-mark{background:linear-gradient(145deg,#f0a343,#d2691e)}.section-title{margin-bottom:10px;color:#98a2b3;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}.workspace{min-width:0;padding:30px}.topbar,.toolbar,.panel-head,.device-card-head,.scene-card-head,.dialog-head,.scene-row,.device-row,.account-card{display:flex;align-items:center;justify-content:space-between;gap:16px}.topbar{margin-bottom:18px;padding:20px;border:1px solid rgba(255,255,255,.68);border-radius:8px;background:#ffffff9e;box-shadow:var(--small-shadow);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}.eyebrow{margin:0 0 4px;color:var(--brand-strong);font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}h1,h2,h3,p{margin:0}h1{font-size:clamp(30px,4vw,46px);line-height:1.02}h2{font-size:18px}h3{font-size:17px}.topbar-actions,.toolbar-actions,.row-actions,.dialog-actions{display:flex;align-items:center;gap:10px}.primary-button,.secondary-button,.ghost-button,.icon-button,.toggle,.segmented button{border:1px solid var(--line);border-radius:8px;min-height:42px;padding:0 15px;background:#fff;color:var(--text);font-weight:800;transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease,background .15s ease}.primary-button:hover,.secondary-button:hover,.ghost-button:hover,.icon-button:hover,.toggle:hover,.segmented button:hover{transform:translateY(-1px);box-shadow:var(--small-shadow)}.primary-button{border-color:transparent;background:linear-gradient(135deg,#1f8a5b,#2f6fed);color:#fff;box-shadow:0 16px 30px #1f8a5b38}.secondary-button{border-color:#315fce38;background:#eef4ff;color:#214ea3}.ghost-button{background:#ffffff94}.icon-button{display:grid;place-items:center;width:42px;padding:0}.status-banner{position:relative;min-height:52px;margin-bottom:18px;padding:14px 16px 14px 48px;border:1px solid rgba(31,138,91,.24);border-radius:8px;background:linear-gradient(135deg,#eefaf4f0,#eef4fff0);color:#155d42;font-weight:800;box-shadow:var(--small-shadow)}.status-banner:before{content:"";position:absolute;left:18px;top:18px;width:14px;height:14px;border-radius:999px;background:#35c989;box-shadow:0 0 0 6px #35c98926}.view{display:none}.view.is-visible{display:block}.metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}.metric,.panel,.device-card,.scene-card,.account-card,.scene-editor{border:1px solid rgba(255,255,255,.72);border-radius:8px;background:var(--surface);box-shadow:var(--shadow);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px)}.metric{position:relative;overflow:hidden;padding:18px}.metric:after{content:"";position:absolute;right:14px;top:14px;width:38px;height:6px;border-radius:999px;background:linear-gradient(90deg,#35c989,#2f6fed);opacity:.72}.metric span{display:block;color:var(--muted);font-size:13px;font-weight:800}.metric strong{display:block;margin-top:10px;font-size:34px;line-height:1}.panel-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,.8fr);gap:16px}.panel{padding:18px}.device-list,.scene-list,.channel-list,.account-list,.scene-grid{display:grid;gap:10px;margin-top:14px}.device-row,.scene-row{position:relative;padding:13px;border:1px solid var(--line);border-radius:8px;background:#ffffffb8}.device-row:before,.device-card:before{content:"";position:absolute;inset:0 auto 0 0;width:4px;border-radius:8px 0 0 8px;background:var(--brand)}.device-row.motor:before,.device-card.motor:before{background:var(--blue)}.device-row.plug:before,.device-card.plug:before{background:var(--amber)}.device-title,.scene-title{display:flex;align-items:center;gap:12px;min-width:0}.device-glyph,.scene-glyph{display:grid;place-items:center;flex:0 0 auto;width:42px;height:42px;border-radius:8px;background:#e9f8ef;color:var(--brand-strong);font-weight:900}.device-card.motor .device-glyph,.device-row.motor .device-glyph{background:#eef4ff;color:#214ea3}.device-card.plug .device-glyph,.device-row.plug .device-glyph{background:#fff5e8;color:#965612}.scene-glyph{width:36px;height:36px;background:#f0f5ff;color:var(--blue)}.device-row span,.scene-row span,.device-card p,.account-card p,.channel-row span{color:var(--muted);font-size:13px}.state-chip,.provider-tag{display:inline-flex;align-items:center;min-height:26px;border-radius:999px;padding:0 10px;font-size:12px;font-weight:900}.state-chip.online{background:#e6f8ef;color:#17633f}.state-chip.offline{background:#eef1f5;color:#667085}.provider-tag{margin-bottom:8px;background:#edf2f7;color:#344054}.toggle{min-width:76px;background:#f3f6fb}.toggle.is-on{border-color:transparent;background:linear-gradient(135deg,#1f8a5b,#28a66b);color:#fff}.segmented{display:inline-grid;grid-template-columns:repeat(3,minmax(64px,1fr));border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff}.segmented button{border:0;border-radius:0;min-width:66px;background:transparent}.segmented button.is-active{background:#eef4ff;color:#214ea3}.segmented button+button{border-left:1px solid var(--line)}.toolbar{margin-bottom:16px;padding:15px;border:1px solid rgba(255,255,255,.72);border-radius:8px;background:#ffffffa8;box-shadow:var(--small-shadow)}.toolbar input,select,input{min-height:42px;border:1px solid var(--line);border-radius:8px;padding:0 12px;background:#ffffffe6;color:var(--text);outline:none}.toolbar input:focus,select:focus,input:focus{border-color:#315fce8a;box-shadow:0 0 0 4px #315fce1a}.toolbar input{width:min(380px,48vw)}.device-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.device-card,.scene-card,.account-card{position:relative;overflow:hidden;padding:16px;transition:transform .16s ease,box-shadow .16s ease}.device-card{padding-left:18px}.device-card:hover,.scene-card:hover,.account-card:hover{transform:translateY(-2px);box-shadow:0 24px 56px #0f172a24}.device-meta{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.device-meta span{border:1px solid var(--line);border-radius:999px;padding:6px 10px;background:#fff9;color:var(--muted);font-size:12px;font-weight:800}.channel-row{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:13px 0;border-top:1px solid var(--line)}.scene-card ul{margin:14px 0 0;padding-left:18px;color:var(--muted)}.scene-card li+li{margin-top:8px}.scene-editor{margin-bottom:16px;padding:16px}.scene-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:end}label{display:grid;gap:6px;color:#344054;font-size:13px;font-weight:900}.dialog{width:min(560px,calc(100vw - 28px));border:0;border-radius:8px;padding:0;box-shadow:0 28px 74px #0f172a47}.dialog::backdrop{background:#11182785;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.dialog form{display:grid;gap:14px;padding:18px;background:#fff}.instructions{border:1px solid rgba(49,95,206,.2);border-radius:8px;padding:12px;background:#eef4ff;color:#214ea3;font-size:13px;line-height:1.45}.empty-state{padding:28px;border:1px dashed var(--line);border-radius:8px;color:var(--muted);text-align:center;background:#ffffff80}@media(max-width:980px){.app-shell{grid-template-columns:1fr}.sidebar{position:sticky;top:0;z-index:5;height:auto;padding:14px;gap:14px}.nav-list,.provider-list{display:flex;overflow-x:auto}.nav-item,.provider-pill{white-space:nowrap;width:auto}.provider-strip{min-width:0}.workspace{padding:16px}.metric-grid,.panel-grid,.device-grid,.scene-form{grid-template-columns:1fr}.topbar,.toolbar,.device-card-head,.account-card,.toolbar-actions{align-items:stretch;flex-direction:column}.toolbar input{width:100%}.device-row,.scene-row,.channel-row{align-items:stretch;flex-direction:column}.row-actions{justify-content:space-between}}.account-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}.security-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:16px}.security-card{min-height:150px;padding:20px;border:1px solid rgba(255,255,255,.7);border-radius:8px;background:#ffffffc7;box-shadow:var(--small-shadow)}.security-card span,.security-card p{color:var(--muted)}.security-card strong{display:block;margin:10px 0 8px;font-size:18px}.inline-code-field{display:grid;gap:4px;color:var(--muted);font-size:12px;font-weight:800}.inline-code-field input{width:120px;min-height:38px;border:1px solid var(--line);border-radius:8px;padding:0 10px;background:#fff;color:var(--text)}.account-status-text{margin-top:6px;color:var(--muted);font-size:13px;max-width:420px}.adapter-stage{display:inline-grid;place-items:center;min-height:34px;padding:0 10px;border-radius:999px;background:#315fce1a;color:#214ea3;font-size:12px;font-weight:900}@media(max-width:860px){body{background:linear-gradient(180deg,#f8fafc,#eef2f7)}.app-shell{display:block;min-height:100vh}.sidebar{position:static;height:auto;padding:16px 14px 12px;gap:14px;border-right:0;border-bottom:1px solid rgba(255,255,255,.08)}.brand{padding:0}.brand-mark{width:40px;height:40px}.nav-list,.provider-list{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;scroll-snap-type:x mandatory}.nav-item,.provider-pill{flex:0 0 auto;width:auto;min-width:max-content;padding:10px 12px;scroll-snap-align:start}.provider-strip .section-title{margin-bottom:8px}.provider-pill .provider-word{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workspace{padding:16px 14px 92px}.topbar{align-items:stretch;flex-direction:column;padding:16px;gap:14px}h1{font-size:32px}.topbar-actions,.toolbar-actions,.dialog-actions{width:100%;flex-wrap:wrap}.topbar-actions>button,.toolbar-actions>button,.toolbar-actions>input,.dialog-actions>button{flex:1 1 150px}.status-banner{padding:14px 14px 14px 42px;font-size:14px}.metric-grid,.panel-grid,.device-grid,.scene-grid,.security-grid{grid-template-columns:1fr}.metric-grid{gap:10px}.metric,.panel,.device-card,.scene-card,.security-card,.account-card{border-radius:12px}.toolbar,.panel-head,.device-card-head,.scene-card-head,.account-card,.device-row,.channel-row,.scene-row{align-items:stretch;flex-direction:column}.row-actions,.account-actions{width:100%;justify-content:stretch}.row-actions>*,.account-actions>button,.account-actions>.adapter-stage,.account-actions>.state-chip{flex:1 1 auto}.toggle,.segmented,.segmented button{width:100%}.segmented{display:grid;grid-template-columns:repeat(3,1fr)}.inline-code-field,.inline-code-field input{width:100%}.dialog{width:calc(100vw - 24px);max-width:none;margin:auto 12px}.dialog form{max-height:86vh;overflow-y:auto}}@media(max-width:480px){.workspace,.sidebar{padding-inline:10px}h1{font-size:28px}.primary-button,.secondary-button,.ghost-button,.icon-button,.toggle,.segmented button{min-height:46px}.provider-logo{gap:6px}.provider-mark{width:30px;height:30px}}.quick-row-actions{flex-wrap:wrap}.quick-channel-control{display:inline-flex;align-items:center;gap:8px}.quick-channel-control>span{color:var(--muted);font-size:12px;font-weight:900}.quick-channel-control .segmented{min-width:220px}@media(max-width:860px){.quick-channel-control{width:100%;align-items:stretch;flex-direction:column}.quick-channel-control .segmented{min-width:0}}.danger-button{border-color:#be123c33;background:#fff1f2;color:#be123c}
