:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #f1f3f6;
  --panel-3: #e9edf1;
  --border: #e4e8ed;
  --border-strong: #d4dae1;
  --text: #1c232b;
  --muted: #5b6673;
  --dim: #8d97a3;
  --accent: #17a673;
  --accent-2: #e8a13c;
  --accent-soft: rgba(23, 166, 115, 0.1);
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.12);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #0f8a5f;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #c9d1d9;
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------- 通用组件 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 17px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  background: var(--panel-2);
  border-color: #c3ccd6;
}

.btn:active {
  background: var(--panel-3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  border: 1px solid transparent;
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: #128f65;
}

.btn-danger {
  border-color: #f3c6c6;
  background: #fdeeee;
  color: #b32424;
}

.btn-danger:hover {
  background: #fbdfdf;
  border-color: #eeadad;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--panel-2);
}

.btn-sm {
  height: 33px;
  padding: 0 13px;
  font-size: 13.5px;
  border-radius: 7px;
}

.btn-block {
  width: 100%;
}

.icon {
  width: 17px;
  height: 17px;
  flex: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
.field .label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid #d9dfe6;
  background: #ffffff;
  color: var(--text);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 13px;
  resize: vertical;
  line-height: 1.55;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 166, 115, 0.15);
}

.input::placeholder,
.textarea::placeholder {
  color: #9aa4b0;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6b7683 50%),
    linear-gradient(135deg, #6b7683 50%, transparent 50%);
  background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

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

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

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

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
}

.small {
  font-size: 13px;
}

.nowrap {
  white-space: nowrap;
}

.spacer {
  flex: 1;
}

.hidden {
  display: none !important;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge-success {
  color: #0f7a45;
  background: #e7f6ee;
  border-color: #bfe5d2;
}

.badge-warning {
  color: #92600a;
  background: #fdf3e0;
  border-color: #f3ddb0;
}

.badge-danger {
  color: #b32424;
  background: #fdecec;
  border-color: #f5c6c6;
}

.badge-accent {
  color: #0e7a56;
  background: #e6f6ef;
  border-color: #b9e4d2;
}

.badge-cyan {
  color: #a5521a;
  background: #fdeee2;
  border-color: #f5d3b8;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b6bfca;
  flex: none;
}

.dot.live {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
  animation: pulse 2s infinite;
}

.dot.off {
  background: var(--danger);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.13);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.04);
  }
}

.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
  flex: none;
}

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

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d6dce3;
  border: 1px solid #c9d1d9;
  transition: background 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: 2px;
  top: 2px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2);
  transition: transform 0.18s ease;
}

.switch input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
}

.panel-head h3 {
  font-size: 16px;
}

.panel-head .sub {
  font-size: 13px;
  color: var(--dim);
  margin-top: 1px;
}

.panel-head .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.panel-body {
  padding: 18px;
}

.panel-body.tight {
  padding: 0;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 46px 20px;
  color: var(--dim);
  text-align: center;
}

.empty strong {
  color: var(--muted);
  font-weight: 600;
}

/* ---------------- 登录页 ---------------- */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 36px 34px 30px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(16, 24, 40, 0.08);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.auth-card h1 {
  font-size: 23px;
  margin-bottom: 6px;
}

.auth-card .hint {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------- 品牌 ---------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  flex: none;
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
  letter-spacing: 0.08em;
}

/* ---------------- 软件选择页 ---------------- */

.page {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0 26px;
}

.page-header .spacer {
  flex: 1;
}

.hero {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: 29px;
  letter-spacing: -0.01em;
}

.hero p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 14.5px;
}

.hero .actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.mini-stat {
  padding: 15px 17px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

.mini-stat .value {
  font-size: 23px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.02em;
}

.mini-stat .label {
  font-size: 13px;
  color: var(--dim);
  margin-top: 1px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.app-card:hover {
  border-color: rgba(23, 166, 115, 0.5);
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.09);
}

.app-card.new {
  border-style: dashed;
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.6);
  align-items: center;
  justify-content: center;
  min-height: 224px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  box-shadow: none;
}

.app-card.new:hover {
  color: var(--text);
  border-color: var(--accent);
}

.app-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.app-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  color: #0e7a56;
  background: #e6f6ef;
  border: 1px solid #c4e7d6;
  flex: none;
}

.app-card h3 {
  font-size: 17px;
  margin-top: 1px;
}

.app-card .desc {
  color: var(--dim);
  font-size: 13.5px;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 22px;
}

.app-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  background: #f8fafb;
  border: 1px solid var(--border);
}

.app-stats div {
  text-align: center;
}

.app-stats .v {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15.5px;
}

.app-stats .k {
  font-size: 12px;
  color: var(--dim);
}

.app-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-card-foot .key {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 管理后台 ---------------- */

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px;
  border-right: 1px solid var(--border);
  background: #ffffff;
  overflow: auto;
}

.side-app {
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafb;
}

