:root {
  --primary: #0066ff;
  --primary-light: #4d94ff;
  --primary-dark: #0052cc;
  --secondary: #7c3aed;
  --accent: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --gradient-primary: linear-gradient(135deg, #0066ff 0%, #7c3aed 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(0, 102, 255, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.10), 0 4px 6px -4px rgb(0 0 0 / 0.10);
  --shadow-glow: 0 0 20px rgba(0, 102, 255, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-primary);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(0, 102, 255, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(124, 58, 237, 0.03) 0%, transparent 50%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  cursor: pointer;
  color: #ffffff;
  background: var(--gradient-primary);
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(0, 102, 255, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 102, 255, 0.20);
}

button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

button.secondary {
  color: var(--primary-dark);
  background: #eef4ff;
  box-shadow: none;
}

button.gray {
  color: #334155;
  background: #e2e8f0;
  box-shadow: none;
}

button.green {
  background: var(--success);
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.16);
}

button.red {
  background: var(--danger);
  box-shadow: 0 8px 16px rgba(239, 68, 68, 0.16);
}

button.orange {
  color: #d97706;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  box-shadow: none;
}

button.small {
  min-height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
  color: var(--text-secondary);
  background: transparent;
  box-shadow: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-primary);
  background: #ffffff;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 102, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.08);
}

a {
  color: inherit;
}

.muted {
  color: var(--text-muted);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
}

.status.ok {
  color: #047857;
  background: #dcfce7;
}

.status.warn {
  color: #b45309;
  background: #fef3c7;
}

.status.bad {
  color: #b91c1c;
  background: #fee2e2;
}

.status.info {
  color: #1d4ed8;
  background: #dbeafe;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 8px;
  padding: 0 8px;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  font-size: 12px;
  font-weight: 600;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.modal-panel {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
}

.modal-panel header {
  height: 58px;
  padding: 0 18px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: var(--gradient-subtle);
}

.modal-panel h3 {
  margin: 0;
  font-size: 17px;
}

.modal-content {
  padding: 20px 22px;
  overflow: auto;
}

.modal-section {
  margin-bottom: 16px;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section h4 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 15px;
}

.modal-panel footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  background: #f8fafc;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1000;
  transform: translateX(-50%);
  padding: 11px 16px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(420px, 0.72fr);
  background: #ffffff;
}

.login-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 72px;
  color: #071a36;
  text-align: center;
  background:
    linear-gradient(rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    #f4f8ff;
  background-size: 48px 48px;
}

.login-visual::before {
  content: "";
  position: absolute;
  left: -170px;
  top: -170px;
  z-index: -1;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.08);
}

.login-visual::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -160px;
  z-index: -1;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.08);
}

.login-logo {
  display: none;
}

.login-brand-mark {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 38px;
}

.login-brand-mark img {
  width: 164px;
  height: auto;
}

.login-brand-mark span {
  color: #111827;
  font-size: 13px;
}

.login-visual h1 {
  margin: 0 0 14px;
  max-width: 680px;
  color: #061735;
  font-size: 31px;
  line-height: 1.18;
}

.login-visual p {
  margin: 0;
  max-width: 680px;
  color: #344562;
  font-size: 16px;
  line-height: 1.85;
}

.login-feature-list {
  display: grid;
  gap: 16px;
  width: min(315px, 100%);
  margin-top: 42px;
}

.login-feature-list article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid #dbe7f7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.login-feature-list svg {
  width: 42px;
  height: 42px;
  padding: 11px;
  border-radius: 10px;
  color: #2563eb;
  background: #e7f0ff;
  fill: currentColor;
}

.login-feature-list b,
.login-feature-list span {
  display: block;
}

.login-feature-list b {
  color: #071a36;
  font-size: 14px;
}

.login-feature-list span {
  margin-top: 4px;
  color: #334155;
  font-size: 12px;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 72px 46px 40px;
  background: #ffffff;
}

.login-card {
  width: 400px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #ffffff;
  box-shadow: none;
}

.login-role-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 18px;
  border-radius: 7px;
  padding: 0 11px;
  color: #2563eb;
  background: #eaf2ff;
  font-size: 12px;
  font-weight: 700;
}

