:root {
  color-scheme: light;
  --app-bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #151923;
  --muted: #667085;
  --line: #dfe5ef;
  --line-strong: #c7d0dd;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --cyan: #0891b2;
  --green: #15803d;
  --amber: #b45309;
  --red: #b42318;
  --shadow: 0 18px 45px rgba(15, 23, 42, .08);
  --sidebar-width: 282px;
}

/* Soft pastel theme shared with the desktop client. */
:root {
  --app-bg: #fff8fc;
  --surface: #ffffff;
  --surface-soft: #fff3fa;
  --ink: #59445f;
  --muted: #9a7d9e;
  --line: #f0dce9;
  --line-strong: #e4c5da;
  --brand: #d681c3;
  --brand-strong: #bf69ad;
  --cyan: #72b8c6;
  --green: #5aa683;
  --amber: #c8934f;
  --red: #cf6f7d;
  --shadow: 0 18px 48px rgba(128, 75, 115, .10);
}

body {
  background:
    radial-gradient(circle at 88% 6%, rgba(226, 185, 221, .28), transparent 24rem),
    radial-gradient(circle at 12% 92%, rgba(193, 226, 215, .25), transparent 27rem),
    var(--app-bg);
}
.app-sidebar {
  border-right-color: var(--line);
  background: rgba(255, 242, 250, .94);
  box-shadow: 12px 0 34px rgba(126, 73, 113, .07);
}
.brand-logo {
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(214, 129, 195, .22);
  transform: rotate(-2deg);
}
.sidebar-brand strong { color: #684d6d; }
.sidebar-brand small::after { content: "  ♡"; color: var(--brand); }
.sidebar-nav a { border-radius: 15px; color: #765e7b; transition: transform .18s ease, background .18s ease; }
.sidebar-nav a:hover { transform: translateX(3px); }
.sidebar-nav a.active,
.sidebar-nav a:hover { background: #f7ddef; color: #a94f98; }
.sidebar-nav a.active i,
.sidebar-nav a:hover i { color: #c76cb4; }
.sidebar-footer { border-radius: 20px; background: rgba(255,255,255,.72); }
.avatar-dot { background: #f5d8eb; color: #ad589b; }
.app-topbar h1 { color: #634969; }
.page-kicker { color: var(--brand); }
.page-kicker::before { content: "✦ "; }
.panel,
.metric,
.client-card,
.guide-panel,
.auth-card {
  border-color: var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.panel:hover,
.metric:hover,
.client-card:hover { border-color: #e5bed9; }
.highlight-panel {
  border-color: #edcce2;
  background: linear-gradient(145deg, #fff 0%, #fff3fa 100%);
}
.metric { position: relative; overflow: hidden; }
.metric::after {
  content: "";
  position: absolute;
  width: 42px;
  height: 42px;
  right: -15px;
  top: -15px;
  border-radius: 50%;
  background: #f8dff0;
}
.metric .value, .value { color: #634969; }
.app-main button:not(.btn), .auth-card button:not(.btn), .button, .btn-primary {
  border-color: var(--brand) !important;
  border-radius: 14px !important;
  background: var(--brand) !important;
  box-shadow: 0 8px 18px rgba(214,129,195,.20);
}
.app-main button:not(.btn):hover, .auth-card button:not(.btn):hover, .button:hover, .btn-primary:hover {
  background: var(--brand-strong) !important;
  transform: translateY(-1px);
}
.btn-outline-primary { border-color: #dca4ce; color: #a75296; border-radius: 14px; }
.btn-outline-primary:hover { border-color: var(--brand); background: #fae5f3; color: #914382; }
.app-main input, .app-main select, .app-main textarea,
.auth-card input, .auth-card select, .auth-card textarea,
.form-control, .form-select {
  border-color: var(--line) !important;
  border-radius: 14px !important;
  background-color: #fffbfd !important;
}
.app-main input:focus, .app-main select:focus, .app-main textarea:focus,
.auth-card input:focus, .auth-card select:focus, .auth-card textarea:focus,
.form-control:focus, .form-select:focus {
  border-color: #dda7d0 !important;
  box-shadow: 0 0 0 4px rgba(214,129,195,.13) !important;
}
table { border-radius: 16px; overflow: hidden; }
thead th { background: #fcecf6 !important; color: #806484 !important; }
tbody tr:hover { background: #fff5fb; }
.badge { border-radius: 999px; }

.developer-hero { padding-bottom: 28px; }
.developer-hero h1 { max-width: 820px; color: #654c6b; font-size: clamp(34px,5vw,58px); font-weight: 950; }
.developer-hero .lead { max-width: 900px; }
.developer-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.developer-card { min-width:0; }
.developer-card h3 { margin:10px 0; color:#684d6d; font-size:17px; overflow-wrap:anywhere; }
.developer-card pre { margin:14px 0 0; padding:16px; border:1px solid #ead3e3; border-radius:15px; background:#392f3e; color:#fff4fb; overflow:auto; }
.developer-card pre code { padding:0; border:0; background:transparent; color:inherit; white-space:pre; }
.api-method { display:inline-flex; padding:5px 10px; border-radius:999px; background:#dcf3e9; color:#43866a; font-size:12px; font-weight:900; }
.status-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.status-grid .panel { display:flex; align-items:center; gap:12px; }
.status-grid strong { color:#b45c9f; font-size:22px; }
.status-grid span { color:var(--muted); }
@media (max-width:860px) { .developer-grid,.status-grid { grid-template-columns:1fr; } }
.badge.info { background: #f5dced; color: #9c4f8d; }
.badge.ok { background: #dcf3e9; color: #43866a; }
.flash, .alert { border-radius: 17px; }
.auth-body, .home-body {
  background:
    radial-gradient(circle at 15% 15%, rgba(244,198,229,.55), transparent 25rem),
    radial-gradient(circle at 85% 85%, rgba(195,231,220,.42), transparent 27rem),
    #fff9fc;
}
.home-hero h1, .auth-hero h1 { color: #654c6b; }
.home-visual, .visual-shell { border-radius: 28px; }
@media (prefers-reduced-motion: no-preference) {
  .brand-logo { animation: cute-float 3.6s ease-in-out infinite; }
  @keyframes cute-float { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-4px) rotate(2deg); } }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--app-bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  overflow-anchor: none;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; }
code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
code {
  display: inline-block;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f1f5f9;
  color: #334155;
  overflow-wrap: anywhere;
}

.app-body { min-height: 100vh; }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 10px 0 30px rgba(15, 23, 42, .04);
  backdrop-filter: blur(14px);
}
.app-main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 28px clamp(18px, 3vw, 46px) 52px;
}
.content-stack { display: grid; gap: 18px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  color: var(--ink);
}
.brand-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eff6ff;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .16);
}
.brand-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.sidebar-brand strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
}
.sidebar-brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}
.sidebar-nav {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #475467;
  font-weight: 750;
}
.sidebar-nav a i { width: 18px; text-align: center; color: #64748b; }
.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: #eef4ff;
  color: var(--brand);
}
.sidebar-nav a.active i,
.sidebar-nav a:hover i { color: var(--brand); }
.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}
.app-sidebar .text-white-50 { color: var(--muted) !important; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sidebar-user strong {
  display: block;
  max-width: 178px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user small {
  display: block;
  color: var(--muted);
}
.avatar-dot {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e0ecff;
  color: var(--brand);
  font-weight: 900;
}
.token-mini {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.app-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.app-topbar h1 {
  margin: 2px 0 6px;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: 0;
}
.app-topbar p,
p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.page-kicker {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.mode-switch .btn.active,
.lang-switch .btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.panel,
.metric,
.client-card,
.guide-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel { padding: 18px; }
.highlight-panel {
  border-color: rgba(37, 99, 235, .24);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.stat-grid,
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 2px;
}
.metric {
  min-height: 118px;
  padding: 16px;
}
.metric .label,
.label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.metric .value,
.value {
  color: #101828;
  font-size: 24px;
  font-weight: 950;
  overflow-wrap: anywhere;
}
.metric span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.guide-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .9fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .12), transparent 32%),
    var(--surface);
}
.guide-panel.compact {
  grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr);
}
.guide-steps {
  display: grid;
  gap: 8px;
}
.guide-steps span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
}
.guide-steps b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--brand);
}

.split,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.stack { display: grid; gap: 11px; }
.search,
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.search input { min-width: 260px; }
.search select { width: auto; min-width: 118px; }
input:not(.form-control):not([type="checkbox"]),
select:not(.form-select),
textarea:not(.form-control) {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
textarea { min-height: 112px; resize: vertical; }
input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.app-main button:not(.btn),
.auth-card button:not(.btn),
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 40px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  padding: 8px 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}
button.secondary,
.button.secondary {
  background: #fff;
  color: var(--brand);
}
button.danger,
.button.danger {
  border-color: var(--red);
  background: var(--red);
}
.button.disabled {
  opacity: .45;
  pointer-events: none;
}

.badge {
  min-height: 24px;
  padding: 5px 8px;
  border-radius: 999px;
  font-weight: 850;
}
.badge.ok { background: #dcfce7; color: var(--green); }
.badge.warn { background: #fff7ed; color: var(--amber); }
.badge.bad,
.badge.error { background: #fee4e2; color: var(--red); }
.badge.info { background: #dbeafe; color: var(--brand); }
.muted,
.checkline { color: var(--muted); }
.error-text { color: var(--red); }

.release-upload-progress {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid #efd1e5;
  border-radius: 16px;
  background: linear-gradient(145deg, #fffafd, #f8f4ff);
}
.release-upload-progress[hidden] { display: none; }
.release-upload-heading,
.release-upload-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.release-upload-heading span {
  color: #a75296;
  font-weight: 900;
}
.release-upload-detail {
  color: var(--muted);
  font-size: 13px;
}
.release-upload-detail button {
  min-height: 32px !important;
  padding: 4px 11px !important;
}
.release-upload-progress progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #f2e6ef;
  accent-color: #d982bd;
}
.release-upload-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #f2e6ef;
}
.release-upload-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #f19bc2, #c8a2e8, #91d8c2);
  transition: width .2s ease;
}
.release-upload-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #f19bc2, #c8a2e8, #91d8c2);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  font-weight: 900;
}
tr:last-child td { border-bottom: 0; }
.compact-table th,
.compact-table td { padding: 10px; }
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
}

.manage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.toolbar-left,
.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.manage-table table {
  min-width: 1120px;
}
.manage-table th,
.manage-table td {
  padding: 11px 12px;
}
.manage-table tr[data-context] {
  cursor: context-menu;
}
.manage-table tr[data-context]:hover {
  background: #f8fbff;
}
.client-list-row {
  background: #fff;
}
.node-list-row {
  background: #fbfdff;
}
.node-list-row td {
  border-bottom-color: #edf2f7;
}
.node-list-row td:nth-child(3) {
  padding-left: 28px;
}
.select-cell {
  width: 42px;
  text-align: center;
}
.context-menu {
  position: fixed;
  z-index: 9999;
  width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(15, 23, 42, .18);
}
.context-menu button {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  background: transparent;
  color: #344054;
  font-weight: 760;
}
.context-menu button:hover {
  background: #eef4ff;
  color: var(--brand);
}
.context-menu button.danger {
  color: var(--red);
}
.context-menu button.danger:hover {
  background: #fff1f2;
  color: var(--red);
}
.context-note {
  padding: 8px 10px;
  color: var(--muted);
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.client-card {
  padding: 16px;
  display: grid;
  gap: 14px;
}
.client-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.client-head strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}
.client-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.client-meta div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.client-meta span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}
.client-meta strong { overflow-wrap: anywhere; }
.client-actions {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.client-action-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto auto auto;
  align-items: center;
}
.tunnel-list { display: grid; gap: 9px; }
.tunnel-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(160px, .9fr) minmax(150px, 1fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.tunnel-row strong {
  display: block;
  margin-bottom: 3px;
}
.tunnel-state {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-jump {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.admin-jump a {
  padding: 8px 11px;
  border-radius: 10px;
  color: #475467;
  font-weight: 850;
}
.admin-jump a:hover {
  background: #eef4ff;
  color: var(--brand);
}
.admin-jump a.active {
  background: var(--brand);
  color: #fff;
}
.client-list-row.activity-selected,
.manage-table tr.client-list-row.activity-selected:hover {
  background: #eff6ff;
  box-shadow: inset 4px 0 0 var(--brand);
}
.client-activity-panel {
  border-color: rgba(37, 99, 235, .24);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, .08), transparent 28%),
    var(--surface);
}
.client-activity-content {
  margin-top: 4px;
}
.activity-split > div {
  min-width: 0;
}
.notice-list { display: grid; gap: 10px; }
.notice-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.notice-item strong {
  display: block;
  margin-bottom: 5px;
}
.drop {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-soft);
}
.empty-state {
  padding: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}
.token {
  display: block;
  margin: 12px 0;
  padding: 10px;
}
.token-actions { margin-top: 10px; }

.mode-pro .simple-only { display: none !important; }
.mode-simple .pro-only { display: none !important; }

.home-body {
  min-height: 100vh;
  background: var(--app-bg);
}
.home-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(223, 229, 239, .86);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
}
.home-nav-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
}
.home-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.home-links a {
  color: #475467;
  font-weight: 780;
}
.home-links a:hover { color: var(--brand); }
.home-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}
.home-hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr);
  gap: clamp(24px, 5vw, 68px);
  align-items: center;
  padding: 64px 0 44px;
}
.home-copy h1 {
  margin: 10px 0 18px;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.06;
  font-weight: 950;
  letter-spacing: 0;
}
.home-copy .lead {
  max-width: 680px;
  color: #475467;
  font-size: 17px;
  line-height: 1.9;
}
.home-brand-intro {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 9px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 12px 30px rgba(128,75,115,.10);
}
.home-brand-intro img { width: 48px; height: 48px; border-radius: 14px; }
.home-brand-intro span { display: grid; }
.home-brand-intro b { color: #684d6d; font-size: 17px; }
.home-brand-intro small { color: var(--muted); }
.home-capability-strip {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  margin: 0 0 54px;
}
.home-capability-strip > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
}
.home-capability-strip i { color: var(--brand); font-size: 24px; }
.home-capability-strip span { display: grid; }
.home-capability-strip b { color: var(--ink); }
.home-capability-strip small { color: var(--muted); }
@media (max-width: 860px) {
  .home-capability-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 520px) {
  .home-capability-strip { grid-template-columns: 1fr; }
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}
.hero-proof span {
  min-height: 74px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .05);
}
.hero-proof strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}
.home-visual {
  min-width: 0;
}
.visual-window {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .13);
}
.visual-titlebar {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.visual-titlebar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}
.visual-titlebar span:first-child { background: #fb7185; }
.visual-titlebar span:nth-child(2) { background: #fbbf24; }
.visual-titlebar span:nth-child(3) { background: #34d399; }
.visual-titlebar b {
  margin-left: 8px;
  color: #344054;
  font-size: 13px;
}
.visual-shell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  min-height: 410px;
}
.visual-shell aside {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 14px;
  padding: 20px 0;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}
.visual-shell aside i {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #64748b;
}
.visual-shell aside i.active {
  background: #dbeafe;
  color: var(--brand);
}
.visual-shell section {
  padding: 18px;
}
.visual-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.visual-stats div {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}
.visual-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.visual-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}
.visual-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.visual-row {
  display: grid;
  grid-template-columns: 1fr 1.35fr .72fr;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: #344054;
}
.visual-row:last-child { border-bottom: 0; }
.visual-row.head {
  min-height: 42px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.visual-row em {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: var(--green);
  font-style: normal;
  font-size: 12px;
  font-weight: 850;
}
.home-section {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}
.section-title {
  max-width: 720px;
  margin-bottom: 24px;
}
.section-title h2,
.split-info h2,
.home-cta h2 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.16;
  font-weight: 950;
}
.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.home-feature-grid article,
.faq-grid article {
  min-height: 210px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(15, 23, 42, .06);
}
.home-feature-grid i,
.scenario-grid i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 13px;
  background: #eef4ff;
  color: var(--brand);
  font-size: 20px;
}
.home-feature-grid h3,
.faq-grid h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 900;
}
.split-info {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(360px, 1fr);
  gap: 34px;
  align-items: start;
}
.workflow-list {
  display: grid;
  gap: 12px;
}
.workflow-list div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}
.workflow-list b {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dbeafe;
  color: var(--brand);
}
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.scenario-grid div {
  min-height: 182px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.scenario-grid strong,
.scenario-grid span {
  display: block;
}
.scenario-grid strong {
  margin-bottom: 7px;
  font-size: 17px;
}
.scenario-grid span {
  color: var(--muted);
  line-height: 1.7;
}
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.faq-grid article {
  min-height: 150px;
}
.home-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 34px 0 72px;
  padding: 28px;
  border: 1px solid rgba(37, 99, 235, .25);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 15%, rgba(37, 99, 235, .14), transparent 28%),
    radial-gradient(circle at 82% 10%, rgba(8, 145, 178, .12), transparent 30%),
    var(--app-bg);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, .92fr) minmax(420px, 520px);
  gap: clamp(20px, 4vw, 72px);
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}
.auth-hero {
  display: grid;
  gap: 28px;
}
.auth-hero h1 {
  margin: 8px 0 14px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: 0;
}
.auth-hero p {
  max-width: 660px;
  font-size: 16px;
}
.auth-brand { width: fit-content; }
.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.auth-feature-grid span {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .8);
  color: #344054;
  font-weight: 750;
}
.auth-feature-grid i { color: var(--brand); }
.auth-card {
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
}
.auth-form .input-group-text {
  min-width: 50px;
  justify-content: center;
  background: #f8fafc;
}
.auth-bottom {
  padding-top: 4px;
}

