:root {
  color-scheme: light;
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e4e8f0;
  --border-light: #eef1f6;
  --text: #111827;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-muted: #c7d2fe;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --sidebar-w: 248px;
  --header-h: 72px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 4px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

.server-offline {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
}

.server-offline.hidden { display: none; }

.server-offline strong { white-space: nowrap; }

.server-offline button {
  margin-left: auto;
  border: 1px solid #fdba74;
  background: #fff;
  color: #9a3412;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

.server-offline button:hover { background: #ffedd5; }

button, input, textarea, select { font: inherit; }
a { color: var(--primary); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--text-secondary); }
.hint { color: var(--text-tertiary); font-size: 13px; }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(79, 70, 229, .25); }
.btn-danger {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--red);
  color: #fff;
}
.btn-danger:hover { background: #b91c1c; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-secondary:hover { background: var(--surface-2); border-color: #cbd5e1; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.btn-ghost:hover { color: var(--text); border-color: #cbd5e1; background: var(--surface-2); }
.btn-ghost svg { width: 16px; height: 16px; }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--primary-hover); }

/* ── Login ── */
.login {
  min-height: 100vh;
  background: var(--bg);
}
.login-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: linear-gradient(145deg, #312e81 0%, #4f46e5 45%, #6366f1 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.08) 0%, transparent 40%);
}
.login-hero-inner { position: relative; max-width: 360px; }
.login-logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 24px;
}
.login-hero h2 { margin: 0 0 8px; font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.login-hero > .login-hero-inner > p { margin: 0 0 32px; opacity: .85; font-size: 15px; }
.login-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.login-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  opacity: .9;
}
.login-features li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a5b4fc;
  flex-shrink: 0;
}
.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--surface);
}
.login-card { width: min(380px, 100%); }
.login-card h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.login-desc { margin: 0 0 28px; color: var(--text-secondary); }
.login-card .btn-primary { width: 100%; margin-top: 8px; padding: 12px; }
.form-msg { margin: 4px 0 0; font-size: 13px; color: var(--red); min-height: 20px; line-height: 1.5; }
.form-msg.ok { color: var(--green); }
.form-msg.warn { color: var(--amber); }

/* ── Shell ── */
.shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
}
.brand-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .3);
}
.brand-text strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { display: block; margin-top: 1px; color: var(--text-tertiary); font-size: 11px; }

.sidebar-section { padding: 0 10px; margin-bottom: 4px; }
.section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s;
}
.section-toggle:hover { color: var(--text-secondary); }
.section-toggle .chevron {
  width: 14px;
  height: 14px;
  transition: transform .2s;
  opacity: .5;
}
.sidebar-section.open .section-toggle .chevron { transform: rotate(90deg); }
.sidebar-section:not(.open) .nav-list { display: none; }

.nav-list { display: grid; gap: 2px; padding-bottom: 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: all .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .7; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--primary);
}
.nav-item.active svg { opacity: 1; stroke: var(--primary); }

.sidebar-footer {
  margin-top: auto;
  padding: 16px 18px;
  border-top: 1px solid var(--border-light);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── Workspace ── */
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-titles h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.header-titles p {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.header-actions { display: flex; gap: 8px; }

.content {
  flex: 1;
  padding: 24px 28px 40px;
  overflow-x: auto;
}
.page { animation: fadeIn .25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-head {
  padding: 18px 20px 0;
}
.card-head.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 0;
}
.card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.card-head p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.table-card .card-head { padding-bottom: 4px; }
.table-card > [id$="Table"] { padding: 0 4px 4px; }

/* ── Stats ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat-grid.compact { margin-bottom: 16px; }
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-card span { display: block; color: var(--text-secondary); font-size: 12px; font-weight: 550; margin-bottom: 4px; }
.stat-card b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }

.accent-blue .stat-icon { background: var(--primary-soft); color: var(--primary); }
.accent-green .stat-icon { background: var(--green-soft); color: var(--green); }
.accent-purple .stat-icon { background: var(--purple-soft); color: var(--purple); }
.accent-amber .stat-icon { background: var(--amber-soft); color: var(--amber); }

/* ── Forms ── */
.field {
  display: grid;
  gap: 6px;
}
.field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary-muted);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px 20px 20px;
}
.full { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 16px 20px 0;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.tabs.two { max-width: 320px; }
.tab {
  flex: 1;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ── Tables ── */
.table-shell {
  overflow-x: auto;
  overflow-y: visible;
  margin: 8px 12px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  max-width: calc(100vw - var(--sidebar-w) - 80px);
}
table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}
table.table-apps { min-width: 1540px; }
table.table-accounts { min-width: 1380px; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}
th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: middle;
}
th {
  background: var(--surface-2);
  color: var(--text-secondary);
  font-weight: 650;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }

