:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fafc;
  --text: #1b2430;
  --muted: #697386;
  --line: #dfe5ee;
  --primary: #087f8c;
  --primary-dark: #05606a;
  --accent: #c47f1b;
  --danger: #b42318;
  --ok: #137333;
  --info: #2457c5;
  --shadow: 0 18px 45px rgba(24, 35, 53, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(8, 127, 140, 0.08), transparent 260px),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

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

.auth-panel {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.brand-block,
.sidebar-head,
.topbar,
.row-actions,
.toolbar,
.inline-fields {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-block {
  margin-bottom: 22px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}

.admin-mark {
  background: #263c66;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.admin-sidebar {
  width: auto;
}

body[data-app="admin"] .layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar-head {
  margin-bottom: 18px;
}

.sidebar-head span {
  display: block;
  max-width: 172px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu {
  display: grid;
  gap: 4px;
  align-content: start;
}

.menu-item {
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  text-align: left;
}

.menu-item:hover {
  background: #eef4f7;
}

.menu-item.active {
  background: #dceff2;
  color: #075d67;
  font-weight: 700;
}

.menu-label {
  margin: 14px 8px 5px;
  color: #7b8494;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-foot {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.ghost-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.content {
  display: grid;
  gap: 16px;
}

.panel,
.table-wrap,
.stat,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(24, 35, 53, 0.05);
}

.panel {
  padding: 18px;
}

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

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  padding: 16px;
}

.stat strong {
  display: block;
  margin-top: 7px;
  font-size: 28px;
}

.stack {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #39465a;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(8, 127, 140, 0.14);
}

.tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.tab {
  min-height: 34px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 1px 6px rgba(24, 35, 53, 0.08);
}

.primary,
.secondary,
.danger,
.small-btn {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--primary-dark);
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: #2e3a4d;
}

.secondary:hover {
  background: #f3f6f9;
}

.danger {
  background: #fff1f0;
  color: var(--danger);
}

.small-btn {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: #344054;
  font-size: 13px;
}

.tooltip-anchor {
  display: inline-flex;
}

.hover-tooltip {
  position: fixed;
  z-index: 80;
  max-width: min(360px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 8px;
  background: #182332;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(24, 35, 53, 0.2);
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
  text-align: left;
}

.wide {
  width: 100%;
}

.message {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: #526070;
  font-size: 12px;
  font-weight: 800;
}

.compact-table th,
.compact-table td {
  padding: 7px 12px;
  font-size: 13px;
}

.compact-table .status {
  min-height: 22px;
  padding: 2px 7px;
}

.compact-table .small-btn {
  min-height: 28px;
  padding: 5px 10px;
}

tr:last-child td {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.status::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.status.running {
  background: #e8f5ed;
  color: var(--ok);
}

.status.paid {
  background: #e8f5ed;
  color: var(--ok);
}

.status.creating,
.status.starting,
.status.stopping,
.status.rebooting,
.status.pending {
  background: #fff4df;
  color: var(--accent);
}

.status.error,
.status.failed,
.status.expired {
  background: #fff1f0;
  color: var(--danger);
}

.status.stopped {
  background: #eef2f7;
  color: #536173;
}

.status.assigned,
.status.unassigned {
  background: #e8f5ed;
  color: var(--ok);
}

.selected-row td {
  background: #f0f9fb;
}

.mail-split {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 146px);
  min-height: 560px;
}

.mail-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.mail-scroll {
  min-height: 0;
  overflow: auto;
}

.mail-meta {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mail-body {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: #1f2937;
  white-space: pre-wrap;
}

.mail-body a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
}

.mail-body img {
  max-width: 100%;
  height: auto;
}

.mail-body table {
  min-width: 0;
}

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

.rich-editor {
  min-height: 320px;
  max-height: 640px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  line-height: 1.55;
}

.rich-editor:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(8, 127, 140, 0.14);
}

.rich-editor:empty::before {
  color: var(--muted);
  content: attr(data-placeholder);
}