@media (max-width: 1220px) {
  .stat-grid,
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .client-grid { grid-template-columns: 1fr; }
  .client-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-panel,
  .guide-panel.compact { grid-template-columns: 1fr; }
  .home-hero { grid-template-columns: 1fr; }
  .home-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app-sidebar {
    position: static;
    width: auto;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .app-main {
    margin-left: 0;
    padding: 18px 14px 34px;
  }
  .sidebar-footer { margin-top: 0; }
  .app-topbar,
  .section-head { flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .stat-grid,
  .metrics,
  .split,
  .form-grid,
  .client-meta,
  .client-action-form,
  .tunnel-row,
  .notice-item { grid-template-columns: 1fr; }
  .search input,
  .search select {
    min-width: 0;
    width: 100%;
  }
  .pager {
    align-items: stretch;
    flex-direction: column;
  }
  .manage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar-actions .btn {
    flex: 1 1 auto;
  }
  .app-main button:not(.btn),
  .auth-card button:not(.btn),
  .button { width: 100%; }
  .auth-shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 560px);
  }
  .auth-feature-grid { grid-template-columns: 1fr; }
  .auth-hero h1 { font-size: 34px; }
  .home-nav-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }
  .home-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .home-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .home-actions .btn-group,
  .home-actions .btn { flex: 1 1 auto; }
  .home-hero {
    min-height: auto;
    padding: 42px 0 34px;
  }
  .home-copy h1 { font-size: 36px; }
  .hero-proof,
  .home-feature-grid,
  .scenario-grid,
  .faq-grid,
  .split-info {
    grid-template-columns: 1fr;
  }
  .home-section { padding: 48px 0; }
  .visual-shell { grid-template-columns: 48px minmax(0, 1fr); }
  .visual-stats,
  .visual-row { grid-template-columns: 1fr; }
  .visual-row { padding: 10px 12px; }
  .home-cta {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 44px;
  }
}

