/* ============================================
   共享基础样式（被所有页面使用）
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: #102033;
  background: #f7fbff;
  min-height: 100vh;
}

/* 注册页面专用布局 */
body.register-page {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 20px 40px;
}

/* 链接 */
a {
  color: #0570ff;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #0356c9;
  text-decoration: underline;
}

/* 标题 */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
  color: #102033;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }

h1:first-child,
h2:first-child,
h3:first-child {
  margin-top: 0;
}

/* 列表 */
ul, ol {
  padding-left: 1.5em;
  margin: 1em 0;
}

li {
  margin: 0.4em 0;
}

/* 代码 */
code {
  font-family: "SF Mono", Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  word-break: break-all;
}

pre {
  background: #1e2937;
  color: #e2e8f0;
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1em 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
  color: inherit;
}

/* 图片 */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* 水平线 */
hr {
  border: none;
  border-top: 1px solid rgba(16, 32, 51, 0.12);
  margin: 2em 0;
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.95em;
}

th, td {
  padding: 0.6em 0.8em;
  text-align: left;
  border-bottom: 1px solid rgba(16, 32, 51, 0.1);
}

th {
  font-weight: 600;
  background: rgba(0, 0, 0, 0.03);
}

/* 引用 */
blockquote {
  margin: 1em 0;
  padding: 0.8em 1em;
  border-left: 4px solid #0570ff;
  background: rgba(5, 112, 255, 0.04);
  border-radius: 0 8px 8px 0;
  color: #35516f;
}

blockquote p {
  margin: 0;
}

/* 按钮基础 */
button, .btn {
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* ============================================
   注册页面专用样式
   ============================================ */

/* 注册页面的 body（居中卡片布局） */
body.register-page {
  background:
    radial-gradient(circle at top, rgba(0, 170, 255, 0.16), transparent 42%),
    linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  display: flex;
  justify-content: center;
  padding-top: 32px;
  padding-bottom: 40px;
}

body.register-page h1 {
  text-align: center;
  letter-spacing: -0.02em;
}

/* 通用卡片容器 */
.card {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(16, 32, 51, 0.08);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(16, 32, 51, 0.12);
  width: 100%;
  max-width: 420px;
}

/* --- Turnstile 人机验证门 --- */
#turnstile-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gate-box {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.gate-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #35516f;
  margin: 0;
}

.gate-hint {
  font-size: 0.85rem;
  color: #6b8299;
  margin: 0;
}

/* --- 注册表单 --- */
#register-section {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #c9d9ea;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: #3da5ff;
  box-shadow: 0 0 0 4px rgba(61, 165, 255, 0.15);
}

.hint {
  margin: 8px 0 2px;
  color: #35516f;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* 按钮样式 */
button, .btn-primary {
  position: relative;
  width: 100%;
  padding: 12px;
  margin-top: 16px;
  background: linear-gradient(135deg, #1698ff 0%, #0570ff 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px rgba(5, 112, 255, 0.26);
  overflow: hidden;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(5, 112, 255, 0.3);
}

button:disabled {
  cursor: wait;
  opacity: 0.9;
  transform: none;
  box-shadow: 0 10px 24px rgba(5, 112, 255, 0.18);
}

button:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(5, 112, 255, 0.3);
}

.btn-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

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

form.is-loading .btn-spinner {
  display: inline-block;
}

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

/* 辅助按钮 */
#confirmEmailBtn {
  background: #fff;
  color: #0570ff;
  border: 1px solid rgba(5, 112, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
}

#confirmEmailBtn:hover:not(:disabled) {
  transform: translateY(-1px);
}

#confirmEmailBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#confirmEmailBtn.active {
  background: linear-gradient(135deg, #1698ff 0%, #0570ff 100%);
  color: #fff;
  border: none;
  box-shadow: 0 10px 24px rgba(5, 112, 255, 0.26);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(5, 112, 255, 0.26); }
  50% { box-shadow: 0 10px 32px rgba(5, 112, 255, 0.4); }
}

/* 消息提示 */
.msg {
  padding: 10px;
  margin-top: 16px;
  border-radius: 12px;
  line-height: 1.5;
}

.msg.error {
  background: #fee;
  color: #c00;
}

.msg.success {
  background: #efe;
  color: #060;
}

.msg.info {
  background: #eef4ff;
  color: #0570ff;
}