/* App Center — shared styles */
:root {
  --bg: #07090f;
  --bg-soft: #0b0e16;
  --panel: #10141e;
  --panel-2: #141927;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e9edf6;
  --muted: #8c95aa;
  --muted-2: #667089;
  --accent: #5eead4;
  --accent-2: #7c9cff;
  --accent-ink: #06110f;
  --danger: #ff6b81;
  --warn: #ffc46b;
  --ok: #57e389;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  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: inherit; text-decoration: none; }
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(94, 234, 212, 0.12), transparent 60%),
    radial-gradient(800px 480px at 88% 0%, rgba(124, 156, 255, 0.14), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(124, 156, 255, 0.06), transparent 60%);
}

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; display: block; }

/* ---------- top bar ---------- */
.topbar,
.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(20px, 5vw, 56px);
  max-width: 1280px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 17px;
}

.topbar-nav { display: flex; align-items: center; gap: 10px; }

.ghost-link {
  color: var(--muted);
  font-size: 13.5px;
  padding: 8px 12px;
  border-radius: 10px;
  transition: color .18s ease, background .18s ease;
}
.ghost-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  transition: transform .15s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7ef0dc 45%, var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 10px 30px rgba(94, 234, 212, 0.18);
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--line-strong); }

.btn-danger-ghost {
  background: rgba(255, 107, 129, 0.08);
  border-color: rgba(255, 107, 129, 0.25);
  color: #ff9aa8;
}
.btn-danger-ghost:hover { background: rgba(255, 107, 129, 0.15); }

.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn-xs { padding: 5px 9px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 17px;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }

/* ---------- storefront ---------- */
.store-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px clamp(20px, 5vw, 56px) 80px;
}

.hero { padding: 48px 0 64px; max-width: 780px; }

.hero-kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 750;
}
.hero h1 span {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0 0 28px;
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
  color: var(--muted-2);
  font-size: 12.5px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(87, 227, 137, 0.12);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }

.apps-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;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.app-card:hover {
  transform: translateY(-3px);
  border-color: rgba(94, 234, 212, 0.28);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.06), rgba(255, 255, 255, 0.02));
}

.app-card-head { display: flex; gap: 14px; align-items: flex-start; }

.app-icon {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.22), rgba(124, 156, 255, 0.26));
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 750;
  font-size: 22px;
  text-transform: uppercase;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-icon-lg { width: 74px; height: 74px; border-radius: 19px; font-size: 28px; }

.app-card-title { min-width: 0; flex: 1; }
.app-card-title h3 {
  margin: 2px 0 3px;
  font-size: 16.5px;
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-card-title code { font-size: 11.5px; color: var(--muted-2); }

.app-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.app-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--mono);
}
.pill-accent { color: var(--accent); border-color: rgba(94, 234, 212, 0.25); background: rgba(94, 234, 212, 0.08); }

.app-card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding-top: 4px;
}
.app-card-actions .btn-primary { flex: 1; }

.notes-toggle {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  padding: 6px 0;
}
.notes-toggle:hover { color: var(--text); }

.app-notes {
  margin: 0;
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.skeleton-card {
  height: 220px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(110deg, rgba(255,255,255,.03) 8%, rgba(255,255,255,.07) 18%, rgba(255,255,255,.03) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position-x: -200%; } }

.empty-inline {
  grid-column: 1 / -1;
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px clamp(20px, 5vw, 56px) 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
  color: var(--muted-2);
}

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}
.field textarea { resize: vertical; min-height: 80px; }
.field small { color: var(--muted-2); font-size: 11.5px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 13.5px;
  color: var(--muted);
}
.check-row input { accent-color: var(--accent); width: 16px; height: 16px; }

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 107, 129, 0.1);
  border: 1px solid rgba(255, 107, 129, 0.25);
  color: #ff9aa8;
  font-size: 13px;
}

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 390px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.login-card img { align-self: flex-start; }
.login-card h1 { margin: 4px 0 0; font-size: 25px; letter-spacing: -0.03em; }
.login-card p { margin: 0; }
.login-card .btn { margin-top: 4px; }

/* ---------- admin dashboard ---------- */
.dash-view { min-height: 100vh; display: flex; flex-direction: column; }
.dash-topbar { width: 100%; max-width: none; border-bottom: 1px solid var(--line); }
.dash-topbar-actions { display: flex; align-items: center; gap: 8px; }

.dash-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 36px) 50px;
  gap: 26px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat {
  padding: 10px 8px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  text-align: center;
}
.stat strong { display: block; font-size: 18px; letter-spacing: -0.02em; }
.stat span { font-size: 10.5px; color: var(--muted-2); }

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 4px;
}