.empty-row td {
  padding: 48px 16px !important;
  text-align: center !important;
  color: var(--text-tertiary);
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state svg { width: 40px; height: 40px; color: var(--text-tertiary); opacity: .5; }
.empty-state span { font-size: 14px; }
.empty-state small { font-size: 12px; color: var(--text-tertiary); }

.app-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}
.app-cell b { display: block; font-size: 14px; font-weight: 650; color: var(--text); }
.app-cell span { display: block; margin-top: 2px; color: var(--text-tertiary); font-size: 12px; font-family: ui-monospace, monospace; }
.icon-cell {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--primary-soft);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.version-badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  font-family: ui-monospace, monospace;
}
.download-stat b { display: block; font-size: 15px; font-weight: 700; }
.download-stat span { color: var(--text-tertiary); font-size: 11px; }

.pill, .status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.pill + .pill, .pill + br + .pill { margin-top: 4px; }
.pill.ok, .status.done { background: var(--green-soft); color: var(--green); }
.pill.warn, .status.running, .status.queued { background: var(--amber-soft); color: var(--amber); }
.pill.bad, .status.failed { background: var(--red-soft); color: var(--red); }
.pill.neutral { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }

.action-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s;
}
.action-btn:hover { background: var(--primary-soft); text-decoration: none; }
.action-btn.danger { color: var(--red); }
.action-btn.danger:hover { background: var(--red-soft); }
.action-btn.solid {
  padding: 5px 10px;
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #fecaca;
}
.action-btn.solid:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

th.col-actions,
td.col-actions {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 188px;
  max-width: 188px;
  text-align: right;
  white-space: nowrap;
  background: var(--surface);
  box-shadow: -10px 0 16px rgba(15, 23, 42, .05);
}
th.col-actions {
  z-index: 4;
  background: var(--surface-2);
}
tbody tr:hover td.col-actions { background: #fafbff; }
table.table-accounts th.col-actions,
table.table-accounts td.col-actions {
  min-width: 360px;
  max-width: 360px;
}
table.table-accounts .action-group {
  flex-wrap: wrap;
  row-gap: 4px;
}

/* ── Upload ── */
.upload-card { padding-bottom: 20px; }
.drop-zone {
  margin: 16px 20px 0;
  padding: 48px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fafbff 0%, var(--surface) 100%);
  text-align: center;
  transition: all .2s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--primary-muted);
  background: var(--primary-soft);
}
.drop-zone.dragging { border-style: solid; }
.drop-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}
.drop-icon svg { width: 32px; height: 32px; }
.drop-title { margin: 0 0 6px; font-size: 15px; font-weight: 650; color: var(--text); }
.drop-sub { margin: 0; font-size: 13px; color: var(--text-secondary); }
.upload-hint { margin: 12px 20px 0; }
.upload-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px 0;
}
.upload-list {
  display: grid;
  gap: 8px;
  padding: 16px 20px 0;
}
.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.upload-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 550;
}
.upload-row b { font-size: 12px; font-weight: 650; white-space: nowrap; color: var(--amber); }
.upload-row b.ok { color: var(--green); }
.upload-row b.bad { color: var(--red); }

