/* 对齐梦织机 Admin：slate-950 + indigo 控制台 */
:root {
  --bg: #020617;
  --panel: rgba(30, 41, 59, 0.5);
  --panel-solid: #0f172a;
  --card: rgba(30, 41, 59, 0.4);
  --line: rgba(51, 65, 85, 0.55);
  --line-strong: rgba(71, 85, 105, 0.6);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --dim: #64748b;
  --white: #fff;
  --indigo: #6366f1;
  --indigo-hover: #4f46e5;
  --indigo-soft: rgba(99, 102, 241, 0.2);
  --indigo-border: rgba(99, 102, 241, 0.35);
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --radius: 12px;
  --radius-lg: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(99, 102, 241, 0.3); }

.admin-shell { min-height: 100vh; }

/* —— 登录门 —— */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(99, 102, 241, 0.18), transparent 55%),
    var(--bg);
}
.gate-card {
  width: 100%;
  max-width: 24rem;
  background: var(--panel-solid);
  border: 1px solid #1e293b;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
  padding: 2rem;
  animation: rise 0.45s ease both;
}
.gate-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--indigo-border);
  background: var(--indigo-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
}
.gate-icon svg { width: 1.5rem; height: 1.5rem; }
.gate h1 {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}
.gate > .gate-card > p,
.gate-card > p {
  margin: 0 0 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}
.gate form { display: grid; gap: 1rem; }
.gate input {
  width: 100%;
  background: var(--bg);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #e2e8f0;
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gate input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 1px var(--indigo);
}
.gate input::placeholder { color: #64748b; }
.gate-back {
  display: block;
  margin-top: 1.25rem;
  text-align: center;
  color: var(--dim);
  font-size: 0.8rem;
  text-decoration: none;
}
.gate-back:hover { color: var(--muted); }

.verifying {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--muted);
}
.spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--indigo);
  border-top-color: transparent;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

/* —— 主壳 —— */
.app {
  width: 100%;
  min-width: 0;
  padding: 1rem 0.75rem 2.5rem;
  animation: rise 0.4s ease both;
}
@media (min-width: 640px) {
  .app { padding: 1.25rem 1rem 3rem; }
}
@media (min-width: 1024px) {
  .app { padding: 1.25rem 1.25rem 3rem; }
}
@media (min-width: 1280px) {
  .app { padding: 1.5rem 1.5rem 3rem; max-width: 1280px; margin: 0 auto; }
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.app-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}
.app-header h1 span {
  color: #64748b;
  font-weight: 400;
}
.app-header .sub {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--dim);
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  width: fit-content;
  max-width: 100%;
}
a.tab {
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}
.tab {
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--text); background: rgba(51, 65, 85, 0.45); }
.tab.on {
  background: var(--indigo);
  color: var(--white);
}

/* 显示由 HTML [hidden] 控制；勿再写 display:none，否则去掉 hidden 仍空白 */
.panel { animation: fade 0.25s ease both; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.section-head.tight { margin-bottom: 0.75rem; }
.section-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.15rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.card.mt { margin-top: 1.25rem; }
.hint {
  margin: -0.25rem 0 1rem;
  font-size: 0.75rem;
  color: var(--dim);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
}
.stat {
  position: relative;
  overflow: hidden;
  min-height: 7.5rem;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(30, 41, 59, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  transition: border-color 0.2s;
}
.stat:hover { border-color: rgba(100, 116, 139, 0.8); }
.stat .watermark {
  position: absolute;
  right: -0.5rem;
  top: -0.5rem;
  opacity: 0.06;
  pointer-events: none;
  transition: transform 0.45s;
}
.stat:hover .watermark { transform: scale(1.1); }
.stat .watermark svg { width: 5.5rem; height: 5.5rem; }
.stat .label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.stat .label .dot {
  width: 0.85rem;
  height: 0.85rem;
  display: inline-flex;
}
.stat .value {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat .hint-line {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: var(--dim);
}
.tone-indigo .label .dot { color: #818cf8; }
.tone-emerald .label .dot { color: var(--emerald); }
.tone-amber .label .dot { color: var(--amber); }
.tone-sky .label .dot { color: #38bdf8; }
.tone-rose .label .dot { color: var(--rose); }
.tone-slate .label .dot { color: #94a3b8; }

.table-wrap {
  overflow: auto;
  border-radius: 0.75rem;
  border: 1px solid rgba(51, 65, 85, 0.6);
  background: rgba(15, 23, 42, 0.35);
  max-height: min(520px, 60vh);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  white-space: nowrap;
}
thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
}
th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
}
td {
  padding: 0.55rem 0.75rem;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(30, 41, 59, 0.75);
  font-variant-numeric: tabular-nums;
}
tbody tr:hover { background: rgba(30, 41, 59, 0.4); }
tbody tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.7rem; }
.empty { text-align: center; color: var(--dim); padding: 2rem 0.75rem !important; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid;
  font-size: 0.68rem;
  font-weight: 500;
}
.badge-fulfilled {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}
.badge-pending {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
}
.badge-other {
  color: #cbd5e1;
  background: rgba(71, 85, 105, 0.3);
  border-color: rgba(100, 116, 139, 0.6);
}

.inline-search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.inline-search input,
.credit-form input {
  background: var(--bg);
  border: 1px solid #334155;
  border-radius: 0.65rem;
  padding: 0.55rem 0.75rem;
  color: var(--text);
  font: inherit;
  outline: none;
  min-width: 0;
}
.inline-search input { width: min(220px, 48vw); }
.inline-search input:focus,
.credit-form input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 1px var(--indigo);
}

.credit-card { max-width: 28rem; }
.credit-form {
  display: grid;
  gap: 0.85rem;
}
.credit-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.result {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.55);
  overflow: auto;
  font-size: 0.75rem;
  color: #cbd5e1;
}

.btn-indigo, .btn-ghost {
  border: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-indigo {
  width: 100%;
  background: var(--indigo);
  color: var(--white);
  font-weight: 500;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}
.btn-indigo:hover { background: var(--indigo-hover); }
.credit-form .btn-indigo { width: auto; justify-self: start; padding-inline: 1.25rem; }
.btn-ghost {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}
.btn-ghost:hover { background: #334155; }
.btn-ghost.sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }

.linkish {
  background: none;
  border: 0;
  color: #a5b4fc;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  padding: 0;
}
.linkish:hover { color: #c7d2fe; text-decoration: underline; }

.admin-msg {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  text-align: center;
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.admin-msg.ok {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}
.admin-msg.banner {
  text-align: left;
  margin-bottom: 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

[hidden] { display: none !important; }
