/* 许峰声呐AI工作室 · 认证与后台管理样式（延续精密仪器与极简建筑风格） */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-subtle: #f1f3f6;
  --surface-hover: #eaedf2;
  --border: #e2e6ec;
  --border-strong: #cfd6e0;
  --ink: #111827;
  --ink-secondary: #4b5563;
  --ink-muted: #6b7280;
  --primary: #111827;
  --primary-hover: #1f2937;
  --primary-fg: #ffffff;
  --alert: #c8322b;
  --confirm: #15803d;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.09);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 13px; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }

/* 居中认证页容器 */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px 16px;
}
.auth-card {
  width: 100%; max-width: 440px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 32px 30px; box-shadow: var(--shadow-md);
}
.auth-card.wide { max-width: 680px; }
.auth-brand {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; margin-bottom: 24px;
}
.auth-logo { height: 42px; width: auto; display: block; margin-bottom: 12px; object-fit: contain; }
.auth-title { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.auth-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-muted); line-height: 1.55; }

.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-grid-2 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .field > span { font-size: 12px; font-weight: 500; color: var(--ink-secondary); }
.req { color: var(--alert); margin-left: 2px; }
.field input[type="text"],
.field input[type="tel"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 9px 11px; font-size: 13px; font-family: inherit;
  transition: border-color 0.14s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ink);
}
.field textarea { min-height: 76px; resize: vertical; line-height: 1.5; }

.check-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.check-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px; font-size: 12px;
  background: var(--surface-subtle); border: 1px solid var(--border);
  cursor: pointer; color: var(--ink-secondary);
}
.check-pill input { margin: 0; accent-color: var(--ink); }

/* 用户须知与合规声明 */
.terms-box {
  background: var(--surface-subtle); border: 1px solid var(--border);
  border-radius: 7px; padding: 11px 12px; display: flex; flex-direction: column; gap: 8px;
}
.terms-scroll {
  max-height: 112px; overflow-y: auto; font-size: 11.5px; line-height: 1.6;
  color: var(--ink-secondary); padding-right: 4px;
}
.terms-scroll p { margin: 0 0 6px; }
.terms-scroll p:last-child { margin-bottom: 0; }
.terms-agree {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--ink); cursor: pointer;
  padding-top: 6px; border-top: 1px solid var(--border);
}
.terms-agree input { margin-top: 2px; accent-color: var(--ink); }

.btn {
  border: 1px solid transparent; border-radius: 6px; padding: 9px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.14s, border-color 0.14s;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-subtle); }