.app-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; }
.app-list-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  transition: background .15s ease, border-color .15s ease;
}
.app-list-item:hover { background: rgba(255, 255, 255, 0.045); }
.app-list-item.active { background: rgba(94, 234, 212, 0.08); border-color: rgba(94, 234, 212, 0.22); }
.app-list-item .app-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 15px; }
.app-list-text { min-width: 0; flex: 1; }
.app-list-text strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-list-text span { display: block; font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-hint { margin: 0; font-size: 11.5px; line-height: 1.5; }

.dash-main { min-width: 0; }

.empty-state {
  padding: 90px 30px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: radial-gradient(600px 200px at 50% 0%, rgba(94, 234, 212, 0.05), transparent);
}
.empty-mark {
  width: 70px; height: 70px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.empty-state h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; }
.empty-state p { max-width: 440px; margin: 0 auto 22px; }

.app-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.app-header-text { flex: 1; min-width: 0; }
.app-header-text h1 { margin: 0 0 2px; font-size: 25px; letter-spacing: -0.03em; }
.app-header-text code { font-size: 12px; color: var(--muted-2); }
.app-header-text p { margin: 6px 0 0; font-size: 13px; }

.api-box {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
}
.api-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.api-box code { display: block; font-size: 12px; color: var(--accent); word-break: break-all; }
.api-box .small { margin: 8px 0 0; }

.app-edit-form {
  margin: 16px 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}
.form-actions { display: flex; gap: 9px; }

.releases-head { margin-top: 26px; }
.releases-hint { margin: -10px 0 16px; }

.release-list { display: flex; flex-direction: column; gap: 12px; }

.release-card {
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
}
.release-card.is-latest { border-color: rgba(94, 234, 212, 0.22); background: rgba(94, 234, 212, 0.035); }

.release-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.release-version {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.release-top .spacer { flex: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  border: 1px solid transparent;
}
.badge-latest { background: rgba(94, 234, 212, 0.12); color: var(--accent); border-color: rgba(94, 234, 212, 0.25); }
.badge-force { background: rgba(255, 196, 107, 0.12); color: var(--warn); border-color: rgba(255, 196, 107, 0.28); }
.badge-beta { background: rgba(124, 156, 255, 0.12); color: var(--accent-2); border-color: rgba(124, 156, 255, 0.28); }

.release-notes {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted-2);
  font-family: var(--mono);
}
.release-meta code { color: var(--muted); }

.release-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.release-actions .spacer { flex: 1; }

.release-edit-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 5, 10, 0.72); backdrop-filter: blur(6px); }
.modal-card {
  position: relative;
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.modal-head p { margin: 2px 0 0; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 20px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  transition: border-color .18s ease, background .18s ease;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.dragover { border-color: rgba(94, 234, 212, 0.55); background: rgba(94, 234, 212, 0.05); }
.dropzone-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(94, 234, 212, 0.1);
  border: 1px solid rgba(94, 234, 212, 0.22);
  color: var(--accent);
  font-size: 19px;
  margin-bottom: 4px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  background: rgba(94, 234, 212, 0.05);
  font-size: 12.5px;
}
.file-info .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.progress-wrap { display: flex; flex-direction: column; gap: 7px; }
.progress { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .2s ease;
}
.progress-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 2px; }

/* ---------- 远程配置 ---------- */
.config-head { margin-top: 26px; margin-bottom: 0; }

.config-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}
.config-panel > p { margin: 0; }

.config-editor {
  min-height: 220px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
}

.config-token-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.22);
}
.config-token-box p { margin: 0; }
.config-token-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.config-token-row code {
  flex: 1;
  min-width: 220px;
  font-size: 12px;
  color: var(--accent);
  word-break: break-all;
}
.config-token-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.config-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}
.config-history-head h3 { margin: 0; font-size: 15px; letter-spacing: -0.01em; }

.history-list { display: flex; flex-direction: column; gap: 9px; }
.history-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}
.history-card.is-current { border-color: rgba(94, 234, 212, 0.22); background: rgba(94, 234, 212, 0.035); }
.history-version { font-family: var(--mono); font-size: 13.5px; font-weight: 700; }
.history-card .spacer { flex: 1; }

/* ---------- service updates (admin) ---------- */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}
.mode-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
}
.mode-tab:hover { color: var(--text); }
.mode-tab.active { background: rgba(94, 234, 212, 0.1); color: var(--accent); }
.app-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.release-title { margin: 8px 0 0; font-size: 15px; letter-spacing: -0.01em; }
.service-curl { white-space: pre-wrap; line-height: 1.55; }
.service-update-form { display: flex; flex-direction: column; gap: 12px; }

