/* ====== 虾丸 AI身份证 H5 v4 — 克制深色风 ====== */

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #181825;
  --border: #1e1e30;
  --border-accent: #2d2d4a;
  --text: #e0e0e8;
  --text-dim: #8888a0;
  --text-bright: #ffffff;
  --coral: #f97316;
  --teal: #22c55e;
  --gold: #eab308;
  --purple: #a78bfa;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ====== 页面切换 ====== */
.page { display: none; min-height: 100vh; width: 100%; }
.page.active { display: flex; align-items: center; justify-content: center; }

/* ====== 页面1：输入 ====== */
.input-container {
  text-align: center;
  padding: 40px 24px;
  width: 100%;
  max-width: 400px;
}

.mascot-area { margin-bottom: 24px; }
.shrimp-ball {
  font-size: 72px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.main-question {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.sub-question {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#name-input {
  width: 100%;
  padding: 14px 20px;
  font-size: 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-bright);
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
#name-input:focus { border-color: var(--coral); }
#name-input::placeholder { color: var(--text-dim); opacity: 0.5; }

.btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: var(--coral);
  color: white;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: inherit;
}
.btn-primary:disabled { background: var(--border-accent); color: var(--text-dim); cursor: not-allowed; }
.btn-primary:not(:disabled):active { opacity: 0.85; }

.hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0.5;
}

/* ====== 页面2：加载 ====== */
.loading-container { text-align: center; }
.shrimp-ball.bouncing { animation: bounce 0.5s ease-in-out infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.08); }
}
.loading-text { margin-top: 20px; font-size: 14px; color: var(--text-dim); }

/* ====== 页面3：结果 ====== */
.result-container {
  padding: 20px 16px 40px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 身份证卡片 */
.identity-card {
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 20px;
  border: 1px solid var(--border);
}

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

.card-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  padding: 0;
}

.card-id {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.4;
  font-family: 'JetBrains Mono', monospace, sans-serif;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ====== 物种名 ====== */
.card-species-hero {
  text-align: center;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.species-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.species-name {
  display: block;
  font-size: 32px;
  font-weight: 900;
  color: var(--coral);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.species-group {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--bg-card-hover);
  padding: 3px 12px;
  border-radius: 100px;
  margin-top: 12px;
  border: 1px solid var(--border);
}

/* ====== 字段 ====== */
.card-field { display: flex; flex-direction: column; gap: 2px; }

.field-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.field-value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.danger-field {
  background: var(--bg-card-hover);
  margin: 4px -12px;
  padding: 12px;
  border-radius: 10px;
}

.danger-field .field-label { color: var(--coral); }

.danger-level .stars {
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 3px;
}

.card-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.card-slogan { font-size: 13px; font-weight: 700; color: var(--coral); }
.card-brand { font-size: 10px; color: var(--text-dim); opacity: 0.3; margin-top: 4px; letter-spacing: 4px; }

/* ====== 按钮 ====== */
.action-buttons { display: flex; gap: 10px; width: 100%; margin-top: 16px; }

.btn-action {
  flex: 1;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-action:active { background: var(--bg-card-hover); color: var(--text); }
.btn-icon { font-size: 14px; }

.join-section { width: 100%; margin-top: 12px; }

.btn-join {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: var(--coral);
  color: white;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: inherit;
}
.btn-join:active { opacity: 0.85; }

.btn-text {
  margin-top: 12px;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
  opacity: 0.5;
}

/* ====== 弹窗 ====== */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; }
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); }
.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  width: calc(100% - 48px);
  max-width: 340px;
  text-align: center;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 20px; color: var(--text-dim); cursor: pointer; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--coral); margin-bottom: 20px; }
.qr-placeholder {
  width: 200px; height: 200px; margin: 0 auto;
  background: #ffffff;
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px;
}
.qr-placeholder img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 6px;
}
.qr-placeholder p { font-size: 13px; color: #666; }
.qr-hint { font-size: 11px !important; margin-top: 4px; opacity: 0.5; }
.modal-subtitle { margin-top: 16px; font-size: 14px; color: var(--text-dim); }

/* ====== Toast ====== */
.toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0; transition: all 0.3s;
  pointer-events: none; white-space: nowrap; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ====== 保存预览 ====== */
.save-preview {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95); z-index: 300;
  flex-direction: column; align-items: center; justify-content: center; padding: 20px;
}
.save-preview.active { display: flex; }
.save-preview-hint { color: var(--text-dim); font-size: 14px; margin-bottom: 16px; }
.save-preview img { max-width: 100%; max-height: 70vh; border-radius: 10px; }
.save-preview-close {
  margin-top: 20px; padding: 10px 32px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-dim); font-size: 14px; cursor: pointer; font-family: inherit;
}

/* ====== 适配 ====== */
@media (max-height: 700px) {
  .shrimp-ball { font-size: 56px; }
  .main-question { font-size: 24px; }
  .species-name { font-size: 26px; }
}
@media (min-width: 420px) { .species-name { font-size: 36px; } }
