  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, #6d28d9 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
  }
  .container { max-width: 1100px; margin: 0 auto; }

  /* 标题 */
  .header {
    text-align: center;
    color: #fff;
    padding: 30px 0 20px;
  }
  .header h1 {
    font-size: 34px;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #e9d5ff, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
  }
  .header p { color: #c4b5fd; margin-top: 8px; font-size: 14px; }

  /* 导航卡片 */
  .nav-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
  }
  .nav-card { flex: 1 1 110px; min-width: 110px; }
  .nav-card {
    position: relative;
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 14px 8px 12px;
    cursor: pointer;
    transition: all .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    text-align: center;
    overflow: hidden;
  }
  .nav-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--card-gradient, linear-gradient(135deg, #7c3aed, #6d28d9));
    opacity: 0;
    transition: opacity .3s;
    z-index: 0;
  }
  .nav-card > * { position: relative; z-index: 1; }
  .nav-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px var(--card-shadow, rgba(124,58,237,0.3));
  }
  .nav-card:hover::before { opacity: 1; }
  .nav-card:hover .title,
  .nav-card:hover .desc,
  .nav-card:hover .icon { color: #fff; }
  .nav-card:hover .icon { transform: scale(1.15) rotate(-4deg); }
  .nav-card.active {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px var(--card-shadow, rgba(124,58,237,0.35));
  }
  .nav-card.active::before { opacity: 1; }
  .nav-card.active .title,
  .nav-card.active .desc,
  .nav-card.active .icon { color: #fff; }

  .nav-card .icon {
    font-size: 24px;
    display: inline-block;
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
  }
  .nav-card .title { font-size: 13px; font-weight: 600; margin-top: 6px; transition: color .3s; }
  .nav-card .desc { font-size: 10px; color: #888; margin-top: 3px; transition: color .3s; }

  /* 各卡片主题色 */
  .nav-card:nth-child(1) { --card-gradient: linear-gradient(135deg, #6366f1, #4338ca); --card-shadow: rgba(99,102,241,0.35); }
  .nav-card:nth-child(2) { --card-gradient: linear-gradient(135deg, #06b6d4, #0e7490); --card-shadow: rgba(6,182,212,0.35); }
  .nav-card:nth-child(3) { --card-gradient: linear-gradient(135deg, #f59e0b, #d97706); --card-shadow: rgba(245,158,11,0.35); }
  .nav-card:nth-child(4) { --card-gradient: linear-gradient(135deg, #10b981, #047857); --card-shadow: rgba(16,185,129,0.35); }
  .nav-card:nth-child(5) { --card-gradient: linear-gradient(135deg, #ec4899, #be185d); --card-shadow: rgba(236,72,153,0.35); }
  .nav-card:nth-child(6) { --card-gradient: linear-gradient(135deg, #8b5cf6, #6d28d9); --card-shadow: rgba(139,92,246,0.35); }
  .nav-card:nth-child(7) { --card-gradient: linear-gradient(135deg, #ef4444, #b91c1c); --card-shadow: rgba(239,68,68,0.35); }
  .nav-card:nth-child(8) { --card-gradient: linear-gradient(135deg, #14b8a6, #0f766e); --card-shadow: rgba(20,184,166,0.35); }

  /* 子标签页（面板内的小功能切换） */
  .sub-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 2px solid #ede9fe; margin-bottom: 20px; padding-bottom: 0;
  }
  .sub-tab {
    padding: 10px 18px; cursor: pointer; font-size: 14px; font-weight: 600;
    color: #6b7280; border-bottom: 3px solid transparent; margin-bottom: -2px;
    transition: all .2s; white-space: nowrap;
  }
  .sub-tab:hover { color: #7c3aed; background: linear-gradient(180deg, transparent, rgba(124,58,237,0.05)); }
  .sub-tab.active { color: #7c3aed; border-bottom-color: #7c3aed; }
  .sub-pane { display: none; }
  .sub-pane.active { display: block; animation: fadeIn .25s; }

  /* 加密工具配置区 */
  .crypto-config {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
  }
  .crypto-config .row { margin-bottom: 10px; }
  .crypto-config .row:last-child { margin-bottom: 0; }
  .crypto-label {
    font-size: 13px;
    font-weight: 600;
    color: #6d28d9;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
  }
  .crypto-info {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
    padding: 8px 12px;
    background: #f3f4f6;
    border-radius: 8px;
  }
  .crypto-info b { color: #4c1d95; }

  /* 加密识别结果 */
  .detect-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
  }
  .detect-item.high { border-color: #a78bfa; background: #faf5ff; }
  .detect-item.med { border-color: #fcd34d; background: #fffbeb; }
  .detect-item.low { border-color: #d1d5db; background: #f9fafb; }
  .detect-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
  }
  .detect-badge.high { background: #7c3aed; color: #fff; }
  .detect-badge.med { background: #f59e0b; color: #fff; }
  .detect-badge.low { background: #9ca3af; color: #fff; }
  .detect-name { font-weight: 600; color: #1f2937; }
  .detect-desc { font-size: 12px; color: #6b7280; margin-top: 2px; }

  /* 工具面板 */
  .panel {
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    display: none;
    animation: fadeIn .3s;
  }
  .panel.active { display: block; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

  .panel-title {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid #ede9fe;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* 区块小标题 */
  .panel [style*="font-weight:700;color:#6d28d9"] {
    padding: 8px 14px !important;
    background: linear-gradient(90deg, rgba(124,58,237,0.08), transparent) !important;
    border-left: 4px solid #8b5cf6 !important;
    border-radius: 6px !important;
  }

  /* 表单元素 */
  .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
  input[type="text"], input[type="number"], textarea {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 11px 15px;
    font-size: 14px;
    font-family: inherit;
    transition: all .2s;
    outline: none;
    background: #fafafa;
  }
  input[type="text"]:hover, input[type="number"]:hover, textarea:hover { border-color: #c4b5fd; background: #fff; }
  input[type="text"]:focus, input[type="number"]:focus, textarea:focus {
    border-color: #8b5cf6; background: #fff;
    box-shadow: 0 0 0 4px rgba(139,92,246,0.12);
  }
  input[type="text"], input[type="number"] { width: 280px; }
  textarea {
    width: 100%; min-height: 200px; resize: vertical;
    font-family: "Consolas", "Courier New", monospace; line-height: 1.7;
  }

  .btn {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(124,58,237,0.2);
  }
  .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(124,58,237,0.4); }
  .btn:active { transform: translateY(0); }
  .btn-secondary {
    background: #fff; color: #555; border: 1.5px solid #e5e7eb; box-shadow: none;
  }
  .btn-secondary:hover { background: #f9fafb; border-color: #c4b5fd; color: #6d28d9; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }

  .result-box {
    background: linear-gradient(135deg, #faf5ff 0%, #f9fafb 100%);
    border: 2px solid #ede9fe;
    border-radius: 12px;
    padding: 18px;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.8;
    min-height: 60px;
    transition: all .2s;
  }
  .result-box:not(.empty) { border-color: #c4b5fd; box-shadow: 0 2px 8px rgba(139,92,246,0.08); }
  .result-box.empty { color: #9ca3af; font-style: italic; }

  /* 时间戳结果网格 */
  .ts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 16px;
  }
  .ts-item {
    background: linear-gradient(135deg, #ffffff, #faf5ff);
    border: 2px solid #ede9fe;
    border-radius: 12px;
    padding: 16px;
    transition: all .2s;
  }
  .ts-item:hover { border-color: #a78bfa; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(124,58,237,0.12); }
  .ts-item .label { font-size: 12px; color: #6b7280; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
  .ts-item .value { font-size: 15px; font-weight: 600; color: #4c1d95; word-break: break-all; font-family: "Consolas", monospace; }
  .ts-item .copy { font-size: 12px; color: #8b5cf6; cursor: pointer; margin-top: 6px; display: inline-block; }
  .ts-item .copy:hover { text-decoration: underline; }

  /* IP 结果 */
  .ip-result { font-size: 14px; line-height: 2; }
  .ip-result table { width: 100%; border-collapse: collapse; }
  .ip-result td { padding: 10px 14px; border-bottom: 1px solid #f3f4f6; transition: background .15s; }
  .ip-result tr:hover td { background: #faf5ff; }
  .ip-result td:first-child { color: #6b7280; width: 130px; font-weight: 500; }
  .ip-result td:last-child { color: #111; font-weight: 600; }

  /* JSON 工具栏 */
  .json-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
  .json-status { font-size: 13px; padding: 6px 14px; border-radius: 8px; margin-bottom: 8px; display: inline-block; font-weight: 500; }
  .json-status.ok { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
  .json-status.err { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

  /* 底部链接 */
  .footer {
    text-align: center;
    color: #c4b5fd;
    font-size: 13px;
    margin-top: 30px;
    padding: 20px;
  }
  .footer a { color: #fff; text-decoration: none; border-bottom: 1px dashed #c4b5fd; }
  .footer a:hover { color: #fbbf24; border-color: #fbbf24; }

  .current-time {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 8px 16px;
    color: #fff;
    font-family: monospace;
    font-size: 14px;
    display: inline-block;
    margin-top: 10px;
    backdrop-filter: blur(10px);
  }

  /* API 请求面板 */
  .api-url-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
  .api-method {
    border: 2px solid #ddd; border-radius: 10px; padding: 0 12px;
    font-size: 14px; font-weight: 700; cursor: pointer; outline: none;
    background: #fff; min-width: 110px;
  }
  .api-url { flex: 1; min-width: 260px; }
  .api-send {
    background: linear-gradient(135deg, #16a34a, #15803d); color: #fff;
    border: none; border-radius: 10px; padding: 10px 28px; font-size: 15px;
    font-weight: 700; cursor: pointer; transition: all .2s;
  }
  .api-send:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(22,163,74,0.4); }
  .api-send:disabled { background: #9ca3af; cursor: not-allowed; transform: none; box-shadow: none; }

  .api-tabs { display: flex; gap: 4px; border-bottom: 2px solid #ede9fe; margin-bottom: 16px; }
  .api-tab {
    padding: 10px 18px; cursor: pointer; font-size: 14px; font-weight: 600;
    color: #6b7280; border-bottom: 3px solid transparent; margin-bottom: -2px;
    transition: all .2s;
  }
  .api-tab:hover { color: #7c3aed; }
  .api-tab.active { color: #7c3aed; border-bottom-color: #7c3aed; }
  .api-tab .badge {
    background: #ede9fe; color: #6d28d9; border-radius: 10px;
    padding: 1px 7px; font-size: 11px; margin-left: 4px;
  }

  .api-tab-pane { display: none; }
  .api-tab-pane.active { display: block; }

  .kv-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
  .kv-row input { border: 2px solid #ddd; border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none; font-family: inherit; }
  .kv-row input:focus { border-color: #8b5cf6; }
  .kv-key { width: 200px; }
  .kv-val { flex: 1; }
  .kv-del {
    background: #fee2e2; color: #dc2626; border: none; border-radius: 8px;
    width: 32px; height: 36px; cursor: pointer; font-size: 16px; transition: all .15s;
  }
  .kv-del:hover { background: #fecaca; }
  .kv-add {
    background: #ede9fe; color: #6d28d9; border: 1px dashed #8b5cf6; border-radius: 8px;
    padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 600;
  }
  .kv-add:hover { background: #ddd6fe; }

  .body-type-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 13px; }
  .body-type-row label { display: flex; align-items: center; gap: 4px; cursor: pointer; color: #555; }

  .api-resp-meta {
    display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px;
    padding: 12px 16px; background: #f9fafb; border-radius: 10px; font-size: 13px;
  }
  .api-resp-meta .meta-item { display: flex; gap: 6px; align-items: center; }
  .api-resp-meta .meta-label { color: #6b7280; }
  .api-resp-meta .meta-value { font-weight: 700; }
  .status-ok { color: #16a34a; }
  .status-err { color: #dc2626; }
  .status-redirect { color: #d97706; }

  .resp-subtabs { display: flex; gap: 4px; margin-bottom: 10px; }
  .resp-subtab {
    padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 600;
    color: #6b7280; border-radius: 8px; transition: all .2s;
  }
  .resp-subtab:hover { background: #f3f4f6; }
  .resp-subtab.active { background: #ede9fe; color: #6d28d9; }
  .resp-pane { display: none; }
  .resp-pane.active { display: block; }

  .resp-body {
    background: linear-gradient(135deg, #1e293b, #0f172a); color: #e2e8f0; border-radius: 12px;
    padding: 18px; font-family: "Consolas","Courier New",monospace;
    font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-all;
    max-height: 500px; overflow-y: auto;
    border: 1px solid #334155;
  }
  .resp-headers-box {
    background: linear-gradient(135deg, #faf5ff, #f9fafb); border: 2px solid #ede9fe; border-radius: 12px;
    padding: 14px; font-size: 13px; line-height: 1.9; font-family: "Consolas",monospace;
    max-height: 400px; overflow-y: auto;
  }
  .resp-headers-box .hk { color: #6d28d9; font-weight: 600; }

  .history-item {
    display: flex; gap: 10px; padding: 12px 16px; border-radius: 10px;
    cursor: pointer; font-size: 13px; transition: all .15s; align-items: center;
    border: 1px solid transparent;
  }
  .history-item:hover { background: linear-gradient(90deg, #ede9fe, transparent); border-color: #ddd6fe; }
  .history-item .h-method {
    font-weight: 700; min-width: 56px; font-size: 12px;
  }
  .history-item .h-url { color: #374151; flex: 1; word-break: break-all; }
  .history-item .h-status { font-size: 12px; font-weight: 600; }
  .history-item .h-time { color: #9ca3af; font-size: 11px; }
  .history-empty { color: #9ca3af; font-style: italic; text-align: center; padding: 30px; font-size: 13px; background: #f9fafb; border-radius: 10px; }

  /* 在线翻译面板 */
  .tr-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
  .tr-select {
    border: 2px solid #ddd; border-radius: 10px; padding: 10px 12px;
    font-size: 14px; cursor: pointer; outline: none; background: #fff; font-family: inherit; min-width: 140px;
  }
  .tr-select:focus { border-color: #8b5cf6; }
  .tr-swap {
    background: #ede9fe; color: #6d28d9; border: none; border-radius: 50%;
    width: 40px; height: 40px; cursor: pointer; font-size: 18px; transition: all .2s;
  }
  .tr-swap:hover { background: #ddd6fe; transform: rotate(180deg); }
  .tr-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 700px) { .tr-panels { grid-template-columns: 1fr; } }
  .tr-side { display: flex; flex-direction: column; }
  .tr-side textarea {
    flex: 1; min-height: 180px; border-radius: 12px; border: 2px solid #ddd;
    padding: 14px; font-size: 15px; line-height: 1.7; outline: none; resize: none; font-family: inherit;
    transition: border-color .2s;
  }
  .tr-side textarea:focus { border-color: #8b5cf6; }
  .tr-out {
    background: #f9fafb; border: 2px solid #e5e7eb; border-radius: 12px;
    padding: 14px; font-size: 15px; line-height: 1.7; min-height: 180px;
    white-space: pre-wrap; word-break: break-all; color: #111; overflow-y: auto; max-height: 300px;
  }
  .tr-out.empty { color: #9ca3af; font-style: italic; }
  .tr-toolbar { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
  .tr-toolbar .btn { padding: 7px 14px; font-size: 13px; }
  .tr-engine {
    font-size: 12px; color: #6b7280; margin-left: auto;
  }
  .tr-loading { color: #8b5cf6; font-size: 13px; }
  .tr-counter { font-size: 12px; color: #9ca3af; margin-top: 4px; text-align: right; }

  /* ===== 登录遮罩 ===== */
  .auth-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, #6d28d9 100%);
    display: flex; align-items: center; justify-content: center;
  }
  .auth-box {
    background: #fff; border-radius: 20px; padding: 40px 36px;
    width: 360px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
  }
  .auth-box h2 { font-size: 24px; color: #4c1d95; margin-bottom: 6px; }
  .auth-box .sub { color: #888; font-size: 13px; margin-bottom: 24px; }
  .auth-box input {
    width: 100%; padding: 12px 14px; margin-bottom: 12px;
    border: 1px solid #ddd; border-radius: 10px; font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
  }
  .auth-box input:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
  .auth-box .auth-btn {
    width: 100%; padding: 12px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity .2s;
  }
  .auth-box .auth-btn:hover { opacity: .92; }
  .auth-box .auth-switch { margin-top: 14px; font-size: 13px; color: #888; }
  .auth-box .auth-switch a { color: #7c3aed; cursor: pointer; font-weight: 600; }
  .auth-box .auth-msg { margin-top: 10px; font-size: 13px; color: #e53935; min-height: 18px; }
  .auth-box .auth-hint { margin-top: 16px; font-size: 12px; color: #aaa; }

  /* ===== 密码输入框（显示/隐藏切换） ===== */
  .pwd-wrap { position: relative; width: 100%; margin-bottom: 12px; }
  .pwd-wrap input {
    width: 100%; padding: 12px 44px 12px 14px; margin: 0;
    border: 1px solid #ddd; border-radius: 10px; font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
  }
  .pwd-wrap input:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
  .pwd-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 6px;
    font-size: 18px; color: #9ca3af; line-height: 1; transition: color .2s;
    display: flex; align-items: center; justify-content: center;
  }
  .pwd-toggle:hover { color: #7c3aed; }
  .pwd-toggle:active { transform: translateY(-50%) scale(0.9); }

  /* ===== 顶部用户栏 ===== */
  .user-bar {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 10px; margin-bottom: 4px; color: #e9d5ff; font-size: 13px;
  }
  .user-bar .ub-name { font-weight: 600; color: #fff; }
  .user-bar .ub-role {
    background: rgba(255,255,255,0.18); padding: 2px 8px; border-radius: 10px;
    font-size: 11px;
  }
  .user-bar .ub-role.admin { background: linear-gradient(135deg,#f59e0b,#ef4444); }
  .ub-btn {
    background: rgba(255,255,255,0.15); color: #fff; border: none;
    padding: 5px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
    transition: background .2s;
  }
  .ub-btn:hover { background: rgba(255,255,255,0.28); }

  /* ===== 管理面板 ===== */
  .admin-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
  .admin-table th, .admin-table td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee;
  }
  .admin-table th { color: #6b7280; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
  .admin-table tr:hover td { background: #faf5ff; }
  .admin-table .del-btn { color: #ef4444; cursor: pointer; font-size: 13px; }
  .admin-table .del-btn:hover { text-decoration: underline; }
  .switch { position: relative; display: inline-block; width: 42px; height: 24px; }
  .switch input { opacity: 0; width: 0; height: 0; }
  .switch .slider {
    position: absolute; cursor: pointer; inset: 0; background: #ccc;
    border-radius: 24px; transition: .3s;
  }
  .switch .slider:before {
    content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%; transition: .3s;
  }
  .switch input:checked + .slider { background: linear-gradient(135deg,#7c3aed,#6d28d9); }
  .switch input:checked + .slider:before { transform: translateX(18px); }
  .switch.danger input:checked + .slider { background: linear-gradient(135deg,#ef4444,#b91c1c); }
  .admin-add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
  .admin-add-row input { padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; }
  .admin-add-row select { padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; }

  /* ===== MQTT 面板 ===== */
  .mqtt-section {
    border: 2px solid #ede9fe; border-radius: 12px; padding: 16px; margin-bottom: 16px;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
  }
  .mqtt-section-title {
    font-weight: 700; color: #5b21b6; margin-bottom: 12px; font-size: 14px;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  }
  .mqtt-status-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    background: #ccc; transition: background .3s;
  }
  .mqtt-status-dot.connected { background: #16a34a; box-shadow: 0 0 8px rgba(22,163,74,0.5); }
  .mqtt-status-dot.connecting { background: #f59e0b; animation: mqttPulse 1s infinite; }
  .mqtt-status-dot.disconnected { background: #dc2626; }
  @keyframes mqttPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
  .mqtt-log {
    background: linear-gradient(135deg, #1e293b, #0f172a); color: #e2e8f0;
    border-radius: 12px; padding: 14px; font-family: "Consolas","Courier New",monospace;
    font-size: 12px; line-height: 1.8; max-height: 350px; overflow-y: auto;
    border: 1px solid #334155; white-space: pre-wrap; word-break: break-all;
  }
  .mqtt-log-entry { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .mqtt-log-entry.info { color: #93c5fd; }
  .mqtt-log-entry.error { color: #fca5a5; }
  .mqtt-log-entry.warn { color: #fcd34d; }
  .mqtt-log-entry.msg { color: #86efac; }
  .mqtt-log-entry .mqtt-time { color: #64748b; margin-right: 6px; }
  .mqtt-sub-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: #ede9fe; color: #5b21b6; border-radius: 8px;
    padding: 4px 10px; font-size: 12px; margin: 4px 4px 0 0;
  }
  .mqtt-sub-tag .unsub { cursor: pointer; color: #dc2626; font-weight: 700; }
  .mqtt-sub-tag .unsub:hover { text-decoration: underline; }
