:root {
  --bg: #07111f;
  --panel: rgba(14, 27, 45, .82);
  --panel-strong: #0e1c2d;
  --line: rgba(145, 174, 202, .16);
  --text: #edf6ff;
  --muted: #8ea3b8;
  --cyan: #32d8d1;
  --cyan-dark: #0d8584;
  --gold: #ffc75a;
  --violet: #9985ff;
  --danger: #ff6b6b;
  --success: #4ae3a1;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 15% 10%, #123052 0, transparent 32%), linear-gradient(145deg, #06101d 0%, #091525 45%, #06101b 100%); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.ambient { position: fixed; pointer-events: none; filter: blur(80px); opacity: .16; border-radius: 50%; }
.ambient-one { width: 360px; height: 360px; background: var(--cyan); top: -130px; right: 8%; }
.ambient-two { width: 300px; height: 300px; background: var(--violet); left: 18%; bottom: -170px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(460px, 100%); padding: 42px; background: linear-gradient(155deg, rgba(18, 37, 60, .96), rgba(9, 23, 39, .94)); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.brand-mark { display: flex; align-items: end; gap: 5px; width: 43px; height: 34px; margin-bottom: 28px; }
.brand-mark span { display: block; width: 9px; border-radius: 8px 8px 2px 2px; background: linear-gradient(180deg, #7ff7ed, #1e9899); box-shadow: 0 0 20px rgba(50, 216, 209, .36); }
.brand-mark span:nth-child(1) { height: 17px; }.brand-mark span:nth-child(2) { height: 32px; }.brand-mark span:nth-child(3) { height: 24px; }
.brand-mark.compact { width: 35px; height: 28px; margin: 0; transform: scale(.78); transform-origin: left center; }
.eyebrow { margin: 0 0 8px; color: var(--cyan); font-size: 11px; letter-spacing: .18em; font-weight: 700; }
h1, h2, p { margin-top: 0; }
.login-card h1 { margin-bottom: 12px; font-size: 34px; letter-spacing: -.035em; }
.login-copy { color: var(--muted); line-height: 1.7; margin-bottom: 30px; }
label { display: block; margin-bottom: 9px; color: #c9d9e8; font-size: 13px; }
.token-row { display: flex; border: 1px solid var(--line); background: rgba(3, 12, 22, .55); border-radius: 12px; overflow: hidden; margin-bottom: 18px; transition: border .2s, box-shadow .2s; }
.token-row:focus-within { border-color: rgba(50, 216, 209, .7); box-shadow: 0 0 0 3px rgba(50, 216, 209, .1); }
.token-row input { flex: 1; min-width: 0; padding: 14px 15px; border: 0; outline: 0; background: transparent; color: var(--text); }
.icon-button { border: 0; padding: 0 14px; color: var(--cyan); background: transparent; font-size: 12px; }
.primary-button, .secondary-button, .danger-button { border-radius: 10px; padding: 11px 17px; border: 1px solid transparent; color: var(--text); font-weight: 650; transition: transform .15s, filter .15s, background .15s; }
.primary-button { color: #052224; background: linear-gradient(135deg, #60eee4, #25b9b6); box-shadow: 0 10px 28px rgba(36, 185, 182, .18); }
.secondary-button { border-color: var(--line); background: rgba(140, 167, 193, .08); }
.danger-button { color: #ffd9d9; border-color: rgba(255, 107, 107, .25); background: rgba(255, 107, 107, .1); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { cursor: not-allowed; opacity: .46; transform: none; }
.full { width: 100%; }
.form-error { min-height: 20px; margin: 12px 0 0; color: #ff9494; font-size: 13px; }
.secure-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 19px; }
.secure-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px var(--success); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; display: flex; flex-direction: column; padding: 27px 18px 22px; background: rgba(5, 15, 27, .88); border-right: 1px solid var(--line); backdrop-filter: blur(18px); z-index: 5; }
.sidebar-brand { display: flex; align-items: center; gap: 4px; padding: 0 12px 34px; }
.sidebar-brand strong { display: block; font-size: 16px; }.sidebar-brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: .16em; }
nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 14px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; }
.nav-item span { color: #526a81; font: 10px ui-monospace, monospace; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.nav-item.active { color: var(--text); border-color: rgba(50, 216, 209, .16); background: linear-gradient(90deg, rgba(50, 216, 209, .14), rgba(50, 216, 209, .025)); }
.nav-item.active span { color: var(--cyan); }
.sidebar-foot { margin-top: auto; padding: 18px 12px 0; border-top: 1px solid var(--line); }
.connection-state { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; color: var(--muted); font-size: 12px; }
.connection-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px currentColor; }
.connection-state i.online { background: var(--success); }.connection-state i.offline { background: var(--danger); }
.text-button { padding: 0; border: 0; color: var(--cyan); background: transparent; font-size: 12px; }
.main-content { grid-column: 2; min-width: 0; padding: 0 36px 45px; }
.topbar { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
.topbar-meta { display: flex; align-items: center; gap: 28px; }
.topbar-meta div { display: grid; gap: 4px; }.topbar-meta span { color: var(--muted); font-size: 10px; letter-spacing: .08em; }.topbar-meta strong { font-size: 13px; font-weight: 600; }
.panel { display: none; padding-top: 30px; }.panel.active { display: block; }
.hero-grid { display: grid; grid-template-columns: minmax(400px, 1.55fr) repeat(3, minmax(150px, .72fr)); gap: 15px; }
.hero-card, .metric-card, .service-card, .category-card, .toolbar-card, .table-card, .settings-card { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 14px 40px rgba(0, 0, 0, .14); backdrop-filter: blur(12px); }
.hero-card { min-height: 238px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; padding: 28px 30px; border-radius: 18px; background: linear-gradient(135deg, rgba(16, 46, 69, .95), rgba(10, 27, 43, .9)); }
.hero-copy { position: relative; z-index: 2; max-width: 490px; }.hero-copy h2 { margin: 16px 0 10px; font-size: 29px; letter-spacing: -.035em; }.hero-copy p { max-width: 480px; color: var(--muted); line-height: 1.65; font-size: 13px; }
.hero-actions { display: flex; gap: 10px; margin-top: 24px; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 99px; font-size: 11px; font-weight: 650; }
.status-badge.neutral { color: #c3d1de; background: rgba(195, 209, 222, .1); }.status-badge.good { color: var(--success); background: rgba(74, 227, 161, .1); }.status-badge.warn { color: var(--gold); background: rgba(255, 199, 90, .1); }.status-badge.bad { color: #ff9797; background: rgba(255, 107, 107, .1); }
.signal-visual { position: relative; flex: 0 0 165px; height: 165px; margin-right: -12px; opacity: .9; }
.signal-ring, .signal-core { position: absolute; inset: 50% auto auto 50%; border-radius: 50%; transform: translate(-50%, -50%); }.signal-ring { border: 1px solid rgba(50, 216, 209, .25); }.ring-one { width: 150px; height: 150px; animation: pulse 3s infinite; }.ring-two { width: 94px; height: 94px; animation: pulse 3s .7s infinite; }.signal-core { width: 22px; height: 22px; background: var(--cyan); box-shadow: 0 0 28px rgba(50, 216, 209, .9); }.signal-line { position: absolute; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); transform-origin: center; }.line-one { width: 160px; top: 50%; left: 2px; transform: rotate(26deg); }.line-two { width: 140px; top: 49%; left: 12px; transform: rotate(-42deg); }
@keyframes pulse { 0%,100% { opacity: .28; transform: translate(-50%,-50%) scale(.92); } 50% { opacity: .9; transform: translate(-50%,-50%) scale(1.04); } }
.metric-card { min-height: 238px; padding: 24px 21px; border-radius: 18px; display: flex; flex-direction: column; justify-content: center; }.metric-card span { color: var(--muted); font-size: 12px; }.metric-card strong { margin: 14px 0 8px; font-size: clamp(27px, 3vw, 39px); letter-spacing: -.04em; }.metric-card small { color: var(--muted); line-height: 1.5; }.accent-cyan { border-top: 2px solid var(--cyan); }.accent-gold { border-top: 2px solid var(--gold); }.accent-violet { border-top: 2px solid var(--violet); }
.progress-track { height: 5px; margin: 12px 0 15px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.07); }.progress-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-dark), var(--cyan)); transition: width .4s; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 34px 2px 14px; }.section-heading h2 { margin: 0; font-size: 18px; }.section-heading > span { color: var(--muted); font-size: 11px; }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.service-card { padding: 22px; border-radius: 15px; }.service-head { display: flex; justify-content: space-between; gap: 15px; }.service-name { display: flex; gap: 13px; align-items: center; }.service-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--cyan); background: rgba(50,216,209,.1); font: 700 12px ui-monospace, monospace; }.service-name h3 { margin: 0 0 4px; font-size: 15px; }.service-name p { margin: 0; color: var(--muted); font-size: 11px; }.state-pill { height: fit-content; padding: 5px 9px; border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.05); font-size: 10px; }.state-pill.active { color: var(--success); background: rgba(74,227,161,.09); }.state-pill.failed { color: var(--danger); background: rgba(255,107,107,.09); }
.service-actions { display: flex; gap: 9px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }.service-actions button { flex: 1; padding: 8px; }
.category-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 12px; }.category-card { padding: 18px; border-radius: 14px; }.category-card span { color: var(--muted); font-size: 11px; }.category-card strong { display: block; margin: 10px 0 4px; font-size: 23px; }.category-card small { color: #6f879d; font-size: 10px; }
.live-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 15px; }.live-toolbar h2 { margin-bottom: 7px; font-size: 22px; }.live-toolbar p:last-child { margin-bottom: 0; color: var(--muted); font-size: 12px; }.live-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }.live-actions button { padding: 9px 12px; }.live-card { position: relative; display: grid; place-items: center; min-height: 520px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #02070d; box-shadow: var(--shadow); }.live-card::before { content: ""; position: absolute; inset: 0; z-index: 0; background: radial-gradient(circle at center, rgba(50,216,209,.07), transparent 58%); }.live-card img, .live-card video { position: relative; z-index: 1; display: none; width: 100%; max-height: calc(100vh - 245px); object-fit: contain; background: #000; }.live-card img.ready, .live-card video.ready { display: block; }.live-placeholder { position: relative; z-index: 2; display: grid; justify-items: center; max-width: 440px; padding: 40px 24px; color: var(--muted); text-align: center; }.live-placeholder h3 { margin: 18px 0 8px; color: var(--text); font-size: 19px; }.live-placeholder p { margin: 0; line-height: 1.7; font-size: 12px; }.live-camera-icon { display: grid; place-items: center; width: 78px; height: 52px; border: 1px solid rgba(50,216,209,.28); border-radius: 13px; color: var(--cyan); background: rgba(50,216,209,.08); box-shadow: 0 0 34px rgba(50,216,209,.12); font: 700 12px ui-monospace, monospace; letter-spacing: .12em; }.live-note { margin: 12px 3px 0; color: #70879d; font-size: 11px; }
.vibration-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.vibration-metrics article { padding: 17px 19px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.vibration-metrics span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; }.vibration-metrics strong { color: var(--text); font-size: 18px; }
.vibration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.chart-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 14px 40px rgba(0,0,0,.14); }
.chart-card > div { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 12px; }.chart-card h3 { margin: 0; font-size: 16px; }.chart-card span { color: var(--muted); font-size: 10px; }
.chart-card canvas { display: block; width: 100%; height: 330px; border-radius: 10px; background: rgba(2,9,16,.62); }
.toolbar-card { display: flex; justify-content: space-between; gap: 24px; padding: 23px 25px; border-radius: 16px; }.toolbar-card h2 { margin-bottom: 6px; font-size: 20px; }.toolbar-card p:last-child { margin-bottom: 0; color: var(--muted); font-size: 12px; }.toolbar-actions { display: flex; align-items: center; gap: 10px; }
select { min-width: 150px; padding: 10px 34px 10px 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--text); background: #0d1b2c; }
.table-card { margin-top: 15px; border-radius: 16px; overflow: hidden; }.table-scroll { overflow: auto; }table { width: 100%; border-collapse: collapse; }th { padding: 14px 18px; color: #70879d; background: rgba(5,14,25,.36); text-align: left; font-size: 10px; letter-spacing: .08em; }td { padding: 15px 18px; border-top: 1px solid var(--line); color: #cbd9e6; font-size: 12px; }td.file-name { max-width: 400px; color: var(--text); word-break: break-all; }.hash { color: #70879d; font: 10px ui-monospace, monospace; }.download-button { padding: 7px 10px; border: 1px solid rgba(50,216,209,.2); border-radius: 8px; color: var(--cyan); background: rgba(50,216,209,.07); }.empty-cell { padding: 60px; color: var(--muted); text-align: center; }.table-footer { display: flex; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.log-output { min-height: 520px; max-height: 65vh; overflow: auto; margin: 15px 0 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; color: #bcd1df; background: rgba(2,9,16,.82); font: 11px/1.65 "Cascadia Code", Consolas, monospace; white-space: pre-wrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }.settings-card { padding: 25px; border-radius: 16px; }.settings-card.wide { grid-column: 1 / -1; }.settings-card h2 { font-size: 19px; }.settings-card > p:last-of-type { color: var(--muted); line-height: 1.7; }.settings-card dl { margin: 18px 0 0; }.settings-card dl div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); }.settings-card dt { color: var(--muted); font-size: 12px; }.settings-card dd { margin: 0; max-width: 65%; text-align: right; font-size: 12px; word-break: break-all; }
.busy-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 13px; color: var(--muted); background: rgba(3,10,18,.66); backdrop-filter: blur(6px); }.spinner { width: 38px; height: 38px; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 390px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #13263a; box-shadow: var(--shadow); opacity: 0; transform: translateY(18px); pointer-events: none; transition: .2s; }.toast.show { opacity: 1; transform: none; }.toast.error { border-color: rgba(255,107,107,.4); }

@media (max-width: 1180px) { .hero-grid { grid-template-columns: repeat(3, 1fr); }.hero-card { grid-column: 1 / -1; }.category-grid { grid-template-columns: repeat(3, 1fr); }.vibration-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .app-shell { display: block; }.sidebar { position: sticky; width: 100%; height: auto; padding: 12px 15px; flex-direction: row; align-items: center; overflow-x: auto; }.sidebar-brand { display: none; }.sidebar nav { display: flex; min-width: max-content; }.nav-item { width: auto; }.sidebar-foot { display: none; }.main-content { padding: 0 18px 36px; }.topbar { align-items: flex-start; padding: 22px 0; }.topbar-meta > div { display: none; }.hero-grid { grid-template-columns: 1fr; }.hero-card { grid-column: auto; }.metric-card { min-height: 160px; }.service-grid, .settings-grid { grid-template-columns: 1fr; }.settings-card.wide { grid-column: auto; }.category-grid { grid-template-columns: repeat(2, 1fr); }.toolbar-card, .live-toolbar { flex-direction: column; align-items: stretch; }.toolbar-actions { flex-wrap: wrap; }.live-card { min-height: 280px; }.signal-visual { display: none; }.vibration-metrics { grid-template-columns: repeat(2, 1fr); }.chart-card canvas { height: 260px; } }
@media (max-width: 520px) { .login-card { padding: 30px 24px; }.topbar-meta { gap: 8px; }.topbar h1 { font-size: 22px; }.hero-card { padding: 24px 21px; }.hero-actions { flex-direction: column; }.category-grid { grid-template-columns: 1fr; }.service-grid { grid-template-columns: 1fr; }.toolbar-actions > * { width: 100%; }.section-heading > span { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
