/* =========================================================
   安全验证页模板 —— 视觉复刻自 Cloud PACS System
   主色：靛蓝 #667eea / 紫 #764ba2 / 青绿 #48bb78
   改色只需替换文末 :root 里的三个变量
   ========================================================= */

* { box-sizing: border-box; }

:root {
  --grad-from: #667eea;
  --grad-to: #764ba2;
  --accent: #667eea;
  --accent-dark: #5a6fd8;
  --success: #48bb78;
  --success-dark: #3ca56d;
  --line: #e1e5e9;
  --text: #333;
  --text-soft: #555;
  --text-mute: #8a94a6;
  --radius: 15px;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
  background: linear-gradient(135deg, var(--grad-from) 0%, var(--grad-to) 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 卡片 ---------- */
.container {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .1);
  width: 100%;
  max-width: 400px;
  padding: 40px;
  margin: 20px;
  animation: cardIn .5s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 品牌区 ---------- */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--accent);
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
}

.brand-mark svg { width: 18px; height: 18px; }

.brand-text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #6b7a99;
}

/* ---------- 标题 ---------- */
h2 {
  color: var(--text);
  text-align: center;
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .5px;
}

.subtitle {
  text-align: center;
  color: var(--text-mute);
  font-size: 14px;
  margin: 0 0 26px;
}

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 22px; }

label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.5;
}

input[type="text"] {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .3s, box-shadow .3s;
  outline: none;
}

input[type="text"]::placeholder { color: #b6bfcc; }

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, .1);
}

input[type="text"].invalid {
  border-color: #fc8181;
  box-shadow: 0 0 0 3px rgba(252, 129, 129, .12);
}

/* 分隔线 */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  color: var(--text-mute);
  font-size: 12px;
}

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

/* ---------- 按钮 ---------- */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .3s, transform .3s, box-shadow .3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 5px;
}

.btn-verify {
  background: var(--success);
  color: #fff;
}

.btn-verify:hover:not(:disabled) {
  background: var(--success-dark);
  transform: translateY(-2px);
  box-shadow: 0 7px 14px rgba(72, 187, 120, .2);
}

.btn-verify:active:not(:disabled) { transform: translateY(0); }

.btn-resend {
  background: #edf2f7;
  color: var(--accent);
  margin-top: 20px;
}

.btn-resend:hover { background: #e2e8f0; }

.btn:disabled { cursor: default; opacity: .8; }

.btn:focus-visible {
  outline: 3px solid rgba(102, 126, 234, .35);
  outline-offset: 2px;
}

/* 加载圈 */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin .7s linear infinite;
}

.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: .85; }

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

/* ---------- 消息条 ---------- */
.message {
  padding: 12px;
  border-radius: 8px;
  margin: 0 0 20px;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.6;
  animation: msgIn .3s ease both;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.message.success {
  background: #c6f6d5;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.message.error {
  background: #fed7d7;
  color: #742a2a;
  border: 1px solid #fc8181;
}

.message.info {
  background: #bee3f8;
  color: #2a4365;
  border: 1px solid #90cdf4;
}

/* ---------- 辅助文字 ---------- */
.footnote {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: #aab3c0;
  line-height: 1.7;
}

/* ---------- 成功视图 ---------- */
.result-card { text-align: center; }

.check-circle {
  width: 60px;
  height: 60px;
  margin: 4px auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #c6f6d5;
  color: #2f855a;
}

.check-circle svg { width: 30px; height: 30px; }

.result-card h2 { margin-bottom: 10px; }

.loading-bar {
  height: 6px;
  border-radius: 99px;
  background: #edf2f7;
  overflow: hidden;
  margin: 26px 0 6px;
}

.loading-bar i {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--grad-from), var(--grad-to));
  animation: slide 1.3s ease-in-out infinite;
}

@keyframes slide {
  0%   { transform: translateX(-60%); }
  100% { transform: translateX(310%); }
}

/* ---------- 移动端 ---------- */
@media (max-width: 480px) {
  body { padding: 14px; align-items: flex-start; padding-top: max(14px, env(safe-area-inset-top)); }
  .container { padding: 28px 22px; margin: 0; border-radius: 14px; }
  h2 { font-size: 21px; }
  .subtitle { font-size: 13px; margin-bottom: 22px; }
  label { font-size: 13.5px; }
  input[type="text"] { font-size: 16px; padding: 11px 13px; }
  .btn { padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
