:root {
  --bg: #f4f1ea;
  --panel: rgba(255, 252, 247, 0.88);
  --panel-strong: #fffdf8;
  --line: rgba(62, 48, 32, 0.12);
  --text: #2d241a;
  --muted: #6d6153;
  --primary: #1f6feb;
  --primary-soft: rgba(31, 111, 235, 0.12);
  --success: #0f9d58;
  --danger: #c44536;
  --shadow: 0 20px 50px rgba(47, 34, 17, 0.08);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Mono", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(31, 111, 235, 0.08), transparent 32%),
    radial-gradient(circle at top right, rgba(15, 157, 88, 0.08), transparent 28%),
    linear-gradient(180deg, #f8f5ef 0%, #f2ede2 100%);
  color: var(--text);
  font-family: var(--font);
}

body {
  padding: 24px;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  min-height: calc(100vh - 48px);
}

.sidebar,
.content {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.sidebar {
  border-radius: var(--radius-xl);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.content {
  border-radius: var(--radius-xl);
  padding: 28px;
  overflow: auto;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.brand h1,
.hero h2,
.panel-heading h3,
.card-title {
  margin: 0;
}

.brand p,
.hero-copy,
.panel-heading p,
.muted,
.stat-card small,
.sidebar-label {
  color: var(--muted);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f9d58, #1f6feb);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
}

.nav-item:hover,
.nav-item.active {
  background: #fff;
  border-color: var(--line);
}

.sidebar-card,
.card,
.stat-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.sidebar-card {
  display: grid;
  gap: 10px;
}

.sidebar-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.status-online {
  background: rgba(15, 157, 88, 0.14);
  color: var(--success);
}

.status-offline {
  background: rgba(196, 69, 54, 0.12);
  color: var(--danger);
}

.alias-preview {
  line-height: 1.7;
  font-size: 14px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-actions,
.panel-tools,
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.app-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.app-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

.app-pill.is-active {
  background: linear-gradient(135deg, #ffffff, #f5f9ff);
  border-color: rgba(31, 111, 235, 0.35);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.08);
}

.app-pill.is-disabled {
  opacity: 0.64;
}

.app-strip-note {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

button {
  font: inherit;
}

.primary-button,
.ghost-button,
.soft-button {
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform 0.15s ease;
}

.primary-button:hover,
.ghost-button:hover,
.soft-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, #1f6feb, #3b82f6);
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 111, 235, 0.22);
}

.ghost-button {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.soft-button {
  background: var(--primary-soft);
  color: var(--primary);
}

.panel {
  margin-top: 24px;
  scroll-margin-top: 24px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.stats-grid,
.two-column,
.guide-grid,
.quick-grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.two-column,
.guide-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
  min-height: 132px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
}

.stat-card strong {
  font-size: 34px;
  line-height: 1;
}

.card-title {
  margin-bottom: 14px;
  font-size: 17px;
}

.summary-list {
  margin: 0;
  display: grid;
  gap: 14px;
}

.summary-list div {
  display: grid;
  gap: 4px;
}

.summary-list dt {
  color: var(--muted);
  font-size: 13px;
}

.summary-list dd {
  margin: 0;
  font-weight: 600;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 14px;
}

.chip.alt {
  background: rgba(31, 111, 235, 0.08);
  border-color: rgba(31, 111, 235, 0.14);
}

.quick-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.quick-card h4 {
  margin: 0;
  font-size: 18px;
}

.quick-card small {
  color: var(--muted);
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.text-input,
.table-input,
.table-select,
.table-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.text-input:focus,
.table-input:focus,
.table-select:focus,
.table-textarea:focus {
  outline: 2px solid rgba(31, 111, 235, 0.18);
  border-color: rgba(31, 111, 235, 0.4);
}

.table-shell {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.alias-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel-strong);
}

.alias-table th,
.alias-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.alias-table th {
  background: rgba(244, 241, 234, 0.8);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.danger-link {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-weight: 700;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.toggle-item input {
  width: 18px;
  height: 18px;
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
  display: inline-flex;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(62, 48, 32, 0.16);
  transition: background 0.15s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.switch input:checked + .slider {
  background: rgba(15, 157, 88, 0.72);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.8;
}

.mono {
  font-family: var(--mono);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(36, 26, 18, 0.36);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(420px, 100%);
  background: var(--panel-strong);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  padding: 28px;
}

.error-text {
  color: var(--danger);
  margin-top: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(45, 36, 26, 0.92);
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 60;
}

.hidden {
  display: none !important;
}

.empty-state {
  color: var(--muted);
  padding: 16px 0;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .two-column,
  .guide-grid,
  .quick-grid,
  .toggle-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    padding: 12px;
  }

  .content,
  .sidebar {
    padding: 20px;
  }

  .hero,
  .panel-heading {
    flex-direction: column;
  }

  .app-strip {
    align-items: stretch;
  }

  .app-strip-note {
    margin-left: 0;
  }
}