.btn-ghost { background: transparent; color: var(--ink-secondary); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-subtle); color: var(--ink); }
.btn-danger-ghost { background: transparent; color: var(--alert); border-color: rgba(200, 50, 43, 0.35); }
.btn-danger-ghost:hover:not(:disabled) { background: rgba(200, 50, 43, 0.08); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn-block { width: 100%; }

.alert-box {
  padding: 10px 12px; border-radius: 6px; font-size: 12px; line-height: 1.5;
}
.alert-error { background: rgba(200, 50, 43, 0.08); color: var(--alert); border: 1px solid rgba(200, 50, 43, 0.25); }
.alert-ok { background: rgba(21, 128, 61, 0.08); color: var(--confirm); border: 1px solid rgba(21, 128, 61, 0.25); }
.auth-foot {
  margin-top: 18px; text-align: center; font-size: 11.5px; color: var(--ink-muted); line-height: 1.6;
}

/* 后台管理系统布局 */
.admin-header {
  height: 60px; padding: 0 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.admin-head-left { display: flex; align-items: center; gap: 14px; }
.admin-head-left img { height: 28px; width: auto; }
.admin-tag {
  font-size: 11.5px; font-weight: 600; color: var(--ink-secondary);
  padding: 3px 9px; border-radius: 999px; background: var(--surface-subtle);
  border: 1px solid var(--border);
}
.admin-head-right { display: flex; align-items: center; gap: 8px; }

.admin-main { max-width: 1280px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 820px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px 18px;
}
.stat-label { font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; }
.stat-val { font-size: 24px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.admin-tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--border);
}
.admin-tab {
  border: none; background: transparent; padding: 10px 16px;
  font-size: 13px; font-weight: 500; color: var(--ink-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
}
.admin-tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

.panel-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 18px 20px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.panel-head h2 { margin: 0; font-size: 14.5px; font-weight: 600; }

.invite-bar {
  display: grid; grid-template-columns: 1fr 140px auto; gap: 10px;
  margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
@media (max-width: 720px) { .invite-bar { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; font-weight: 600; color: var(--ink-muted); background: var(--surface-subtle); white-space: nowrap; }
tr:hover td { background: var(--surface-subtle); }

.status-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.pill-unused { background: rgba(21, 128, 61, 0.1); color: var(--confirm); }
.pill-used { background: var(--surface-subtle); color: var(--ink-muted); }
.pill-revoked { background: rgba(200, 50, 43, 0.1); color: var(--alert); }

.link-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: var(--ink-secondary); max-width: 280px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle;
}

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.modal-box {
  position: relative; z-index: 2; width: min(420px, 92vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 22px; box-shadow: var(--shadow-md);
}
.modal-box h3 { margin: 0 0 14px; font-size: 15px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 90;
  background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 6px; font-size: 12.5px;
}

/* =========================================================
   大气建筑感分屏登录页（左侧暗室声呐展陈 + 右侧极简纯白登录区）
   ========================================================= */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(460px, 1.18fr) minmax(420px, 1fr);
  background: var(--surface);
}
@media (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

.login-hero {
  position: relative;
  background: #0b0e14;
  color: #f3f4f6;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-right: 1px solid #1b202b;
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.9;
}
.hero-top, .hero-center, .hero-bottom {
  position: relative;
  z-index: 2;
}
.hero-logo {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}
.hero-center {
  max-width: 520px;
  margin: auto 0;
  padding: 40px 0;
}
.hero-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8b95a5;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: #4b5563;
}
.hero-heading {
  margin: 0 0 20px;
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.hero-desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: #9ca3af;
}
.hero-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-spec-label {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 5px;
  letter-spacing: 0.04em;
}
.hero-spec-val {
  font-size: 12.5px;
  font-weight: 500;
  color: #e5e7eb;
  line-height: 1.45;
}

.login-panel {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 56px;
  min-height: 100vh;
}
@media (max-width: 600px) {
  .login-panel { padding: 28px 24px; }
}
.login-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-logo {
  height: 30px;
  width: auto;
  display: none;
}
@media (max-width: 960px) {
  .mobile-logo { display: block; }
}
.panel-badge {
  font-size: 11.5px;
  color: var(--ink-muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  margin-left: auto;
}

.login-form-wrap {
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 24px 0;
}
.login-heading {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.login-sub {
  margin: 0 0 32px;
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.6;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.login-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.login-field input[type="text"],
.login-field input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-field input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}
.pwd-toggle {
  position: absolute;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}
.pwd-toggle:hover { color: var(--ink); background: var(--surface-subtle); }

.consent-block {
  padding: 14px 15px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  cursor: pointer;
}
.consent-check input {
  margin-top: 3px;
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
  flex-shrink: 0;
  cursor: pointer;
}
.consent-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}
.consent-note {
  margin: 0;
  padding-left: 25px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.btn-login-submit {
  height: 46px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.login-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-muted);
}
.login-panel-foot a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 500;
}
.login-panel-foot a:hover { color: var(--ink); text-decoration: underline; }

.terms-modal-box {
  width: min(640px, 92vw);
  padding: 26px 28px;
}
.terms-modal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.terms-modal-ver {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.terms-modal-body {
  max-height: 58vh;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.78;
  color: var(--ink-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 8px 16px 0;
  margin: 12px 0 18px;
}
.terms-modal-body h4 {
  margin: 16px 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.terms-modal-body h4:first-child { margin-top: 0; }
.terms-modal-body p { margin: 0 0 8px; }
.terms-modal-body ul {
  margin: 4px 0 10px;
  padding-left: 18px;
}
.terms-modal-body li { margin-bottom: 4px; }
.terms-modal-body strong { color: var(--ink); }

/* 左侧精密声呐基础动效（克制、沉稳、无霓虹） */
@keyframes sonarPulseExpand {
  0% {
    transform: scale(0.22);
    opacity: 0;
  }
  18% {
    opacity: 0.22;
  }
  75% {
    opacity: 0.08;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@keyframes sonarSweepRotate {
  0% {
    transform: rotate(-38deg);
  }
  50% {
    transform: rotate(16deg);
  }
  100% {
    transform: rotate(-38deg);
  }
}

@keyframes reticleBreathe {
  0%, 100% { opacity: 0.22; }
  50% { opacity: 0.72; }
}

@keyframes heroFadeUp {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.sonar-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: sonarPulseExpand 9s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
}
.sonar-pulse-2 {
  animation-delay: -3s;
}
.sonar-pulse-3 {
  animation-delay: -6s;
}

.sonar-sweep-group {
  transform-origin: 720px 780px;
  animation: sonarSweepRotate 16s ease-in-out infinite;
}

.reticle-mark {
  animation: reticleBreathe 5.4s ease-in-out infinite;
}
.reticle-mark-2 {
  animation-delay: -2.4s;
}

.hero-top {
  animation: heroFadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-kicker {
  animation: heroFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}
.hero-heading {
  animation: heroFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}
.hero-desc {
  animation: heroFadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}
.hero-bottom {
  animation: heroFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

@media (prefers-reduced-motion: reduce) {
  .sonar-pulse, .sonar-sweep-group, .reticle-mark,
  .hero-top, .hero-kicker, .hero-heading, .hero-desc, .hero-bottom {
    animation: none !important;
  }
}