/* Final theme overrides intentionally follow all legacy component rules. */
.app-sidebar { background: rgba(255,242,250,.95); border-color: var(--line); }
.sidebar-nav a { border-radius: 15px; color: #765e7b; }
.sidebar-nav a.active, .sidebar-nav a:hover { background: #f7ddef; color: #a94f98; }
.panel, .metric, .client-card, .guide-panel, .auth-card { border-color: var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.highlight-panel { border-color: #edcce2; background: linear-gradient(145deg,#fff 0%,#fff3fa 100%); }
.metric .value, .value, .app-topbar h1 { color: #634969; }
.app-main button:not(.btn), .auth-card button:not(.btn), .button, .btn-primary { border-radius: 14px !important; background: var(--brand) !important; border-color: var(--brand) !important; }

/* GeeTest mounts outside our cards; never let application controls leak into it. */
[class*="geetest"] button,
[class*="geetest"] input {
  box-shadow: none !important;
  transform: none !important;
}
.btn-outline-primary { border-color: #dca4ce; color: #a75296; border-radius: 14px; }
.app-main input, .app-main select, .app-main textarea,
.auth-card input, .auth-card select, .auth-card textarea,
.form-control, .form-select { border-color: var(--line) !important; border-radius: 14px !important; background-color: #fffbfd !important; }
thead th { background: #fcecf6 !important; color: #806484 !important; }
tbody tr:hover { background: #fff5fb; }
.badge { border-radius: 999px; }