/* ---------- API services / docs ---------- */
.apis-section { margin-top: 56px; }
.service-base-url {
  display: block;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 11.5px;
  color: var(--muted);
  word-break: break-all;
}
.doc-main { padding-top: 34px; max-width: 1000px; }
.doc-header {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 20, 30, 0.72);
}
.doc-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.doc-header h1 {
  margin: 10px 0 6px;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.03em;
}
.doc-header > p { margin: 0; }
.doc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 18px; }
.doc-base-box { margin: 0; }
.doc-overview {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(16, 20, 30, 0.72);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}
#doc-overview-section,
#doc-endpoints-section,
#doc-updates-section { margin-top: 40px; }
.endpoint-list { display: flex; flex-direction: column; gap: 16px; }
.endpoint-card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 20, 30, 0.72);
}
.endpoint-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.endpoint-head .spacer { flex: 1; }
.method {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  letter-spacing: 0.02em;
}
.m-get { color: #7cc7ff; border-color: rgba(124, 199, 255, 0.35); background: rgba(124, 199, 255, 0.1); }
.m-post { color: var(--accent); border-color: rgba(94, 234, 212, 0.35); background: rgba(94, 234, 212, 0.1); }
.m-put { color: var(--warn); border-color: rgba(255, 196, 107, 0.35); background: rgba(255, 196, 107, 0.1); }
.m-patch { color: #d9a6ff; border-color: rgba(217, 166, 255, 0.35); background: rgba(217, 166, 255, 0.1); }
.m-delete { color: var(--danger); border-color: rgba(255, 107, 129, 0.35); background: rgba(255, 107, 129, 0.1); }
.endpoint-path { font-size: 13px; color: var(--text); word-break: break-all; }
.endpoint-card h3 { margin: 12px 0 0; font-size: 18px; letter-spacing: -0.01em; }
.endpoint-summary { margin: 7px 0 0; color: var(--muted); font-size: 13.5px; white-space: pre-wrap; }
.endpoint-params-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.endpoint-params { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.endpoint-params th,
.endpoint-params td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.endpoint-params th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}
.endpoint-params tr:last-child td { border-bottom: 0; }
.endpoint-params code { color: var(--accent); }
.param-required { color: var(--warn); font-weight: 600; }
.param-example {
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 11.5px;
  word-break: break-word;
}
.code-block { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px 7px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.code-block pre {
  margin: 0;
  padding: 13px 14px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.endpoint-notes {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 2px solid rgba(255, 196, 107, 0.5);
  background: rgba(255, 196, 107, 0.04);
  border-radius: 0 9px 9px 0;
}
.endpoint-notes strong { display: block; font-size: 12px; color: var(--warn); margin-bottom: 5px; }
.endpoint-notes pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}
@media (max-width: 640px) {
  .doc-header { padding: 18px; }
  .endpoint-card { padding: 16px; }
  .endpoint-head .spacer { display: none; }
}

/* ---------- service updates (public) ---------- */
.services-section { margin-top: 56px; }
.service-feed { display: flex; flex-direction: column; gap: 12px; }
.update-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 20, 30, 0.72);
}
.update-card:hover { border-color: var(--line-strong); }
.update-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.update-type {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.type-feature { color: var(--accent); border-color: rgba(94, 234, 212, 0.3); background: rgba(94, 234, 212, 0.08); }
.type-fix { color: var(--accent-2); border-color: rgba(124, 156, 255, 0.3); background: rgba(124, 156, 255, 0.08); }
.type-breaking { color: var(--danger); border-color: rgba(255, 107, 129, 0.32); background: rgba(255, 107, 129, 0.08); }
.type-maintenance { color: var(--warn); border-color: rgba(255, 196, 107, 0.3); background: rgba(255, 196, 107, 0.08); }
.type-notice { color: var(--muted); }
.update-service { font-size: 12.5px; color: var(--muted); }
.update-version { font-size: 11px; }
.update-time { margin-left: auto; }
.update-card h3 { margin: 9px 0 0; font-size: 16px; letter-spacing: -0.01em; }
.update-body {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 100;
  max-width: min(90vw, 520px);
  padding: 11px 16px;
  border-radius: 12px;
  background: #1b2130;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255, 107, 129, 0.4); color: #ffb3bd; }
.toast.ok { border-color: rgba(94, 234, 212, 0.35); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .dash-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .app-list { max-height: 240px; }
}

@media (max-width: 640px) {
  .hero { padding: 30px 0 44px; }
  .hero h1 { font-size: 42px; }
  .apps-grid { grid-template-columns: 1fr; }
  .app-card { padding: 17px; }
  .app-header { flex-wrap: wrap; padding: 18px; }
  .app-header-text { flex-basis: calc(100% - 110px); }
  .app-header .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
  .dash-topbar { padding: 14px 16px; }
  .topbar { padding: 14px 16px; }
  .modal-card { padding: 19px; }
  .release-top .spacer { display: none; }
}
