/* =====================================================================
   魔瞳 · 授权管理后台 v1.3
   纯自绘暗色组件：无原生 select / date / time 控件
   ===================================================================== */
:root {
  --bg: #0b0d12;
  --bg-soft: #0e1118;
  --surface: #151922;
  --surface-2: #11151d;
  --surface-3: #1c2230;
  --surface-hover: #232b3a;
  --border: #232b3a;
  --border-soft: #1b212c;
  --text: #e9edf5;
  --text-soft: #b3bece;
  --muted: #6e7a8e;
  --faint: #485366;
  --red: #8b5cf6;
  --red-hover: #a78bfa;
  --red-soft: #2a1f4a;
  --cyan: #22d3ee;
  --cyan-soft: #0f3236;
  --green: #3ddc97;
  --green-soft: #113227;
  --amber: #ffb020;
  --amber-soft: #33280f;
  --blue: #5b8def;
  --blue-soft: #16243d;
  --purple: #8b5cf6;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", "PingFang SC", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--cyan); text-decoration: none; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3446; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #39465c; }

/* ===================== 登录页 ===================== */
.login-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(900px 500px at 95% 110%, rgba(34, 211, 238, 0.10), transparent 55%),
    var(--bg);
}

.login-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 78%);
}

.login-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
.login-glow-a { width: 420px; height: 420px; background: rgba(139, 92, 246, 0.22); top: -120px; left: -80px; }
.login-glow-b { width: 380px; height: 380px; background: rgba(34, 211, 238, 0.12); bottom: -140px; right: -60px; }

.login-card {
  position: relative;
  z-index: 1;
  width: 392px;
  max-width: calc(100vw - 40px);
  padding: 34px 34px 22px;
  background: linear-gradient(180deg, rgba(28, 34, 48, 0.92), rgba(17, 21, 29, 0.96));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
}

.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-brand-text h1 { margin: 0; font-size: 19px; letter-spacing: 0.5px; }
.login-brand-text p { margin: 2px 0 0; font-size: 12px; color: var(--muted); letter-spacing: 2px; }

.logo-badge {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(140deg, #8B5CF6, #4F46E5);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.32);
}
.logo-badge-sm { width: 36px; height: 36px; font-size: 17px; border-radius: 10px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 12px; color: var(--text-soft); letter-spacing: 0.4px; }
.input-wrap { position: relative; display: block; }

.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #303b50; background: #0d1119; }
.input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14); background: #0c0f16; }
.input-lg { height: 46px; font-size: 14px; padding-right: 58px; }

.eye-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  height: 28px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  transition: color 0.15s ease, background 0.15s ease;
}
.eye-btn:hover { color: var(--text-soft); background: var(--surface-3); }

.form-error {
  padding: 9px 12px;
  color: #ff8aa1;
  background: var(--red-soft);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 9px;
  font-size: 12.5px;
}

.login-submit { margin-top: 2px; }
.login-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  color: var(--faint);
  font-size: 11.5px;
  letter-spacing: 0.5px;
}
.dot-sep { color: var(--faint); }

/* ===================== 按钮 ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.08s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #8B5CF6, #6D28D9);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.26);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #A78BFA, #7C3AED); }

.btn-outline { color: var(--text-soft); background: var(--surface-2); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--surface-3); border-color: #303b50; color: var(--text); }

.btn-ghost { color: var(--muted); background: transparent; }
.btn-ghost:hover:not(:disabled) { color: var(--text-soft); background: var(--surface-3); }

.btn-warn { color: #241a05; background: var(--amber); }
.btn-warn:hover:not(:disabled) { background: #ffc247; }

.btn-danger { color: #fff; background: #c82443; }
.btn-danger:hover:not(:disabled) { background: #e02950; }

.btn-lg { height: 46px; font-size: 15px; letter-spacing: 2px; }
.btn-small { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { color: var(--text); background: var(--surface-3); }

/* ===================== 后台框架 ===================== */
.app-view { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  width: 222px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-right: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 18px; }
.sidebar-title { font-size: 14px; font-weight: 700; letter-spacing: 0.3px; }
.sidebar-sub { font-size: 10.5px; color: var(--faint); letter-spacing: 1.4px; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { color: var(--text-soft); background: var(--surface-3); }
.nav-item.active { color: var(--text); background: var(--surface); border-color: var(--border-soft); box-shadow: inset 3px 0 0 var(--red); }
.nav-ico { width: 18px; text-align: center; color: var(--faint); font-size: 14px; }
.nav-item.active .nav-ico { color: var(--red); }

.sidebar-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--border-soft); }
.conn-chip { display: flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 12px; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.14); }
.sidebar-version { margin: 8px 0 12px; color: var(--faint); font-size: 11px; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; padding: 22px 26px 14px; }

