:root {
  --purple: #7c3aed;
  --purple-dark: #6d28d9;
  --purple-light: rgba(124, 58, 237, 0.12);
  --text: #1f2937;
  --muted: #6b7280;
  --announce-bg: rgba(251, 191, 36, 0.15);
  --announce-border: rgba(251, 191, 36, 0.45);
  --glass: rgba(255, 255, 255, 0.92);
  --input-bg: rgba(255, 255, 255, 0.95);
  --border: rgba(124, 58, 237, 0.2);
}

body.theme-dark {
  --text: #e5e7eb;
  --muted: #9ca3af;
  --announce-bg: rgba(251, 191, 36, 0.12);
  --announce-border: rgba(251, 191, 36, 0.35);
  --glass: rgba(17, 24, 39, 0.92);
  --input-bg: rgba(31, 41, 55, 0.85);
  --border: rgba(167, 139, 250, 0.28);
  --purple-light: rgba(167, 139, 250, 0.15);
}

body.theme-dark .bg {
  background: linear-gradient(135deg, #020617 0%, #1e1b4b 45%, #312e81 100%);
}

body.theme-dark .modal {
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.theme-dark .announce {
  color: #fcd34d;
}

body.theme-dark .announce strong {
  color: #fde68a;
}

body.theme-dark .input-shell input {
  color: var(--text);
}

body.theme-dark .rech-hint {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
}

body.theme-dark .pwd-banner {
  background: rgba(55, 65, 81, 0.55);
  color: #d1d5db;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
}

.bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4c1d95 100%);
  position: relative;
  overflow: hidden;
}

.bg-blur {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.35), transparent 45%),
    radial-gradient(circle at 80% 60%, rgba(168, 85, 247, 0.25), transparent 40%);
  filter: blur(2px);
  opacity: 0.9;
}

.mock-dash {
  position: absolute;
  inset: -20px;
  opacity: 0.15;
  background: repeating-linear-gradient(
      90deg,
      transparent,
      transparent 48px,
      rgba(255, 255, 255, 0.06) 48px,
      rgba(255, 255, 255, 0.06) 49px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 48px,
      rgba(255, 255, 255, 0.06) 48px,
      rgba(255, 255, 255, 0.06) 49px
    );
}

.fab-doc {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, #7c3aed, #6d28d9);
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.45);
  cursor: pointer;
  z-index: 5;
}

.overlay {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.modal {
  width: min(520px, 100%);
  background: var(--glass);
  backdrop-filter: blur(16px);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 8px;
  position: relative;
}

.shield-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  flex: 1;
  padding-right: 36px;
}

.theme-toggle {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(124, 58, 237, 0.1);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.theme-toggle:hover {
  background: rgba(124, 58, 237, 0.18);
}

.announce {
  margin: 0 16px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--announce-bg);
  border: 1px solid var(--announce-border);
  font-size: 13px;
  line-height: 1.65;
  color: #78350f;
}

.announce-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.announce-top strong {
  color: #92400e;
}

.announce-collapse {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #92400e;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
}

.announce-collapse:hover {
  background: rgba(0, 0, 0, 0.06);
}

body.theme-dark .announce-collapse {
  color: #fde68a;
}

.announce.collapsed .announce-body {
  display: none;
}

.announce.collapsed .announce-collapse {
  transform: rotate(180deg);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0 10px;
  margin-top: 2px;
  border-bottom: 1px solid var(--border);
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 12px 2px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--purple);
  border-bottom-color: var(--purple);
  font-weight: 600;
}

.form-wrap {
  padding: 20px 22px 22px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.label-sub {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 400;
}

.label-req {
  font-size: 12px;
  color: #dc2626;
  font-weight: 600;
}

.label-opt {
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}

.input-shell {
  position: relative;
}

.input-shell .icon-left {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 14px;
  pointer-events: none;
}

.input-shell input {
  width: 100%;
  padding: 12px 12px 12px 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  font-size: 14px;
}

.input-shell input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-light);
}

.captcha-input input {
  padding-left: 12px;
}

.captcha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.captcha-input {
  flex: 1 1 120px;
  min-width: 120px;
}

.captcha-img {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  display: none;
}

.captcha-img.loaded {
  display: block;
}

.btn-ghost {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--purple);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--purple);
}

.rech-hint {
  font-size: 13px;
  line-height: 1.7;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #1e40af;
  margin-bottom: 16px;
}

.pwd-banner {
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(243, 244, 246, 0.95);
  color: #4b5563;
  margin-bottom: 16px;
}

.row-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--purple), var(--purple-dark));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.35);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.msg {
  margin-top: 12px;
  font-size: 13px;
  min-height: 1.2em;
}

.msg.err {
  color: #dc2626;
}

.msg.ok {
  color: #059669;
}

.msg.sub-ok {
  color: #059669;
  margin-top: 8px;
}

.msg.alert-inline {
  margin-top: 0;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(254, 226, 226, 0.95);
  color: #b91c1c;
  border: 1px solid rgba(248, 113, 113, 0.45);
  font-size: 13px;
  line-height: 1.5;
}

body.theme-dark .msg.alert-inline {
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.25);
}

.version-hint {
  text-align: center;
  padding: 8px 14px 16px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.version-hint code {
  font-size: 10px;
  color: rgba(196, 181, 253, 0.95);
}
