:root {
  --brand: #E94560;
  --surface: #1A1A2E;
  --card: #16213E;
  --raised: #0F3460;
  --text: #ffffff;
  --muted: rgba(255,255,255,0.5);
  --border: rgba(255,255,255,0.1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--surface); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: inherit; text-decoration: none; }

/* Nav */
nav { background: var(--card); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.nav-brand { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--muted); font-size: 0.9rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 20px; border-radius: 10px;
  font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: all .2s; border: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #c73550; }
.btn-outline { border: 1px solid var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: 14px; }
.btn-green { background: #16a34a; color: #fff; }
.btn-green:hover { background: #15803d; }

/* Cards */
.card { background: var(--card); border-radius: 16px; padding: 24px; border: 1px solid var(--border); }

/* Layout */
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.text-center { text-align: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Hero */
.hero { padding: 80px 0 60px; text-align: center; }
.hero-icon { font-size: 5rem; margin-bottom: 20px; }
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 16px; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 560px; margin: 0 auto 32px; }
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Feature card */
.feature-card { text-align: center; padding: 36px 24px; }
.feature-icon { font-size: 2.8rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 0.9rem; }

/* Steps */
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--brand);
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.step h3 { font-size: 1rem; margin-bottom: 4px; }
.step p { color: var(--muted); font-size: 0.9rem; }

/* Section title */
.section-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; }
.section-sub { color: var(--muted); margin-bottom: 40px; }

/* CTA */
.cta-box { text-align: center; padding: 64px 24px; }
.cta-box h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; }
.cta-box p { color: var(--muted); margin-bottom: 28px; }

/* Download */
.dl-card { padding: 28px; }
.dl-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.dl-info h2 { font-size: 1.2rem; font-weight: 700; }
.dl-info p { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.dl-notes { border-top: 1px solid var(--border); padding-top: 16px; }
.dl-notes p { color: var(--muted); font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; }
.dl-notes ul { list-style: none; }
.dl-notes li { color: var(--muted); font-size: 0.85rem; padding: 3px 0; }
.dl-notes li::before { content: "• "; color: var(--brand); }

/* Guide */
.faq-item { border-top: 1px solid var(--border); padding: 20px 0; }
.faq-item:first-child { border-top: none; padding-top: 0; }
.faq-q { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.faq-a { color: var(--muted); font-size: 0.9rem; }
.cmd-row { display: flex; align-items: flex-start; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cmd-row:last-child { border-bottom: none; }
code { background: rgba(233,69,96,0.15); color: var(--brand); padding: 3px 10px; border-radius: 6px; font-family: monospace; font-size: 0.9rem; white-space: nowrap; }
.cmd-desc { color: var(--muted); font-size: 0.9rem; }

/* Login */
.login-wrap { max-width: 400px; margin: 80px auto; padding: 0 16px; }
.login-wrap .hero-icon { font-size: 4rem; }
.login-wrap h1 { font-size: 1.6rem; margin-bottom: 8px; }
.login-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 32px; }
.input { width: 100%; background: var(--raised); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; color: var(--text); font-size: 0.95rem; outline: none; transition: border .2s; }
.input:focus { border-color: var(--brand); }
.input::placeholder { color: var(--muted); }
.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.divider span { color: var(--muted); font-size: 0.8rem; }

/* Dashboard */
.page-wrap { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.device-card { padding: 20px; cursor: pointer; transition: border .2s; }
.device-card:hover { border-color: var(--brand); }
.device-name { font-weight: 700; font-size: 1.05rem; }
.device-id { color: var(--muted); font-size: 0.75rem; margin-top: 2px; }
.online-badge { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-on { background: #4ade80; }
.dot-off { background: #6b7280; }
.device-row-top { display: flex; justify-content: space-between; align-items: flex-start; }
.device-meta { display: flex; gap: 20px; margin-top: 16px; font-size: 0.9rem; color: var(--muted); }
.battery { color: var(--text); font-weight: 600; }

/* Modal */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; align-items: center; justify-content: center; padding: 16px; }
.modal-bg.active { display: flex; }
.modal { background: var(--card); border-radius: 16px; padding: 28px; width: 100%; max-width: 360px; border: 1px solid var(--border); }
.modal h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }
.modal-btns { display: flex; gap: 10px; }
.modal-btns .btn { flex: 1; }
.code-input { text-align: center; font-size: 1.8rem; letter-spacing: 12px; font-weight: 700; }
.error-msg { color: #f87171; font-size: 0.85rem; text-align: center; margin-top: 10px; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 16px; }
.alert-info { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 24px; text-align: center; color: var(--muted); font-size: 0.85rem; }