.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.topbar-title h2 { margin: 0; font-size: 21px; letter-spacing: 0.4px; }
.topbar-title p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 92px;
  padding: 4px 12px;
  border-right: 1px solid var(--border-soft);
  margin-right: 2px;
}
.clock span { font-family: var(--mono); font-size: 16px; color: var(--text); letter-spacing: 0.8px; }
.clock small { color: var(--faint); font-size: 10.5px; }

.banner {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 15px;
  margin-bottom: 16px;
  color: #f2cd8a;
  background: linear-gradient(90deg, rgba(255, 176, 32, 0.10), rgba(255, 176, 32, 0.04));
  border: 1px solid rgba(255, 176, 32, 0.30);
  border-radius: 12px;
  font-size: 12.5px;
}
.banner-icon {
  width: 20px; height: 20px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--amber); color: #2a1d02;
  font-weight: 700; font-size: 12px;
}
.banner-text { flex: 1 1 auto; }
.banner .btn { margin-left: auto; }

/* ===================== 统计卡 ===================== */
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 17px 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 3px;
  border-radius: 2px;
  background: var(--faint);
}
.stat-label { color: var(--muted); font-size: 12px; letter-spacing: 0.4px; }
.stat-card strong { margin: 6px 0 2px; font-family: var(--mono); font-size: 27px; font-weight: 700; color: var(--text); line-height: 1.15; }
.stat-hint { color: var(--faint); font-size: 11px; }
.stat-total::before { background: var(--blue); }
.stat-trial::before { background: var(--cyan); }
.stat-trial strong { color: var(--cyan); }
.stat-authorized::before { background: var(--green); }
.stat-authorized strong { color: var(--green); }
.stat-expired::before { background: var(--amber); }
.stat-expired strong { color: var(--amber); }
.stat-disabled::before { background: var(--red); }
.stat-disabled strong { color: #ff7188; }

/* ===================== 面板 / 工具条 ===================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  margin-bottom: 18px;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-title h3 { margin: 0; font-size: 15.5px; }
.panel-title p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.search-box { position: relative; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 14px; pointer-events: none; }
.input-search { width: 236px; height: 36px; padding-left: 32px; font-size: 13px; }
.input-search::-webkit-search-cancel-button { -webkit-appearance: none; }

/* 自定义下拉 */
.dd { position: relative; }
.dd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 122px;
  height: 36px;
  padding: 0 13px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dd-btn:hover { background: var(--surface-3); border-color: #303b50; }
.dd.open .dd-btn { border-color: var(--red); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12); }
.dd-arrow { color: var(--faint); font-size: 11px; transition: transform 0.15s ease; }
.dd.open .dd-arrow { transform: rotate(180deg); }
.dd-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  padding: 5px;
  background: #161b25;
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5);
  display: none;
}
.dd.open .dd-menu { display: block; animation: pop 0.12s ease; }
.dd-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}
.dd-option:hover { background: var(--surface-3); color: var(--text); }
.dd-option.selected { color: var(--red); background: var(--red-soft); }
.dd-option .check { margin-left: auto; font-size: 11px; opacity: 0; }
.dd-option.selected .check { opacity: 1; }

@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ===================== 设备表格 ===================== */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border-soft); }
.device-table { width: 100%; min-width: 1080px; border-collapse: collapse; font-size: 12.5px; }
.device-table thead th {
  position: sticky;
  top: 0;
  padding: 10px 11px;
  color: var(--muted);
  background: #131822;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.device-table tbody td {
  padding: 10px 9px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  white-space: nowrap;
}
.device-table tbody tr:last-child td { border-bottom: 0; }
.device-table tbody tr { transition: background 0.12s ease; }
.device-table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }

.code-cell { display: flex; align-items: center; gap: 7px; max-width: 218px; }
.code-text {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 172px;
}
.copy-btn {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--faint);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 11px;
}
.copy-btn:hover { color: var(--cyan); background: var(--surface-3); }