.login-card h2 {
  margin: 0 0 8px;
  color: #061735;
  font-size: 28px;
}

.login-card p {
  margin: 0 0 30px;
  color: #8ca0bb;
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 20px;
}

.login-form label {
  display: grid;
  gap: 9px;
}

.login-form label span {
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  min-height: 48px;
  border-color: #d8e2ef;
  border-radius: 9px;
  background: #f8fafc;
}

.login-form > button[type="submit"] {
  min-height: 48px;
  margin-top: 2px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2f80ff 0%, #4d8dff 100%);
}

.login-forgot {
  justify-self: end;
  min-height: auto;
  margin-top: -8px;
  padding: 0;
  color: #2563eb;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
}

.login-copyright {
  margin-top: 36px;
  color: #8ca0bb;
  text-align: center;
  font-size: 12px;
}

.login-acceptance-tools {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed #d8e2ef;
}

.login-acceptance-tools summary {
  cursor: pointer;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.login-acceptance-tools > p {
  margin: 5px 0 10px;
  font-size: 12px;
}

.api-config {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: #f8fafc;
}

.api-config .toolbar {
  justify-content: space-between;
}

.api-config span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.phone-login-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: #f8fafc;
}

.phone-login-box b {
  font-size: 13px;
}

.mini-login-source {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f5f7fa;
}

.mini-login-phone {
  width: 390px;
  min-height: 844px;
  display: grid;
  align-content: center;
  padding: 34px 28px;
  background: linear-gradient(180deg, #f2f7ff 0%, #ffffff 44%, #f5f7fa 100%);
}

.mini-login-card,
.mini-login-tip-card {
  display: grid;
  gap: 18px;
  padding: 30px 24px;
  border: 1px solid #edf2f7;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.mini-login-card.auth {
  justify-items: center;
  text-align: center;
}

.mini-login-logo {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #22c55e);
  font-size: 34px;
  font-weight: 800;
}

.mini-login-card h1,
.mini-login-tip-card h1 {
  margin: 0;
  color: #111827;
  font-size: 25px;
}

.mini-login-card p,
.mini-login-tip-card p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.mini-login-sub {
  color: #94a3b8;
  font-size: 13px;
}

.mini-login-card button,
.mini-login-tip-card button {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
}

.mini-phone-form {
  display: grid;
  gap: 16px;
}

.mini-phone-form label {
  display: grid;
  gap: 8px;
}

.mini-phone-form label > span {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.mini-phone-form label > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  background: #f8fafc;
}

.mini-phone-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 0;
  background: transparent;
}

.mini-phone-form label button {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  color: #2563eb;
  background: #eaf2ff;
  box-shadow: none;
}

.mini-login-card footer {
  display: grid;
  gap: 16px;
  color: #94a3b8;
  font-size: 12px;
}

.mini-login-card footer b {
  color: #2563eb;
}

.mini-login-card footer em {
  color: #c0c8d2;
  font-style: normal;
}

.mini-login-welcome {
  color: #111827;
  font-size: 18px;
  font-weight: 800;
}

.mini-login-tip-card {
  text-align: center;
}

.mini-login-tip-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  color: #ffffff;
  background: #f97316;
  font-size: 30px;
  font-weight: 900;
}

.mini-login-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
}

.mini-login-tip-row b {
  color: #111827;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 12px;
}

.account-grid button {
  min-height: 64px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
  text-align: left;
  color: #1e3a8a;
  background: #f8fbff;
  border: 1px solid #dbeafe;
  box-shadow: none;
}

.account-grid small {
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.timeline {
  display: grid;
  gap: 0;
  padding: 4px 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 14px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-item i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid #dbeafe;
  background: var(--primary);
}

.timeline-item.active i {
  border-color: #fef3c7;
  background: var(--warning);
}

.timeline-item b {
  display: block;
  margin-bottom: 3px;
}

.timeline-item span {
  color: var(--text-muted);
  font-size: 12px;
}

@media (max-width: 920px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 320px;
    padding: 40px 28px;
  }

  .login-panel {
    padding: 28px 16px;
  }
}

@media (max-width: 560px) {
  .account-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    width: 100%;
  }
}
