:root {
  --bg: #0c0f1d;
  --card: rgba(22, 27, 51, 0.8);
  --border: rgba(99, 115, 171, 0.12);
  --border-light: rgba(99, 115, 171, 0.2);
  --text: #e8ecf4;
  --text-muted: #9ca3bf;
  --text-dim: #5c6382;
  --primary: #5b6cf0;
  --primary-light: #7b8aff;
  --primary-dim: rgba(91, 108, 240, 0.12);
  --gradient: linear-gradient(135deg, #5b6cf0 0%, #8b5cf6 100%);
  --gradient-hover: linear-gradient(135deg, #6d7cf7 0%, #9d6ff9 100%);
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.1);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  -webkit-font-smoothing: antialiased; position: relative; overflow: hidden;
}
body::before {
  content: ''; position: fixed; top: -250px; right: -150px; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(91,108,240,0.08) 0%, transparent 70%); pointer-events: none;
}
body::after {
  content: ''; position: fixed; bottom: -200px; left: -100px; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%); pointer-events: none;
}
.container { width: 100%; max-width: 420px; padding: 20px; position: relative; z-index: 1; }
.header { text-align: center; margin-bottom: 36px; }
.logo {
  width: 56px; height: 56px; background: var(--gradient); border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 900; color: #fff; margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(91,108,240,0.3);
}
.title {
  font-size: 24px; font-weight: 800; margin-bottom: 8px;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.subtitle { font-size: 13px; color: var(--text-dim); }
.card {
  background: var(--card); border: 1px solid var(--border-light); border-radius: 16px;
  padding: 32px; backdrop-filter: blur(16px); box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.form-input {
  width: 100%; padding: 12px 16px; background: rgba(12,15,29,0.6);
  border: 1px solid var(--border-light); border-radius: 10px; color: var(--text);
  font-size: 14px; font-family: inherit; outline: none; transition: all 0.25s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.form-input::placeholder { color: var(--text-dim); }
.btn {
  width: 100%; padding: 12px; background: var(--gradient); color: #fff; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: all 0.25s; margin-top: 4px; box-shadow: 0 4px 14px rgba(91,108,240,0.3);
}
.btn:hover { background: var(--gradient-hover); box-shadow: 0 6px 20px rgba(91,108,240,0.4); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-row { display: flex; gap: 12px; margin-top: 4px; }
.btn-row .btn { flex: 1; }
.btn.outline { background: transparent; color: var(--primary-light); border: 1px solid var(--border-light); box-shadow: none; }
.btn.outline:hover { background: var(--primary-dim); border-color: var(--primary); transform: translateY(-1px); }
.msg { padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; margin-bottom: 16px; display: none; text-align: center; }
.msg.error { background: var(--red-dim); color: var(--red); }
.msg.success { background: var(--green-dim); color: var(--green); }
.msg.show { display: block; }
.footer { text-align: center; margin-top: 24px; font-size: 12px; color: var(--text-dim); }
.footer a { color: var(--primary-light); text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }
.api-key-box {
  margin-top: 16px; padding: 14px; background: rgba(91,108,240,0.08); border: 1px solid var(--border-light);
  border-radius: 10px; display: none;
}
.api-key-box.show { display: block; }
.api-key-label { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.api-key-value {
  font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: 13px; color: var(--primary-light);
  word-break: break-all; user-select: all; cursor: text;
}