.time-cell { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.time-cell.strong { color: var(--text-soft); }
.note-cell { max-width: 122px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.version-cell { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.th-actions, .actions-cell { text-align: right; }
.actions-cell { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }

/* 操作列吸附右侧：窄屏横向滚动时仍可直接操作设备 */
.device-table th.th-actions {
  position: sticky;
  right: 0;
  z-index: 3;
  background: #131822;
}
.device-table td.actions-cell-td {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: -10px 0 14px -10px rgba(0, 0, 0, 0.55);
}
.device-table tbody tr:hover td.actions-cell-td { background: #191f2a; }

/* 状态徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-trial { color: var(--cyan); background: var(--cyan-soft); border-color: rgba(34, 211, 238, 0.24); }
.badge-authorized { color: var(--green); background: var(--green-soft); border-color: rgba(61, 220, 151, 0.24); }
.badge-expired { color: var(--amber); background: var(--amber-soft); border-color: rgba(255, 176, 32, 0.26); }
.badge-disabled { color: #ff7188; background: var(--red-soft); border-color: rgba(139, 92, 246, 0.30); }
.badge-active { color: var(--green); background: var(--green-soft); border-color: rgba(61, 220, 151, 0.24); }

/* 自绘开关 */
.switch-wrap { display: inline-flex; align-items: center; gap: 6px; }
.switch {
  position: relative;
  width: 36px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-3);
  transition: background 0.16s ease, border-color 0.16s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8b96a8;
  transition: left 0.16s ease, background 0.16s ease;
}
.switch.on { background: rgba(139, 92, 246, 0.28); border-color: rgba(139, 92, 246, 0.5); }
.switch.on::after { left: 18px; background: #22D3EE; }
.switch:disabled { opacity: 0.45; cursor: not-allowed; }
.switch-label { font-size: 11px; color: var(--faint); }

.empty-state { padding: 46px 20px; text-align: center; color: var(--faint); }
.empty-ico { font-size: 30px; color: var(--faint); margin-bottom: 6px; }
.empty-state p { margin: 0; font-size: 12.5px; }

/* ===================== 二维码 ===================== */
.qr-status { height: 24px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 11.5px; color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(255, 176, 32, 0.28); }
.qr-status.ready { color: var(--green); background: var(--green-soft); border-color: rgba(61, 220, 151, 0.26); }
.qr-body { display: grid; grid-template-columns: 172px 1fr; gap: 22px; align-items: start; }
.qr-preview {
  width: 172px;
  height: 172px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 13px;
  overflow: hidden;
}
.qr-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.qr-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--faint); font-size: 12px; }
.qr-placeholder-ico { font-size: 30px; }
.qr-actions { display: flex; flex-direction: column; gap: 10px; }
.qr-meta { margin: 0; color: var(--text-soft); font-size: 12.5px; }
.hint { margin: 0; color: var(--faint); font-size: 11.5px; }
.muted { color: var(--muted); }

.main-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 12px 4px 4px;
  color: var(--faint);
  font-size: 11px;
}

/* ===================== 弹窗 ===================== */
.modal-root { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(4, 6, 10, 0.72); backdrop-filter: blur(3px); }
.modal {
  position: relative;
  z-index: 1;
  width: 520px;
  max-width: calc(100vw - 36px);
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background: #131822;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: modal-in 0.16s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { margin: 0; font-size: 15.5px; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--border-soft); }
.modal-foot .left-note { margin-right: auto; color: var(--faint); font-size: 11.5px; }
.modal-narrow { width: 430px; }

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { color: var(--muted); font-size: 12px; }
.textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14); }
.device-summary { padding: 11px 13px; margin-bottom: 14px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; }
.device-summary .mono { color: var(--text); font-size: 12px; word-break: break-all; }
.device-summary p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }

/* ===================== 自定义日期时间选择器 ===================== */
.dtp { display: flex; flex-direction: column; gap: 14px; }
.dtp-calendar { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px; }
.dtp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dtp-nav { display: flex; align-items: center; gap: 6px; }
.dtp-nav-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  background: var(--surface-3);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: 13px;
}
.dtp-nav-btn:hover { background: var(--surface-hover); color: var(--text); }
.dtp-title { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: 0.4px; }
.dtp-today-btn { height: 28px; padding: 0 10px; font-size: 11.5px; color: var(--cyan); background: var(--cyan-soft); border: 1px solid rgba(34, 211, 238, 0.22); border-radius: 8px; }
.dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dtp-week { padding: 4px 0; text-align: center; color: var(--faint); font-size: 11px; }
.dtp-day {
  height: 34px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12.5px;
  font-family: var(--mono);
}
.dtp-day:hover:not(:disabled) { background: var(--surface-3); }
.dtp-day.other { color: #333c4d; }
.dtp-day.today { border-color: rgba(34, 211, 238, 0.4); color: var(--cyan); }
.dtp-day.selected { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 5px 14px rgba(139, 92, 246, 0.3); }
.dtp-day:disabled { color: #2c3442; cursor: not-allowed; }

.dtp-time-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; gap: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.stepper-btn {
  width: 32px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  font-size: 15px;
}
.stepper-btn:hover { background: var(--surface-3); color: var(--text); }
.stepper-value { min-width: 54px; text-align: center; font-family: var(--mono); font-size: 15px; color: var(--text); }
.stepper-sep { color: var(--faint); font-size: 15px; }
.dtp-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 30px;
  padding: 0 12px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--red); color: var(--text); }
