:root {
  --bg: #0b0d12;
  --bg-soft: #11141c;
  --card: #151922;
  --line: #232838;
  --line-soft: #1b2030;
  --text: #e9ecf3;
  --muted: #8b93a8;
  --brand: #6139f6;
  --brand-2: #8a6cf9;
  --ok: #35d07f;
  --danger: #ff6b6b;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body[data-view="landing"] {
  background:
    radial-gradient(900px 480px at 18% -8%, #1d2440 0%, transparent 60%),
    radial-gradient(700px 420px at 92% 4%, #241a45 0%, transparent 55%),
    var(--bg);
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 650; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.25; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p { margin: 0; }

.sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 18px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.btn.primary:hover { filter: brightness(1.09); }

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn.ghost:hover { border-color: #33405a; background: rgba(255,255,255,.03); }

.btn.lg { padding: 12px 22px; font-size: 15px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.danger-text { color: var(--danger); }

/* ---------- brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--text);
  font-size: 15px;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 14px; font-weight: 800;
}

/* ---------- landing ---------- */

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links { display: flex; gap: 22px; margin-left: 8px; }
.nav-links a { color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-actions { margin-left: auto; display: flex; gap: 10px; }
.nav-actions[hidden] { display: none; }

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px 72px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  color: var(--brand-2);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 { font-size: 42px; margin-bottom: 16px; }
.lede { color: var(--muted); font-size: 16px; max-width: 46ch; }
.hero-cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-cta[hidden] { display: none; }

.hero-points {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}
.hero-points li::before {
  content: "✓";
  color: var(--ok);
  margin-right: 6px;
  font-weight: 700;
}

/* fake app window */
.mock.window {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.mock-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #10131b;
}
.mock-bar i {
  width: 9px; height: 9px; border-radius: 50%;
  background: #2c3446;
}
.mock-bar i:nth-child(1) { background: #ff5f57; }
.mock-bar i:nth-child(2) { background: #febc2e; }
.mock-bar i:nth-child(3) { background: #28c840; }
.mock-bar span { margin-left: 10px; font-size: 12px; color: var(--muted); }

.mock-body { display: grid; grid-template-columns: 116px 1fr; min-height: 210px; }
.mock-side {
  border-right: 1px solid var(--line-soft);
  padding: 14px 10px;
  display: flex; flex-direction: column; gap: 6px;
  background: #10131b;
}
.mock-pill {
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 9px;
  border-radius: 8px;
}
.mock-pill.active { background: rgba(97,57,246,.16); color: #b9a9ff; }
.mock-main { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.mock-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
}
.mock-row em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3a4256; }
.dot.online { background: var(--ok); box-shadow: 0 0 8px rgba(53,208,127,.6); }

/* sections */
.section { max-width: 1120px; margin: 0 auto; padding: 64px 24px; }
.section > h2 { text-align: center; margin-bottom: 34px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 13.5px; }
.card ul { color: var(--muted); font-size: 13.5px; padding-left: 18px; margin: 12px 0 18px; }
.card .btn { width: 100%; }

.pricing .card { text-align: center; }
.pricing .price { font-size: 30px; font-weight: 700; color: var(--text); margin: 10px 0 4px; }
.pricing .price span { font-size: 13px; color: var(--muted); font-weight: 500; }
.pricing ul { text-align: left; }
.card.featured { border-color: rgba(138,108,249,.55); box-shadow: 0 0 0 1px rgba(138,108,249,.2) inset; }

details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
details summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details p { color: var(--muted); font-size: 13.5px; margin-top: 10px; }

.foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.foot-links { display: flex; gap: 18px; }

/* ---------- auth ---------- */

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(700px 400px at 50% -10%, #1c2136 0%, transparent 60%),
    var(--bg);
}

.auth-shell {
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.5);
}

.auth-aside {
  padding: 34px 30px;
  background: linear-gradient(160deg, #171b2b, #12151f 60%);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
}
.auth-aside h2 { font-size: 22px; margin-top: 26px; line-height: 1.35; }
.auth-aside .hero-points { flex-direction: column; gap: 10px; margin-top: 22px; }
.aside-foot { margin-top: auto; padding-top: 26px; color: var(--muted); font-size: 13px; }

.auth-card { padding: 34px 30px; }
.auth-card.narrow { max-width: 400px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }

.form { margin-top: 22px; display: block; }
.form[hidden] { display: none; }

label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 550;
  margin: 14px 0 6px;
}
.form label:first-child { margin-top: 0; }

input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0e1118;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(97,57,246,.18);
}
input::placeholder { color: #5b6377; }

.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.inline .btn { flex: 0 0 auto; }

.error {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255,107,107,.1);
  border: 1px solid rgba(255,107,107,.34);
  color: var(--danger);
  font-size: 13px;
}
.error[hidden] { display: none; }

.switch {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ---------- app shell ---------- */

.app-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px 1fr;
}

.sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--line-soft);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
}
.side-nav a:hover { background: rgba(255,255,255,.04); color: var(--text); text-decoration: none; }
.side-nav a.active { background: rgba(97,57,246,.16); color: #b9a9ff; font-weight: 600; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.who {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main { padding: 32px 36px; max-width: 900px; }
.pane-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pane-head h1 { font-size: 24px; }

.device-list { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }

.device {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.device-head { display: flex; align-items: center; gap: 10px; }
.device-name { font-weight: 600; font-size: 15px; }
.badge {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(97,57,246,.16);
  color: #b9a9ff;
}
.device-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.device-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.empty-state { text-align: center; padding: 44px 0; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 0; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-top: 16px;
}
.panel h2 { font-size: 16px; margin-bottom: 4px; }

.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 16px;
  margin: 16px 0 0;
  font-size: 13.5px;
}
.kv dt { color: var(--muted); }
.kv dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  word-break: break-all;
}

.panel.ticket { border-color: rgba(138,108,249,.4); }
.ticket-token {
  background: #0c0f16;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  padding: 12px;
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #9fb0cc;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow: auto;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #1d2230;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  z-index: 50;
}
.toast[hidden] { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 32px; }
  .hero h1 { font-size: 32px; }
  .hero-art { order: -1; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .app-view { grid-template-columns: 1fr; }
  .sidebar {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    overflow-x: auto;
  }
  .side-nav { flex-direction: row; }
  .side-foot { margin-top: 0; margin-left: auto; flex-direction: row; align-items: center; }
  .who { display: none; }
  .app-main { padding: 22px 18px; }
  .nav-links { display: none; }
}
