:root {
  color-scheme: dark;
  --bg-core: #070a12;
  --panel-bg: rgba(13, 18, 32, 0.78);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-glow: rgba(99, 102, 241, 0.12);

  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-dim: #64748b;

  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #818cf8;
  --accent-cyan: #06b6d4;

  --border-input: rgba(148, 163, 184, 0.16);
  --border-focus: rgba(99, 102, 241, 0.6);

  --status-green: #10b981;
  --status-red: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
}

body {
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* 高级环境光晕微渐变 */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 18% 15%, rgba(99, 102, 241, 0.14) 0%, transparent 40%),
    radial-gradient(circle at 82% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.6) 0%, var(--bg-core) 100%);
}

.page {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 64px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* 顶部导航 */
.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.35);
  display: grid;
  place-items: center;
  color: #c7d2fe;
}

.brand-icon svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.brand-sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 20px;
  font-size: 11px;
  color: #a7f3d0;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: var(--status-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--status-green);
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

.divider-v {
  width: 1px;
  height: 16px;
  background: var(--panel-border);
}

.topbar-link {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.topbar-link:hover {
  color: #fff;
}

/* 主内容区域 */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 440px);
  gap: clamp(40px, 6vw, 90px);
  align-items: center;
  padding: 60px 0;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(99, 102, 241, 0.09);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 24px;
}

.security-badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent-light);
}

h1 {
  font-size: clamp(34px, 4.2vw, 54px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #fff 30%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.8;
  max-width: 540px;
  margin-bottom: 36px;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 34px;
}

.spec-card {
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
}

.spec-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  display: grid;
  place-items: center;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.spec-icon svg {
  width: 17px;
  height: 17px;
}

.spec-card strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.spec-card span {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

.cluster-status {
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(10, 15, 28, 0.6);
  border: 1px solid var(--panel-border);
  max-width: 500px;
}

.cluster-title {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.cluster-metrics {
  display: flex;
  justify-content: space-between;
}

.metric-label {
  display: block;
  font-size: 11px;
  color: var(--text-sub);
}

.metric-val {
  display: block;
  font-size: 12px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--accent-cyan);
}

/* 登录面板 */
.login-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 34px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 24px;
  border: 1px solid var(--panel-border);
}

.tab-btn {
  flex: 1;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.panel-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.panel-header p {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.form-field {
  margin-bottom: 18px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forgot-link {
  font-size: 11px;
  color: var(--accent-light);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.input-icon svg {
  width: 17px;
  height: 17px;
}

.input-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  background: rgba(6, 9, 18, 0.6);
  border: 1px solid var(--border-input);
  border-radius: 9px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.input-wrap input:focus {
  border-color: var(--border-focus);
  background: rgba(10, 15, 28, 0.85);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.input-wrap input::placeholder {
  color: #475569;
}

.password-wrap input {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 4px;
}

.toggle-password:hover {
  color: var(--text-sub);
}

.toggle-password svg {
  width: 17px;
  height: 17px;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 22px;
}

.remember-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.remember-option input {
  accent-color: var(--accent-primary);
  width: 14px;
  height: 14px;
}

.device-tag {
  font-size: 10px;
  font-family: monospace;
  padding: 2px 7px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
  border-radius: 4px;
}

.login-button {
  width: 100%;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.login-button:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.login-button:active {
  transform: translateY(0);
}

.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-arrow {
  width: 15px;
  height: 15px;
  transition: transform 0.2s;
}

.login-button:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-button.loading .btn-spinner {
  display: inline-block;
}

.login-button.loading .btn-arrow,
.login-button.loading .btn-text {
  opacity: 0.7;
}

/* SSO 按钮样式 */
.sso-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.sso-notice {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.sso-btn {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.sso-btn svg {
  width: 15px;
  height: 15px;
}

.sso-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* 提示信息 */
.form-message {
  min-height: 20px;
  margin-top: 14px;
  font-size: 11px;
  text-align: center;
  transition: all 0.2s;
}

.form-message.error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 8px 12px;
  border-radius: 6px;
}

.form-message.info {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 8px 12px;
  border-radius: 6px;
}

.panel-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 1.5px;
}

.panel-divider::before,
.panel-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--panel-border);
}

.security-footer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.security-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.5;
}

.security-info svg {
  width: 14px;
  height: 14px;
  color: var(--text-sub);
  flex-shrink: 0;
  margin-top: 2px;
}

/* 页脚 */
.footer {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--panel-border);
  font-size: 11px;
  color: var(--text-dim);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.compliance-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-right a {
  color: var(--text-dim);
  text-decoration: none;
}

.footer-right a:hover {
  color: var(--text-sub);
}

.dot-separator {
  color: rgba(255, 255, 255, 0.15);
}

.build-ver {
  font-family: monospace;
  font-size: 10px;
  color: #475569;
}

/* 响应式 */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 40px 0;
  }
  .specs-grid {
    grid-template-columns: 1fr;
  }
  .login-panel {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .page {
    width: calc(100% - 32px);
  }
  .topbar-right .topbar-link,
  .topbar-right .divider-v {
    display: none;
  }
  .footer {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    height: auto;
    padding: 24px 0;
    text-align: center;
  }
  .footer-left, .footer-right {
    flex-wrap: wrap;
    justify-content: center;
  }
}