.chip.active { color: var(--red); background: var(--red-soft); border-color: rgba(139, 92, 246, 0.4); }
.dtp-preview { padding: 10px 13px; background: var(--blue-soft); border: 1px solid rgba(91, 141, 239, 0.26); border-radius: 10px; color: #b9cdf5; font-size: 12.5px; }
.dtp-preview strong { color: #fff; font-family: var(--mono); }

/* ===================== Toast ===================== */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  min-width: 220px;
  max-width: 380px;
  padding: 12px 16px;
  color: var(--text);
  background: #1a2130;
  border: 1px solid var(--border);
  border-left: 3px solid var(--cyan);
  border-radius: 11px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  font-size: 12.5px;
  animation: toast-in 0.18s ease;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast.leaving { animation: toast-out 0.18s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* ===================== 版本更新 ===================== */
.update-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.07), rgba(34, 211, 238, 0.015));
  border: 1px solid rgba(34, 211, 238, 0.20);
  border-radius: 12px;
}
.update-current-main { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.update-label { color: var(--muted); font-size: 12px; }
#update-current-version { font-family: var(--mono); font-size: 20px; color: var(--cyan); }
.update-sub { color: var(--text-soft); font-size: 12px; }
.update-api { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.update-api-label { color: var(--faint); font-size: 11px; }
.update-api .mono {
  color: var(--muted);
  font-size: 11px;
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}
.update-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.update-upload, .update-tips {
  padding: 14px 15px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.update-h4 { margin: 0 0 10px; font-size: 13px; color: var(--text-soft); font-weight: 600; }
.upload-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.upload-file {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  max-width: 330px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-file.ready { color: var(--cyan); }
.upload-actions { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.upload-status { font-size: 12px; color: var(--muted); }
.upload-status.success { color: var(--green); }
.upload-status.error { color: #ff8aa1; }
.update-tip-line { margin: 0 0 8px; }
.update-tip-line .mono {
  display: inline-block;
  color: var(--muted);
  font-size: 11.5px;
  background: var(--surface-2);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}
.update-table-wrap { margin-top: 2px; }
.update-table { min-width: 1020px; }
.version-main { font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.version-notes {
  display: block;
  color: var(--faint);
  font-size: 10.5px;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sha-cell { display: flex; align-items: center; gap: 6px; }
.sha-text {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-published { color: var(--green); background: var(--green-soft); border-color: rgba(61, 220, 151, 0.24); }
.badge-unpublished { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
.badge-latest { color: var(--cyan); background: var(--cyan-soft); border-color: rgba(34, 211, 238, 0.24); margin-left: 5px; }

/* ===================== 响应式 ===================== */
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main { padding: 18px 18px 12px; }
  .update-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { width: 74px; }
  .sidebar-title, .sidebar-sub, .sidebar-version, .conn-chip span:last-child { display: none; }
  .sidebar-brand { justify-content: center; padding: 18px 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item .nav-ico { font-size: 16px; }
  .nav-item { font-size: 0; gap: 0; }
  .nav-item .nav-ico { font-size: 16px; }
  .sidebar-foot { padding: 10px; }
  .sidebar-foot .btn { font-size: 0; padding: 0; }
  .sidebar-foot .btn::before { content: "⏻"; font-size: 14px; }
  .qr-body { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-direction: column; }
}


/* ===================== 试用天数设置 ===================== */
.trial-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 18px 20px 20px;
  flex-wrap: wrap;
}
.trial-field { min-width: 180px; max-width: 240px; }
.trial-status { color: var(--muted); font-size: 12px; padding-bottom: 10px; }
#trial-settings-section .panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
