:root {
  color-scheme: dark;
  --bg: #07100e;
  --surface: rgba(16, 29, 25, .82);
  --surface-2: #13231e;
  --line: rgba(197, 230, 216, .12);
  --text: #edf8f3;
  --muted: #91a9a0;
  --accent: #68e3ad;
  --accent-2: #b7f37b;
  --danger: #ff8e83;
  --shadow: 0 30px 90px rgba(0, 0, 0, .38);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 15% 5%, #15352b 0, transparent 32%), var(--bg); color: var(--text); }
button, input { font: inherit; }
button, .button { -webkit-tap-highlight-color: transparent; }
.ambient { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; opacity: .2; }
.ambient-a { width: 360px; height: 360px; right: -100px; top: 12%; background: #5deda3; }
.ambient-b { width: 280px; height: 280px; left: -120px; bottom: 8%; background: #c5f36a; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; }
.auth-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 28px; background: rgba(11, 23, 19, .88); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.auth-card.wide { width: min(560px, 100%); }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #072016; font-weight: 900; letter-spacing: -.06em; box-shadow: 0 12px 36px rgba(104, 227, 173, .23); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 14px; font-size: 14px; }
.eyebrow, .step { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; margin: 24px 0 8px; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.045em; line-height: 1.08; }
.auth-card h1 { font-size: 34px; }
.subtle { color: var(--muted); line-height: 1.65; }
.form-stack { display: grid; gap: 18px; margin-top: 28px; }
.form-stack.compact { margin-top: 22px; }
label { display: grid; gap: 8px; color: #c3d5ce; font-size: 14px; }
input { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px; color: var(--text); background: #0a1713; outline: none; transition: .2s; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(104, 227, 173, .1); }
button, .button { border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 750; cursor: pointer; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
.primary { color: #061a12; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.secondary { color: var(--text); background: #1b3029; border: 1px solid var(--line); }
.ghost { color: var(--muted); background: transparent; }
.alert { margin-top: 20px; padding: 13px 15px; border: 1px solid rgba(255, 142, 131, .35); border-radius: 13px; color: #ffd0cb; background: rgba(255, 92, 77, .08); }
.security-note { color: #6f8b80; font-size: 12px; text-align: center; margin: 20px 0 0; }
.qr-wrap { width: 232px; margin: 24px auto; padding: 14px; border-radius: 20px; background: white; }
.qr-wrap img { display: block; width: 100%; }
details { color: var(--muted); text-align: center; }
.secret { display: block; margin: 12px 0; padding: 12px; color: var(--accent); background: #06120e; border-radius: 10px; overflow-wrap: anywhere; }
.success-mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; margin-bottom: 20px; color: #062014; background: var(--accent); font-size: 32px; font-weight: 900; }
.recovery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 24px 0; }
.recovery-grid code { padding: 12px; border-radius: 10px; text-align: center; background: #071510; color: #dff9ed; }
.topbar { height: 76px; padding: 0 max(22px, calc((100vw - 1220px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(7, 16, 14, .78); backdrop-filter: blur(20px); position: sticky; top: 0; z-index: 20; }
.brand-inline, .top-actions { display: flex; align-items: center; gap: 12px; }
.brand-inline div { display: grid; }
.brand-inline small { color: var(--muted); margin-top: 2px; }
.view-switch { position: absolute; left: 50%; transform: translateX(-50%); padding: 4px; display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 13px; background: #0a1713; }
.view-switch button { min-width: 76px; padding: 8px 14px; border-radius: 9px; color: var(--muted); background: transparent; }
.view-switch button.active { color: #061a12; background: var(--accent); box-shadow: 0 6px 18px rgba(104, 227, 173, .15); }
.status-pill { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #f2c66d; }
.status-pill.online i { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.status-pill.offline i { background: var(--danger); }
.workspace { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 64px 0 90px; }
.hero { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 28px; }
.hero .eyebrow { margin-top: 0; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.drop-zone { min-height: 92px; padding: 20px 26px; border: 1px dashed rgba(104, 227, 173, .28); border-radius: 20px; background: rgba(104, 227, 173, .035); display: grid; place-items: center; color: var(--muted); margin-bottom: 18px; transition: .2s; }
.drop-zone.active { border-color: var(--accent); background: rgba(104, 227, 173, .1); color: var(--text); transform: translateY(-2px); }
#uploadState { width: min(520px, 100%); text-align: center; }
.progress { height: 8px; background: #07130f; border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .15s; }
.files-card { border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(18px); }
.files-toolbar { min-height: 66px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
#breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); }
#breadcrumbs button { padding: 6px; color: var(--muted); background: transparent; }
#breadcrumbs button:last-child { color: var(--text); }
.icon-button { width: 38px; height: 38px; padding: 0; color: var(--muted); background: #172822; }
.file-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 15px 20px; color: #6f897f; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; text-align: left; }
td { padding: 15px 20px; border-top: 1px solid var(--line); color: #cbdcd5; white-space: nowrap; }
th:first-child, td:first-child { width: 55%; }
.file-name { display: flex; align-items: center; gap: 12px; min-width: 210px; color: var(--text); background: none; padding: 0; font-weight: 650; }
.file-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: rgba(104, 227, 173, .09); }
.row-actions { display: flex; justify-content: flex-end; gap: 7px; }
.row-actions a, .row-actions button { padding: 8px 10px; border-radius: 9px; color: var(--muted); background: #15251f; font-size: 12px; }
.row-actions .danger { color: var(--danger); }
.empty-state { padding: 72px 24px; text-align: center; color: var(--muted); }
.empty-state div { font-size: 44px; color: var(--accent); }
.empty-state h2 { margin: 10px 0 6px; color: var(--text); }
.empty-state p { margin: 0; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: min(420px, calc(100vw - 44px)); padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: #15271f; box-shadow: var(--shadow); z-index: 50; }
.device-hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.device-hero .eyebrow { margin-top: 0; }
.device-refresh { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.connection-card, .device-card { border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.connection-card { padding: 24px 28px; margin-bottom: 18px; }
.connection-title, .device-card-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.connection-title .eyebrow, .device-card-header .eyebrow { margin: 0 0 4px; }
.connection-title h2, .device-card h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.connection-path { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(70px, .6fr) minmax(170px, 1fr) minmax(70px, .6fr) minmax(150px, 1fr); align-items: center; margin-top: 25px; }
.path-node { display: grid; justify-items: center; text-align: center; gap: 5px; }
.path-node small { color: var(--muted); }
.path-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 13px; color: var(--accent); background: rgba(104, 227, 173, .09); font-size: 20px; }
.path-line { height: 2px; position: relative; overflow: hidden; background: rgba(145, 169, 160, .18); }
.path-line::before { content: ""; position: absolute; inset: 0; width: 0; background: var(--accent); transition: width .6s ease; }
.path-line.online::before { width: 100%; }
.path-line.online i { position: absolute; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: travel 1.8s linear infinite; }
@keyframes travel { from { left: -8px; } to { left: calc(100% + 8px); } }
.route-actions { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.route-actions > div { display: grid; gap: 5px; }
.route-actions small, .route-note { color: var(--muted); line-height: 1.6; }
.route-actions nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.route-actions .button { padding: 10px 14px; font-size: 12px; white-space: nowrap; }
.route-fallback { color: var(--muted); border: 1px solid var(--line); background: transparent; }
.route-note { margin: 13px 0 0; font-size: 11px; }
.device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.device-card { padding: 26px; min-width: 0; }
.device-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.device-identity small { display: block; margin-top: 4px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-icon { flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; font-size: 23px; }
.phone-icon { color: var(--accent); background: rgba(104, 227, 173, .1); }
.cloud-icon { color: #95c6ff; background: rgba(110, 176, 255, .1); }
.battery-panel { display: flex; align-items: center; gap: 22px; margin: 28px 0; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(7, 19, 15, .52); }
.battery-ring { --battery: 0%; width: 112px; height: 112px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) var(--battery), rgba(145, 169, 160, .13) 0); position: relative; }
.battery-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #0d1d18; }
.battery-ring > div { position: relative; display: grid; text-align: center; }
.battery-ring strong { font-size: 28px; line-height: 1; }
.battery-ring small { margin-top: 5px; color: var(--muted); }
.battery-copy h3 { margin: 0 0 7px; font-size: 20px; }
.battery-copy p { margin: 0 0 12px; color: var(--muted); line-height: 1.55; font-size: 13px; }
.metric-tag { display: inline-flex; padding: 6px 9px; border-radius: 999px; color: var(--accent); background: rgba(104, 227, 173, .08); font-size: 11px; }
.metric-bars { display: grid; gap: 18px; margin: 24px 0; }
.metric-bar > div { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.metric-bar strong { color: var(--text); font-size: 12px; }
.metric-bar progress { width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; appearance: none; background: #07130f; }
.metric-bar progress::-webkit-progress-bar { background: #07130f; border-radius: 99px; }
.metric-bar progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.metric-bar progress::-moz-progress-bar { border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.device-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--line); }
.device-facts div { min-width: 0; padding: 14px 15px; background: #0d1d18; }
.device-facts dt { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.device-facts dd { margin: 0; color: var(--text); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.service-chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.service-chip::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #62736c; }
.service-chip.online { color: #c5f4df; border-color: rgba(104, 227, 173, .22); background: rgba(104, 227, 173, .055); }
.service-chip.online::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.service-chip.offline { color: #ffc0ba; border-color: rgba(255, 142, 131, .22); }
.service-chip.offline::before { background: var(--danger); }
.cloud-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0 6px; }
.cloud-overview div { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(7, 19, 15, .52); }
.cloud-overview span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.cloud-overview strong { font-size: 16px; }
.device-offline { margin: 28px 0 0; padding: 24px; border: 1px solid rgba(255, 142, 131, .25); border-radius: 18px; color: #ffd0cb; background: rgba(255, 92, 77, .06); }
.device-offline p { margin: 7px 0 0; color: var(--muted); }
@media (max-width: 940px) {
  .device-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .auth-card { padding: 28px 22px; border-radius: 22px; }
  .topbar { height: 68px; padding: 0 16px; }
  .brand-inline > div { display: none; }
  .view-switch { position: static; transform: none; }
  .view-switch button { min-width: 62px; padding: 7px 11px; }
  .top-actions > .status-pill { display: none; }
  .workspace { width: min(100% - 24px, 1180px); padding-top: 38px; }
  .hero { align-items: stretch; flex-direction: column; }
  .hero-actions > * { flex: 1; }
  th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3) { display: none; }
  th, td { padding: 14px; }
  .recovery-grid { grid-template-columns: 1fr; }
  .device-hero { align-items: stretch; flex-direction: column; }
  .device-refresh { justify-content: space-between; }
  .connection-card, .device-card { padding: 20px; border-radius: 20px; }
  .connection-path { grid-template-columns: 1fr; gap: 10px; }
  .path-line { width: 2px; height: 30px; justify-self: center; }
  .path-line::before { width: 100%; height: 0; transition: height .6s ease; }
  .path-line.online::before { width: 100%; height: 100%; }
  .path-line.online i { left: -2px; animation: travel-mobile 1.8s linear infinite; }
  @keyframes travel-mobile { from { top: -8px; } to { top: calc(100% + 8px); } }
  .route-actions { align-items: stretch; flex-direction: column; }
  .route-actions nav { justify-content: stretch; }
  .route-actions .button { flex: 1; }
  .battery-panel { align-items: flex-start; gap: 16px; padding: 16px; }
  .battery-ring { width: 96px; height: 96px; }
  .battery-ring strong { font-size: 24px; }
  .device-facts { grid-template-columns: 1fr; }
  .cloud-overview { grid-template-columns: 1fr 1fr; }
}