.side-app-name {
  font-weight: 650;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-app-key {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 41px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.nav button:hover {
  background: #f2f5f7;
  color: var(--text);
}

.nav button.active {
  background: #e6f6ef;
  border-color: #c4e7d6;
  color: #0e7a56;
}

.nav button .icon {
  opacity: 0.85;
}

.nav .nav-label {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: uppercase;
  padding: 12px 12px 5px;
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

.conn-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  padding: 0 3px;
}

.side-foot a,
.side-foot button {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
}

.side-foot a:hover,
.side-foot button:hover {
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 66px;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.topbar h2 {
  font-size: 17.5px;
}

.topbar .sub {
  font-size: 12.5px;
  color: var(--dim);
  margin-top: 1px;
}

.topbar .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 24px 26px 60px;
  max-width: 1380px;
  width: 100%;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 18px;
  animation: fadeUp 0.18s ease;
}

.tab-panel.active {
  display: flex;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #e6f6ef;
  color: #12805c;
  flex: none;
}

.stat-icon.amber {
  background: #fdf3e0;
  color: #b0731c;
}

.stat-icon.green {
  background: #e3f4ee;
  color: #0f8a68;
}

.stat-icon.cyan {
  background: #fdeee2;
  color: #b05c1f;
}

.stat-icon svg {
  width: 21px;
  height: 21px;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-card .label {
  font-size: 13px;
  color: var(--dim);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.table-wrap {
  overflow: auto;
  max-height: 560px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--dim);
  background: #f7f9fb;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef1f4;
  vertical-align: middle;
}

tbody tr:hover {
  background: #f6faf8;
}

tbody tr:last-child td {
  border-bottom: none;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #0e7a56;
  background: #e6f6ef;
  border: 1px solid #c9e8d8;
  flex: none;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13.5px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.rank.r1 {
  background: #fdf3e0;
  color: #92600a;
  border-color: #f3ddb0;
}

.rank.r2 {
  background: #eef1f4;
  color: #5b6673;
  border-color: #d4dae1;
}

.rank.r3 {
  background: #fdeee2;
  color: #a5521a;
  border-color: #f5d3b8;
}

.content-cell {
  max-width: 520px;
  overflow-wrap: anywhere;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.toolbar .input,
.toolbar .select {
  width: auto;
  min-width: 140px;
  height: 36px;
}

.toolbar .search {
  min-width: 220px;
}

.load-more {
  display: flex;
  justify-content: center;
  padding: 14px;
  border-top: 1px solid var(--border);
}

.feed {
  display: flex;
  flex-direction: column;
  max-height: 470px;
  overflow: auto;
}

.feed-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef1f4;
  animation: fadeUp 0.2s ease;
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  flex: none;
  width: 64px;
  padding-top: 2px;
}

.feed-body {
  min-width: 0;
  flex: 1;
}

.feed-user {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.feed-text {
  font-size: 14.5px;
  overflow-wrap: anywhere;
}

.feed-item.official .feed-user {
  color: #0e7a56;
}

.feed-item.gift .feed-text {
  color: #b0731c;
}

.client-list {
  display: flex;
  flex-direction: column;
}

.client-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef1f4;
}

.client-item:last-child {
  border-bottom: none;
}

.client-item .meta {
  min-width: 0;
  flex: 1;
}

.client-item .name {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.client-item .sub {
  font-size: 12.5px;
  color: var(--dim);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-block {
  position: relative;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f7f9fb;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: #384250;
  overflow: auto;
  white-space: pre;
}

.code-block .copy {
  position: absolute;
  top: 8px;
  right: 8px;
}

.cred-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafb;
}

.cred-row .label {
  width: 96px;
  flex: none;
  font-size: 13px;
  color: var(--dim);
}

.cred-row .value {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cred-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.section-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.hint-box {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #c6ead9;
  background: #eefaf4;
  color: #116a4d;
  font-size: 13.5px;
  line-height: 1.65;
}

.hint-box.warn {
  border-color: #f0dcae;
  background: #fdf6e7;
  color: #8a5d10;
}

.danger-zone {
  border-color: #f3caca;
}

.danger-zone .panel-head {
  border-bottom-color: #f5d4d4;
}

/* ---------------- 弹窗 / 提示 ---------------- */

dialog {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.dialog-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 0;
}

.dialog-head h3 {
  font-size: 17px;
}

.dialog-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 0 20px 20px;
}

.toast-wrap {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 250px;
  max-width: 380px;
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.14);
  font-size: 14px;
  animation: toastIn 0.2s ease;
  pointer-events: auto;
}

.toast.success {
  border-color: #bfe5d2;
}

.toast.error {
  border-color: #f5c6c6;
}

.toast .bar {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}

.toast.success .bar {
  background: var(--success);
}

.toast.error .bar {
  background: var(--danger);
}

.toast.leaving {
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.2s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- 响应式 ---------------- */

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

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
  }

  .side-app {
    display: none;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .nav .nav-label {
    display: none;
  }

  .nav button {
    height: 35px;
    padding: 0 11px;
    font-size: 13.5px;
  }

  .side-foot {
    margin: 0 0 0 auto;
    flex-direction: row;
    align-items: center;
    border: none;
    padding: 0;
  }

  .conn-status {
    display: none;
  }

  .split {
    grid-template-columns: 1fr;
  }

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

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 18px 16px 48px;
  }
}

@media (max-width: 640px) {
  .page {
    width: calc(100% - 28px);
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero .actions {
    margin-left: 0;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .overview-strip {
    grid-template-columns: 1fr 1fr;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .content-cell {
    max-width: 240px;
  }

  .topbar .sub {
    display: none;
  }
}