.rich-editor img,
.article-body img {
  max-width: 100%;
  height: auto;
}

.rich-editor a,
.article-body a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
}

.article-list {
  display: grid;
  gap: 8px;
}

.article-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.article-row:hover {
  background: #f5fbfc;
  border-color: rgba(8, 127, 140, 0.35);
}

.article-row span {
  min-width: 0;
}

.article-row strong,
.article-row small {
  display: block;
}

.article-row small {
  margin-top: 5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.article-body {
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: #1f2937;
  line-height: 1.6;
}

.article-body table {
  min-width: 0;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items: stretch;
  gap: 14px;
}

.plan-card {
  display: grid;
  min-height: 376px;
  grid-template-rows: 58px 70px auto 24px minmax(96px, 1fr);
  align-content: start;
  gap: 8px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.plan-card.selected {
  border-color: var(--primary);
  outline: 3px solid rgba(8, 127, 140, 0.12);
}

.plan-title {
  display: -webkit-box;
  align-self: end;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 21px;
  line-height: 1.28;
}

.plan-spec {
  display: flex;
  min-height: 70px;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  gap: 8px;
}

.plan-price {
  align-self: end;
}

.plan-pool {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-height: 1.5;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #445164;
  font-size: 12px;
  font-weight: 700;
}

.price {
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 900;
}

.empty-state {
  padding: 30px;
  text-align: center;
}

.email-request-empty {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 26px rgba(24, 35, 53, 0.05);
}

.node-test-result {
  margin-top: 8px;
  max-width: 260px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.node-test-result.pending {
  color: var(--info);
}

.node-test-result.success {
  color: var(--ok);
}

.node-test-result.error {
  color: var(--danger);
}

.inline-action-feedback {
  flex: 1 0 100%;
  min-width: 180px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

.inline-action-feedback.pending {
  color: var(--info);
}

.inline-action-feedback.success {
  color: var(--ok);
}

.inline-action-feedback.error {
  color: var(--danger);
}

.qa-list {
  display: grid;
  gap: 12px;
}

.airdrop-row-alert {
  margin-top: 5px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.airdrop-question-btn.pending {
  border-color: #fecdca;
  background: #fff1f0;
  color: var(--danger);
}

.airdrop-question-btn.pending:hover {
  border-color: #fda29b;
  background: #fee4e2;
  color: #b42318;
}

.qa-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
}

.qa-question,
.qa-reply {
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.qa-question strong,
.qa-reply strong {
  color: #182230;
  line-height: 1.55;
}

.qa-question span,
.qa-reply span {
  color: var(--muted);
  font-size: 12px;
}

.qa-reply {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4fbfc;
}

.qa-reply.pending {
  color: var(--muted);
  background: #f8fafc;
  font-weight: 700;
}

.compact-empty {
  padding: 20px;
}

.server-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.server-card {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(24, 35, 53, 0.05);
}

.server-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.server-card-title {
  min-width: 0;
}

.server-card-title h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #101828;
  font-size: 18px;
  line-height: 1.25;
}

.server-card-title p,
.server-network span,
.server-info-grid small {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.server-card-error {
  padding: 8px 10px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  background: #fff5f4;
  color: var(--danger);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.server-network {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.server-network strong,
.server-network span,
.server-info-grid strong,
.server-info-grid small {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.server-info-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
}

.server-info-grid span {
  display: block;
  margin-bottom: 4px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.server-info-grid strong {
  display: block;
  color: #182230;
  font-size: 14px;
  line-height: 1.35;
}

.server-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.server-actions .small-btn,
.server-actions .danger {
  width: 100%;
  min-width: 0;
  padding-right: 6px;
  padding-left: 6px;
}

.server-actions .tooltip-anchor {
  display: block;
  min-width: 0;
  width: 100%;
}

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

.admin-vm-card {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.045);
}

.admin-vm-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.admin-vm-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-vm-title .link-button {
  min-width: 0;
  padding: 0;
  text-align: left;
  color: #182230;
  font-size: 16px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.admin-vm-title span,
.admin-vm-user {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.admin-vm-info > div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f8fafc;
}

.admin-vm-info span {
  display: block;
  margin-bottom: 4px;
  color: #667085;
  font-size: 11px;
  font-weight: 850;
}

.admin-vm-info strong {
  display: block;
  min-width: 0;
  color: #182230;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-vm-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-vm-actions .small-btn,
.admin-vm-actions .danger {
  width: 100%;
  min-width: 0;
  padding-right: 6px;
  padding-left: 6px;
}

.node-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-filter {
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}

.node-filter:hover {
  border-color: #98a2b3;
  background: #f8fafc;
}

.node-filter.active {
  border-color: #8bd3dc;
  background: #e8f7f9;
  color: var(--primary-dark);
  box-shadow: inset 0 -2px 0 var(--primary);
}

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

.prebox {
  max-width: 520px;
  max-height: 120px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #475467;
  font-size: 12px;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #182332;
  color: #fff;
  box-shadow: var(--shadow);
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.dialog-panel {
  width: min(440px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.password-dialog input {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 15px;
  font-weight: 700;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.check-grid label,
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.check-grid input,
.checkbox-line input {
  width: auto;
  min-height: auto;
}

.ssh-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #071018;
  color: #d8e5ef;
}

.ssh-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: #101b25;
}

.ssh-topbar span {
  display: block;
  color: #93a4b3;
  font-size: 12px;
}

.ssh-terminal {
  min-height: 0;
  padding: 10px;
  overflow: hidden;
}

.ssh-terminal .xterm,
.ssh-terminal .xterm-screen,
.ssh-terminal .xterm-viewport {
  width: 100% !important;
  height: 100%;
}

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

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .menu {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .sidebar-foot {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  .row-actions,
  .toolbar,
  .inline-fields {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .auth-panel {
    padding: 22px;
  }

  .topbar,
  .panel-head {
    display: grid;
  }

  .sidebar-foot {
    grid-template-columns: 1fr;
  }
}

/* Tabler UI refresh */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #087f8c;
  --primary-dark: #05606a;
  --accent: #b7791f;
  --danger: #b42318;
  --ok: #16803c;
  --info: #1d4ed8;
  --shadow: 0 18px 42px rgba(16, 24, 40, 0.08);
}

body {
  background: var(--bg);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 0 0, rgba(8, 127, 140, 0.12), transparent 28rem),
    linear-gradient(180deg, #ffffff 0, rgba(255, 255, 255, 0) 18rem);
  content: "";
}

.auth-shell {
  padding: 32px;
}

.auth-panel {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid rgba(228, 231, 236, 0.95);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.12);
}

.brand-block {
  gap: 14px;
  margin-bottom: 24px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: linear-gradient(135deg, #087f8c, #0ca678);
  box-shadow: 0 12px 24px rgba(8, 127, 140, 0.22);
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1;
}

.admin-mark {
  background: linear-gradient(135deg, #3451a4, #087f8c);
  box-shadow: 0 12px 24px rgba(52, 81, 164, 0.22);
  font-size: 15px;
}

h1 {
  font-size: 25px;
  font-weight: 800;
}

h2 {
  font-size: 24px;
  font-weight: 800;
}

h3 {
  font-size: 16px;
  font-weight: 800;
}

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

.layout {
  grid-template-columns: 264px minmax(0, 1fr);
  background: transparent;
}

body[data-app="admin"] .layout {
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  overflow: auto;
  padding: 18px 14px;
  border-right: 1px solid rgba(228, 231, 236, 0.92);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.sidebar-head {
  gap: 12px;
  margin: 2px 4px 18px;
  padding: 8px 4px 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar-head strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.sidebar-head span {
  max-width: 178px;
  font-size: 12px;
}

.menu {
  gap: 3px;
}

.menu-label {
  margin: 18px 10px 7px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.menu-item {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #475467;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.menu-item i {
  width: 18px;
  color: #7b8794;
  font-size: 18px;
}

.menu-item:hover {
  border-color: #d0e7eb;
  background: #f4fbfc;
  color: var(--primary-dark);
  transform: translateX(1px);
}

.menu-item:hover i,
.menu-item.active i {
  color: var(--primary-dark);
}

.menu-item.active {
  border-color: #b9e1e7;
  background: #e8f7f9;
  color: var(--primary-dark);
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--primary);
}

.menu-item.has-alert::after {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  margin-left: auto;
  border-radius: 999px;
  background: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.14);
}

.sidebar-foot {
  gap: 10px;
  padding: 18px 4px 2px;
}

.ghost-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--primary-dark);
  font-weight: 800;
}

.ghost-link:hover {
  background: #eef8fa;
  text-decoration: none;
}

.workspace {
  padding: 26px 30px 36px;
}

.topbar {
  min-height: 72px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.05);
  backdrop-filter: blur(10px);
}

.topbar p {
  margin-top: 4px;
}

.content {
  gap: 16px;
}

.panel,
.table-wrap,
.stat,
.empty-state,
.plan-card {
  border: 1px solid rgba(228, 231, 236, 0.95);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.055);
}

.panel,
.stat,
.empty-state {
  padding: 18px;
}

.panel-head {
  gap: 14px;
  margin-bottom: 14px;
}

.stat {
  min-height: 112px;
  position: relative;
  overflow: hidden;
}

.stat::after {
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 92px;
  height: 92px;
  border: 18px solid rgba(8, 127, 140, 0.08);
  border-radius: 50%;
  content: "";
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.stat strong {
  margin-top: 8px;
  color: var(--text);
  font-size: 27px;
  font-weight: 900;
}

.form-grid {
  gap: 14px;
}

label {
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  min-height: 40px;
  border-color: #d0d5dd;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.03);
}

input:hover,
select:hover,
textarea:hover,
.rich-editor:hover {
  border-color: #b7c0cc;
}

input:focus,
select:focus,
textarea:focus,
.rich-editor:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(8, 127, 140, 0.13);
}

.tab-row {
  gap: 4px;
  padding: 4px;
  border-radius: 9px;
  background: #eef2f6;
}

.tab {
  min-height: 36px;
  border-radius: 7px;
  color: #667085;
}

.tab.active {
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
}

.primary,
.secondary,
.danger,
.small-btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.primary {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(8, 127, 140, 0.18);
}

.primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.secondary,
.small-btn {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #344054;
}

.secondary:hover,
.small-btn:hover {
  border-color: #98a2b3;
  background: #f8fafc;
  color: #182230;
}

.danger {
  border: 1px solid #fecdca;
  background: #fff5f4;
  color: var(--danger);
}

.danger:hover {
  border-color: #fda29b;
  background: #fee4e2;
  color: #912018;
}

button:disabled,
a.disabled,
.small-btn.disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.link-button {
  color: var(--primary-dark);
}

.table-wrap {
  overflow: auto;
}

table {
  min-width: 780px;
}

th,
td {
  padding: 11px 13px;
  border-bottom: 1px solid #eef0f3;
}

th {
  background: #f8fafc;
  color: #667085;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

tbody tr:hover td {
  background: #fbfdff;
}

.order-table-wrap {
  width: 100%;
  overflow-x: hidden;
}

.order-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.order-table th,
.order-table td {
  vertical-align: middle;
}

.order-table td {
  overflow-wrap: anywhere;
}

.order-table .cell-main {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-table .muted {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-table td[data-label="月数"],
.order-table td[data-label="金额"],
.order-table td[data-label="状态"] {
  white-space: nowrap;
}

.order-table .status {
  min-width: 58px;
  justify-content: center;
  white-space: nowrap;
}

.order-actions {
  gap: 6px;
}

.order-actions .small-btn,
.order-actions .danger {
  flex: 1 1 calc(50% - 6px);
  min-width: 72px;
  padding-right: 8px;
  padding-left: 8px;
}

.compact-table th,
.compact-table td {
  padding: 7px 10px;
}

.status {
  min-height: 24px;
  border-radius: 999px;
  font-weight: 850;
}

.status.running,
.status.success,
.status.active,
.status.published,
.status.assigned,
.status.paid {
  background: #e9f7ef;
  color: var(--ok);
}

.status.creating,
.status.starting,
.status.stopping,
.status.rebooting,
.status.pending,
.status.pending_review,
.status.provisioning,
.status.draft,
.status.reserved {
  background: #fff7e6;
  color: var(--accent);
}

.status.error,
.status.failed,
.status.expired,
.status.rejected,
.status.deleted,
.status.disabled {
  background: #fff1f0;
  color: var(--danger);
}

.status.stopped,
.status.cancelled,
.status.refunded,
.status.unassigned {
  background: #eef2f6;
  color: #475467;
}

.recharge-shell {
  width: min(980px, 100%);
  display: grid;
  gap: 18px;
  margin: 0 auto;
}

.recharge-balance {
  width: fit-content;
  min-width: 220px;
  margin: 0 auto;
  padding: 10px 18px;
  border: 1px solid #dce8ec;
  border-radius: 8px;
  background: #fff;
  color: #475467;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.055);
}

.recharge-balance strong {
  color: var(--primary-dark);
  font-size: 22px;
}

.recharge-card {
  padding: 24px;
  border: 1px solid #dce8ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.07);
}

.recharge-card-head {
  margin-bottom: 18px;
  text-align: left;
}

.recharge-card-head h3 {
  color: #17172c;
  font-size: 22px;
  font-weight: 900;
}

.recharge-card-head p {
  margin-top: 6px;
  color: #667085;
  font-size: 14px;
}

.recharge-form {
  display: grid;
  gap: 14px;
}

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

.recharge-amount-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pay-method,
.recharge-amount-option {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #2f3148;
  font-weight: 850;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.pay-method {
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  line-height: 1.15;
  white-space: normal;
}

.pay-method em {
  color: inherit;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  opacity: 0.75;
}

.pay-method.active,
.recharge-amount-option.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(8, 127, 140, 0.2);
}

.pay-method-link {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(8, 127, 140, 0.2);
}

.pay-method-link:hover {
  background: var(--primary-dark);
}

.pay-method:disabled {
  background: #f8fafc;
  color: #98a2b3;
}

.recharge-custom-label {
  margin-top: 2px;
  color: #344054;
}

.recharge-input-wrap {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.recharge-input-wrap span {
  min-width: 42px;
  padding: 0 12px;
  color: #475467;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.recharge-input-wrap input {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.recharge-input-wrap:focus-within {
  border-color: var(--primary);
  outline: 3px solid rgba(8, 127, 140, 0.13);
}

.recharge-input-wrap input:focus {
  outline: 0;
}

.recharge-submit {
  min-height: 48px;
  margin-top: 2px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(8, 127, 140, 0.2);
}

.recharge-submit:hover {
  background: var(--primary-dark);
}

.recharge-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 20px 0 12px;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}

.recharge-divider::before,
.recharge-divider::after {
  height: 1px;
  background: #e4e7ec;
  content: "";
}

.recharge-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 12px;
}

.recharge-code-row input {
  min-height: 44px;
}

.recharge-code-row button {
  min-height: 44px;
  border: 1px solid #cce2e6;
  border-radius: 8px;
  background: #eef8fa;
  color: var(--primary-dark);
  font-weight: 900;
}

.recharge-history {
  width: 100%;
  padding: 22px;
}

.recharge-record-list {
  display: grid;
  gap: 10px;
}

.recharge-record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #fff;
}

.recharge-record-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.recharge-record-title {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.recharge-record-title span {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
}

.recharge-record-title strong {
  min-width: 0;
  color: #101828;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.recharge-record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: #667085;
  font-size: 12px;
}

.recharge-record-side {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 116px;
}

.recharge-record-side > strong {
  color: #101828;
  font-size: 18px;
  font-weight: 900;
}

.mail-split {
  height: calc(100vh - 176px);
}

.mail-body,
.article-body,
.rich-editor,
.prebox {
  border-color: #d0d5dd;
  border-radius: 9px;
  background: #fcfcfd;
}

.rich-editor {
  min-height: 340px;
}

.editor-toolbar {
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
  background: #f8fafc;
}

.article-row {
  border-color: #e4e7ec;
  border-radius: 9px;
}

.article-row:hover {
  background: #f4fbfc;
}

.plan-card {
  text-align: left;
}

.plan-card:hover {
  border-color: #b9e1e7;
  box-shadow: 0 16px 34px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.plan-card.selected {
  border-color: var(--primary);
  background: #f4fbfc;
  outline: 3px solid rgba(8, 127, 140, 0.12);
}

.chip {
  border: 1px solid #e4e7ec;
  background: #f8fafc;
  color: #344054;
}

.price {
  color: var(--primary-dark);
}

.empty-state {
  padding: 38px;
}

.toast {
  z-index: 80;
  border-radius: 9px;
  background: #101828;
}

.row-actions,
.toolbar,
.inline-fields,
.editor-toolbar {
  row-gap: 8px;
}

/* User-facing CLI theme */
body[data-app="user"] {
  --bg: #050b0f;
  --surface: #0b1418;
  --surface-soft: #101d22;
  --text: #d9fce9;
  --muted: #82a99b;
  --line: #21413a;
  --primary: #29f29a;
  --primary-dark: #11c978;
  --accent: #f2c94c;
  --danger: #ff6b6b;
  --ok: #42f58d;
  --info: #5cc8ff;
  background: #050b0f;
  color: var(--text);
  font-family: "Cascadia Mono", Consolas, "SFMono-Regular", "Microsoft YaHei", monospace;
}

body[data-app="user"]::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(41, 242, 154, 0.08), rgba(5, 11, 15, 0) 260px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 24px),
    #050b0f;
  content: "";
}

body[data-app="user"] .layout {
  grid-template-columns: 272px minmax(0, 1fr);
}

body[data-app="user"] .sidebar {
  border-right: 1px solid #1d3b34;
  background: rgba(6, 13, 16, 0.96);
  box-shadow: inset -1px 0 0 rgba(41, 242, 154, 0.12);
  backdrop-filter: blur(8px);
}

body[data-app="user"] .sidebar-head {
  border-bottom-color: #1d3b34;
}

body[data-app="user"] .brand-mark {
  border: 1px solid rgba(41, 242, 154, 0.58);
  background: #07150f;
  color: var(--primary);
  box-shadow: 0 0 0 1px rgba(41, 242, 154, 0.08), 0 0 24px rgba(41, 242, 154, 0.22);
  text-shadow: 0 0 14px rgba(41, 242, 154, 0.7);
}

body[data-app="user"] .sidebar-head strong,
body[data-app="user"] h1,
body[data-app="user"] h2,
body[data-app="user"] h3 {
  color: var(--text);
}

body[data-app="user"] .sidebar-head span,
body[data-app="user"] p,
body[data-app="user"] .muted {
  color: var(--muted);
}

body[data-app="user"] .menu {
  gap: 6px;
}

body[data-app="user"] .menu-item {
  border-color: #17312c;
  background: #071116;
  color: #b6ead2;
  font-weight: 800;
}

body[data-app="user"] .menu-item::before {
  color: var(--primary);
  content: "$";
}

body[data-app="user"] .menu-item i {
  color: #49d996;
}

body[data-app="user"] .menu-item:hover,
body[data-app="user"] .menu-item.active {
  border-color: rgba(41, 242, 154, 0.72);
  background: #0e2019;
  color: #f1fff8;
  box-shadow: inset 3px 0 0 var(--primary), 0 0 18px rgba(41, 242, 154, 0.12);
}

body[data-app="user"] .workspace {
  padding: 28px 32px 40px;
}

body[data-app="user"] .topbar {
  position: relative;
  min-height: 96px;
  padding: 36px 18px 16px;
  border-color: #21413a;
  background: rgba(8, 18, 22, 0.92);
  box-shadow: 0 0 0 1px rgba(41, 242, 154, 0.05), 0 18px 46px rgba(0, 0, 0, 0.32);
}

body[data-app="user"] .topbar::before {
  position: absolute;
  top: 12px;
  left: 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  content: "root@lumaodashi:~$ ./dashboard";
}

body[data-app="user"] .panel,
body[data-app="user"] .table-wrap,
body[data-app="user"] .stat,
body[data-app="user"] .empty-state,
body[data-app="user"] .plan-card,
body[data-app="user"] .server-card,
body[data-app="user"] .recharge-card,
body[data-app="user"] .recharge-balance,
body[data-app="user"] .recharge-record-card,
body[data-app="user"] .qa-item {
  border-color: #21413a;
  background: rgba(8, 18, 22, 0.93);
  box-shadow: 0 0 0 1px rgba(41, 242, 154, 0.045), 0 16px 40px rgba(0, 0, 0, 0.26);
}

body[data-app="user"] .panel-head {
  border-bottom: 1px dashed #24483f;
  padding-bottom: 12px;
}

body[data-app="user"] .panel-head h3::before {
  color: var(--primary);
  content: "> ";
}

body[data-app="user"] .article-row,
body[data-app="user"] .server-network,
body[data-app="user"] .server-info-grid > div,
body[data-app="user"] .email-request-empty,
body[data-app="user"] .qa-reply,
body[data-app="user"] .article-body,
body[data-app="user"] .recharge-amount-option,
body[data-app="user"] .recharge-input-wrap,
body[data-app="user"] .payment-method-grid .pay-method {
  border-color: #1f3d36;
  background: #071116;
  color: var(--text);
}

body[data-app="user"] .article-row strong,
body[data-app="user"] .server-card-title h3,
body[data-app="user"] .server-info-grid strong,
body[data-app="user"] .server-network strong,
body[data-app="user"] .recharge-record-title strong,
body[data-app="user"] .qa-question strong,
body[data-app="user"] .qa-reply strong {
  color: #effff6;
}

body[data-app="user"] .article-row em,
body[data-app="user"] .server-info-grid span,
body[data-app="user"] .server-card-title p,
body[data-app="user"] .server-network span,
body[data-app="user"] .recharge-record-meta,
body[data-app="user"] .qa-question span,
body[data-app="user"] .qa-reply span {
  color: var(--muted);
}

body[data-app="user"] .article-row:hover,
body[data-app="user"] .plan-card:hover,
body[data-app="user"] .server-card:hover {
  border-color: rgba(41, 242, 154, 0.7);
  background: #0d1d18;
  box-shadow: 0 0 24px rgba(41, 242, 154, 0.12);
}

body[data-app="user"] .plan-card.selected,
body[data-app="user"] .recharge-amount-option.active,
body[data-app="user"] .pay-method.active {
  border-color: var(--primary);
  background: #0e2019;
  outline: 2px solid rgba(41, 242, 154, 0.16);
}

body[data-app="user"] .chip,
body[data-app="user"] .status {
  border: 1px solid #255148;
  background: #061510;
  color: #b8f7d6;
}

body[data-app="user"] .price,
body[data-app="user"] .recharge-balance strong,
body[data-app="user"] .recharge-record-side > strong {
  color: var(--primary);
  text-shadow: 0 0 16px rgba(41, 242, 154, 0.25);
}

body[data-app="user"] input,
body[data-app="user"] select,
body[data-app="user"] textarea {
  border-color: #23453e;
  background: #050d11;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(41, 242, 154, 0.025);
}

body[data-app="user"] input::placeholder,
body[data-app="user"] textarea::placeholder {
  color: #5f8174;
}

body[data-app="user"] input:focus,
body[data-app="user"] select:focus,
body[data-app="user"] textarea:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(41, 242, 154, 0.2);
}

body[data-app="user"] .primary,
body[data-app="user"] .secondary,
body[data-app="user"] .small-btn,
body[data-app="user"] .danger {
  border-color: #285248;
  background: #081418;
  color: #d9fce9;
  box-shadow: none;
  text-transform: none;
}

body[data-app="user"] .primary {
  border-color: var(--primary);
  background: #0f2b1d;
  color: #f5fff9;
}

body[data-app="user"] .secondary:hover,
body[data-app="user"] .small-btn:hover,
body[data-app="user"] .primary:hover {
  border-color: var(--primary);
  background: #12281f;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(41, 242, 154, 0.14);
}

body[data-app="user"] .danger {
  border-color: rgba(255, 107, 107, 0.55);
  background: #211010;
  color: #ffb4b4;
}

body[data-app="user"] .link-button,
body[data-app="user"] .ghost-link {
  color: var(--primary);
}

body[data-app="user"] .auth-panel {
  border-color: #21413a;
  background: rgba(8, 18, 22, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

body[data-app="user"] .tab-row {
  border-color: #1f3d36;
  background: #071116;
}

body[data-app="user"] .tab.active {
  background: #0e2019;
  color: var(--primary);
}

body[data-app="user"] .toast,
body[data-app="user"] .hover-tooltip {
  border: 1px solid #285248;
  background: #071116;
  color: var(--text);
}

@media (max-width: 1400px) {
  .server-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .layout,
  body[data-app="admin"] .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }

  .menu {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .recharge-shell {
    width: 100%;
  }

  .server-card-grid {
    grid-template-columns: 1fr;
  }

  .admin-vm-grid {
    grid-template-columns: 1fr;
  }

  .payment-method-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .server-info-grid,
  .server-actions,
  .admin-vm-info,
  .admin-vm-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .order-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .order-table,
  .order-table thead,
  .order-table tbody,
  .order-table tr,
  .order-table td {
    display: block;
    width: 100%;
  }

  .order-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
  }

  .order-table colgroup,
  .order-table thead {
    display: none;
  }

  .order-table tbody {
    display: grid;
    gap: 12px;
  }

  .order-table tr {
    overflow: hidden;
    border: 1px solid rgba(228, 231, 236, 0.95);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.055);
  }

  .order-table td {
    display: grid;
    grid-template-columns: clamp(72px, 24%, 118px) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 42px;
    padding: 10px 14px;
    border-bottom: 1px solid #eef0f3;
  }

  .order-table td::before {
    color: #667085;
    font-size: 12px;
    font-weight: 850;
    content: attr(data-label);
  }

  .order-table td:last-child {
    border-bottom: 0;
  }

  .order-table .cell-main,
  .order-table .muted {
    white-space: normal;
  }

  .order-table td[data-label="状态"] .status {
    width: fit-content;
  }

  .order-table td[data-label="操作"] {
    align-items: start;
  }

  .order-actions {
    display: flex;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .auth-shell {
    padding: 18px;
  }

  .auth-panel {
    padding: 24px;
  }

  .article-row {
    grid-template-columns: 1fr;
  }

  .order-table td {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .order-table td::before {
    font-size: 11px;
  }

  .order-actions .small-btn,
  .order-actions .danger {
    flex-basis: 100%;
    width: 100%;
  }

  .recharge-card {
    padding: 20px;
  }

  .recharge-card-head h3 {
    font-size: 20px;
  }

  .recharge-code-row {
    grid-template-columns: 1fr;
  }

  table {
    min-width: 680px;
  }

  .order-table {
    min-width: 0;
  }
}
