:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel-bg: rgba(16, 18, 27, 0.75);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-hover: rgba(255, 255, 255, 0.16);
  --text-main: #f8fafc;
  --text-muted: #848e9f;
  --text-subtle: #4b5568;
  --accent: #5e6ad2;
  --accent-glow: rgba(94, 106, 210, 0.28);
  --accent-light: #94a0ff;
  --card-bg: rgba(255, 255, 255, 0.025);
  --input-bg: rgba(8, 10, 16, 0.65);
  --error: #f43f5e;
  --success: #10b981;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

html {
  min-height: 100%;
}

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

/* 背景微光氛围 */
.ambient-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 650px;
  background: radial-gradient(circle at 50% 15%, rgba(94, 106, 210, 0.12), rgba(15, 23, 42, 0.05) 55%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

button, input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.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: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

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

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 100px;
}

.pulse-indicator {
  width: 6px;
  height: 6px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.topbar-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

/* Hero 主展示区 */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 440px);
  align-items: center;
  gap: clamp(40px, 6vw, 90px);
  padding: 70px 0 80px;
}

.hero-content {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  color: var(--accent-light);
  background: rgba(94, 106, 210, 0.08);
  border: 1px solid rgba(94, 106, 210, 0.22);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-light);
  border-radius: 50%;
}

h1 {
  margin: 24px 0 18px;
  font-size: clamp(38px, 4.5vw, 56px);
  line-height: 1.18;
  letter-spacing: -1.2px;
  font-weight: 650;
  color: #fff;
}

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

.hero-description {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.85;
  max-width: 520px;
  margin: 0;
}

/* 特性列表 */
.feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 42px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  transition: border-color 0.25s, transform 0.25s;
}

.feature-item:hover {
  border-color: var(--panel-border-hover);
  transform: translateY(-2px);
}

.feature-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #cdd5e0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

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

.feature-item strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.feature-item span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

/* 节点监控仪表板装饰 */
.vault-metrics {
  margin-top: 36px;
  max-width: 480px;
}

.metric-card {
  padding: 16px 20px;
  background: rgba(14, 16, 24, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.metric-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.08);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.2);
  letter-spacing: 0.5px;
}

.metric-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.metric-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #5e6ad2, #38bdf8);
  border-radius: 4px;
}

.metric-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 登录面板 */
.login-panel {
  width: 100%;
  padding: 42px 38px 34px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  backdrop-filter: blur(28px);
}

.panel-heading {
  margin-bottom: 28px;
  text-align: center;
}

.panel-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

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

.panel-heading h2 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: #fff;
}

.panel-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

/* 表单字段 */
.form-field {
  margin-bottom: 20px;
}

.form-field > label {
  display: block;
  margin-bottom: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.form-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: #fff;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  outline: none;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-field input::placeholder {
  color: var(--text-subtle);
  font-size: 12px;
}

.form-field input:focus {
  background: rgba(14, 18, 28, 0.95);
  border-color: rgba(94, 106, 210, 0.6);
  box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.15);
}

.password-wrap {
  position: relative;
}

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

.toggle-password {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transform: translateY(-50%);
  transition: color 0.2s, background 0.2s;
}

.toggle-password:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

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

/* 记住密码选项 */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 24px;
  color: var(--text-muted);
  font-size: 12px;
}

.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.remember-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* 按钮与微动效 */
.login-button {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: linear-gradient(180deg, #5765df, #4c57cb);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(76, 87, 203, 0.25);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: 0.3px;
  transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
}

.login-button:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 22px rgba(76, 87, 203, 0.38);
  transform: translateY(-1px);
}

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

.btn-arrow {
  transition: transform 0.2s;
}

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

.form-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.form-message.error {
  color: var(--error);
}

.form-message.success {
  color: var(--success);
}

/* 分隔线与底部声明 */
.panel-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px;
  color: var(--text-subtle);
  font-size: 11px;
}

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

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-subtle);
}

.lock-glyph {
  display: inline-flex;
  color: var(--text-muted);
}

.security-note p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

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

/* 响应式断点 */
@media (max-width: 960px) {
  .page {
    width: min(680px, calc(100% - 40px));
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 50px 0;
  }
  .hero-content {
    text-align: center;
  }
  .hero-description {
    margin: 0 auto;
  }
  .feature-list {
    max-width: 520px;
    margin: 36px auto 0;
    text-align: left;
  }
  .vault-metrics {
    display: none;
  }
  .login-panel {
    max-width: 450px;
    margin: 0 auto;
  }
}

@media (max-width: 540px) {
  .page {
    width: calc(100% - 32px);
  }
  .topbar {
    height: 72px;
  }
  .topbar-status {
    display: none;
  }
  .hero {
    padding: 36px 0;
  }
  h1 {
    font-size: 34px;
    letter-spacing: -0.8px;
  }
  .feature-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .login-panel {
    padding: 30px 22px 26px;
    border-radius: 16px;
  }
  .footer {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 20px 0;
    text-align: center;
  }
}