/* ── Download page (mobile) ── */
.download {
  min-height: 100vh;
  padding: 24px 16px 40px;
  background:
    radial-gradient(circle at top, rgba(79, 70, 229, 0.12), transparent 42%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}
.download-page {
  max-width: 440px;
  margin: 0 auto;
}
.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.download-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.download-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
}
.download-meta h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}
.download-version {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}
.download-state {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--text-secondary);
}
.download-state.ok { color: var(--green); }
.download-state.bad { color: var(--red); }
.download-state.warn { color: var(--amber); }
.download-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
  cursor: pointer;
}
.download-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.download-detail {
  min-height: 20px;
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.download-steps {
  display: grid;
  gap: 10px;
  margin: 22px 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.download-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
}
.download-step span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.download-step p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.download-share label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.download-share-row {
  display: flex;
  gap: 8px;
}
.download-share-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  background: var(--bg);
}
.download-share-row button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 13px;
  cursor: pointer;
}
.download-share small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
}
.download-share small a { color: var(--text-secondary); }

.download-alt {
  padding: 0;
  background:
    linear-gradient(180deg, #111827 0%, #1f2937 34%, #f3f4f6 34%, #f3f4f6 100%);
}
.download-alt .download-page {
  max-width: 480px;
  min-height: 100vh;
  padding: 22px 16px 36px;
}
.download-alt .download-page::before {
  content: "Super Sign";
  display: block;
  margin: 0 0 22px;
  color: rgba(255,255,255,.88);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.download-alt .download-card {
  border: 0;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
}
.download-alt .download-hero {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 0;
  padding: 34px 22px 24px;
  text-align: center;
  background: #fff;
}
.download-alt .download-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
}
.download-alt .download-meta h1 {
  max-width: 360px;
  font-size: 25px;
}
.download-alt .download-version {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 12px;
}
.download-alt .download-state {
  margin: 0;
  padding: 18px 22px 8px;
  background: #fff;
}
.download-alt .download-btn {
  display: block;
  width: calc(100% - 44px);
  margin: 8px 22px 0;
  border-radius: 999px;
  background: #111827;
  box-shadow: 0 10px 25px rgba(17, 24, 39, .22);
}
.download-alt .download-detail {
  margin: 0;
  padding: 12px 22px 18px;
  background: #fff;
}
.download-alt .download-steps {
  margin: 0;
  padding: 18px 22px;
  border-top: 1px solid var(--border-light);
  background: #f8fafc;
}
.download-alt .download-step {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.download-alt .download-step:last-child { border-bottom: 0; }
.download-alt .download-step span {
  background: #111827;
  color: #fff;
}
.download-alt .download-share {
  padding: 20px 22px 24px;
  background: #fff;
}
.download-alt .download-share-row input {
  background: #f8fafc;
}
.download-alt .download-share-row button {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

/* ── Download template 2: App Store style ── */
.store-download {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: #f5f5f7;
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", sans-serif;
}
.store-page {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 22px 18px 34px;
}
.store-app {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px 0 22px;
  border-bottom: 1px solid rgba(60, 60, 67, .18);
}
.store-icon {
  width: 118px;
  height: 118px;
  border-radius: 25px;
  object-fit: cover;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
}
.store-info h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 700;
  word-break: break-word;
}
.store-info p {
  margin: 6px 0 14px;
  color: #6e6e73;
  font-size: 14px;
}
.store-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.store-install {
  min-width: 90px;
  height: 34px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #007aff;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.store-install:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.store-copy {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 122, 255, .1);
  color: #007aff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.store-state {
  min-height: 22px;
  margin: 16px 0 4px;
  color: #6e6e73;
  text-align: center;
  font-size: 14px;
  font-weight: 650;
}
.store-state.ok { color: #248a3d; }
.store-state.warn { color: #b26a00; }
.store-state.bad { color: #d70015; }
.store-detail {
  min-height: 22px;
  margin: 0 0 18px;
  color: #86868b;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}
.store-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 16px 0;
  border-top: 1px solid rgba(60, 60, 67, .18);
  border-bottom: 1px solid rgba(60, 60, 67, .18);
}
.store-metrics div {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 52px;
  border-right: 1px solid rgba(60, 60, 67, .18);
}
.store-metrics div:last-child { border-right: 0; }
.store-metrics strong {
  font-size: 21px;
  line-height: 1;
  color: #1d1d1f;
}
.store-metrics span {
  color: #86868b;
  font-size: 12px;
}
.store-panel {
  padding: 22px 0;
  border-bottom: 1px solid rgba(60, 60, 67, .18);
}
.store-panel h2 {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.2;
}
.store-panel p {
  margin: 0;
  color: #3c3c43;
  font-size: 15px;
  line-height: 1.55;
}
.store-alert {
  margin-top: 18px;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: #fff3cd;
}
.store-alert b {
  display: block;
  margin-bottom: 6px;
  color: #6b4f00;
}
.store-alert p {
  color: #7a5d00;
  font-size: 14px;
}
.store-rating {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  align-items: center;
}
.store-rating strong {
  display: block;
  font-size: 44px;
  line-height: 1;
}
.store-rating span {
  color: #86868b;
  font-size: 12px;
}
.store-bars {
  display: grid;
  gap: 7px;
}
.store-bars i {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: #8e8e93;
}
.store-meta {
  margin: 0;
}
.store-meta div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(60, 60, 67, .12);
}
.store-meta div:last-child { border-bottom: 0; }
.store-meta dt {
  color: #86868b;
  font-size: 14px;
}
.store-meta dd {
  margin: 0;
  color: #1d1d1f;
  font-size: 14px;
  text-align: right;
  word-break: break-all;
}
.store-share input {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, .18);
  border-radius: 10px;
  background: #fff;
  color: #3c3c43;
  font-size: 12px;
}
.store-share a {
  color: #007aff;
  font-weight: 650;
}
.store-disclaimer {
  padding: 20px 0 0;
  color: #86868b;
  font-size: 12px;
  line-height: 1.5;
}
.store-pc {
  display: none;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}
.store-pc img {
  width: 92px;
  height: 92px;
  border-radius: 20px;
}
.store-pc h2 {
  margin: 0;
  font-size: 24px;
}
.store-pc p {
  margin: 0;
  color: #6e6e73;
}
.store-pc input {
  width: min(520px, 100%);
  padding: 12px;
  border: 1px solid rgba(60, 60, 67, .18);
  border-radius: 10px;
  text-align: center;
}
@media (min-width: 760px) {
  .store-download {
    background:
      linear-gradient(90deg, #e5e7eb 0, #f5f5f7 18%, #f5f5f7 82%, #e5e7eb 100%);
  }
  .store-download .store-page {
    min-height: 100vh;
    padding-top: 42px;
    padding-bottom: 56px;
  }
  .store-download .store-pc { display: none; }
}
@media (max-width: 380px) {
  .store-app {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .store-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
  }
  .store-actions {
    flex-wrap: wrap;
  }
}
.distribution-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.distribution-link a {
  color: var(--primary);
  word-break: break-all;
}
.upload-result {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--green-soft);
  border: 1px solid rgba(5, 150, 105, 0.15);
  font-size: 13px;
  line-height: 1.6;
}
.upload-result.hidden { display: none; }
.upload-result a { color: var(--primary); word-break: break-all; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .login-panel { grid-template-columns: 1fr; }
  .login-hero { min-height: 240px; padding: 32px; }
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-footer { display: none; }
  .header { padding: 0 16px; height: auto; min-height: 64px; }
  .content { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
}

.modal-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow);
  margin: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}
.modal-dialog:not([open]) {
  display: none;
}
.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.modal-card {
  padding: 24px;
  display: grid;
  gap: 12px;
}
.modal-card h3 {
  margin: 0;
  font-size: 18px;
}

.toast-host {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-ok { background: #166534; }
.toast-error { background: #991b1b; }
.toast-warn { background: #92400e; }
