* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f5f0e8;
  --bg-card: #fffdf7;
  --primary: #8b4513;
  --primary-dim: rgba(139,69,19,0.12);
  --primary-glow: rgba(139,69,19,0.25);
  --accent: #c41e3a;
  --text: #3a2a1a;
  --text-light: #7a6a5a;
  --border: #d4c5a9;
  --border-light: #e8dcc8;
  --radius: 10px;
  --paper: #faf6ee;
}

body {
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'PingFang SC', 'Songti SC', serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}

.page { display: none; min-height: 100dvh; }
.page.active { display: flex; flex-direction: column; }

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== 首页 ===== */
#page-home {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  position: relative;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(196,30,58,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(139,69,19,0.05) 0%, transparent 60%),
    var(--bg);
}

.doctor-img {
  width: 200px;
  height: auto;
  border-radius: 12px;
  border: 2px solid var(--border);
  box-shadow: 0 4px 24px rgba(139,69,19,0.10);
  margin-bottom: 28px;
}

.title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 12px;
  color: var(--primary);
}

.subtitle {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 36px;
  line-height: 1.8;
}

.btn-primary {
  display: inline-block;
  padding: 14px 48px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  letter-spacing: 2px;
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(196,30,58,0.3); transform: scale(1.02); }
.btn-primary:active { transform: scale(0.98); }

/* 右上角工具栏 */
.home-top-bar {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.top-link {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}
.top-link:hover { opacity: 1; color: var(--primary); }

.disclaimer {
  margin-top: 30px;
  font-size: 11px;
  color: #a09080;
  line-height: 1.5;
}

/* ===== 我的挂号单 ===== */
#page-tickets {
  padding: 0;
  background: var(--bg);
}
.tickets-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 10;
}
.tickets-header h2 {
  font-size: 17px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 2px;
}
.tickets-back {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text);
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
}
.tickets-list {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 20px;
}
.tickets-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-light);
  font-size: 14px;
}
.ticket-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: box-shadow 0.2s;
}
.ticket-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.ticket-item.used { opacity: 0.55; }
.ticket-item-left { flex: 1; min-width: 0; }
.ticket-item-code {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--text);
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.ticket-item-meta {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket-item-right {
  flex-shrink: 0;
  margin-left: 12px;
}
.ticket-item-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  font-weight: 600;
}
.ticket-item-badge.used {
  color: var(--text-light);
  background: var(--primary-dim);
}
.ticket-item-btn {
  padding: 6px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.ticket-item-btn:hover { box-shadow: 0 2px 8px rgba(196,30,58,0.3); }

/* ===== 选科室 ===== */
#page-dept {
  padding: 40px 0;
  background: var(--bg);
}

.dept-header {
  text-align: center;
  padding: 0 20px 24px;
}
.dept-header h2 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 6px;
  letter-spacing: 2px;
}
.dept-header p {
  font-size: 13px;
  color: var(--text-light);
}

.dept-list {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dept-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dept-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px var(--primary-dim);
  transform: translateX(4px);
}
.dept-card .icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--primary);
  font-weight: 700;
  background: var(--paper);
}
.dept-card .info h3 { font-size: 16px; margin-bottom: 4px; color: var(--text); }
.dept-card .info p { font-size: 12px; color: var(--text-light); }

/* ===== 问诊室 ===== */
#page-chat {
  height: 100dvh;
  background: var(--paper);
}

.chat-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.chat-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
.chat-header .header-info h3 { font-size: 14px; color: var(--primary); }
.chat-header .header-info p { font-size: 11px; color: var(--text-light); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

.msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: fadeIn 0.3s ease;
}
.msg.ai { align-self: flex-start; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }

.msg .avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.msg.user .avatar-sm { display: none; }

.msg .bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
}
.msg.ai .bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top-left-radius: 4px;
  color: var(--text);
}
.msg.user .bubble {
  background: #f0e6d6;
  border: 1px solid var(--border);
  border-top-right-radius: 4px;
  color: var(--text);
}

.chat-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding: 10px 16px;
  flex-shrink: 0;
}
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-input-row textarea {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  outline: none;
}
.chat-input-row textarea:focus { border-color: var(--primary); }
.chat-input-row textarea::placeholder { color: #b0a090; }

.btn-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.btn-send:disabled { opacity: 0.3; cursor: not-allowed; }

.chat-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-light);
}

.btn-finish {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-finish:hover { background: rgba(196,30,58,0.08); }

.typing-indicator { color: var(--text-light); font-size: 13px; font-style: italic; }

/* ===== 药方页 ===== */
#page-rx {
  padding: 32px 0;
  align-items: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(139,69,19,0.04) 0%, transparent 60%),
    var(--bg);
}

.rx-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  width: 100%;
  max-width: 440px;
  margin: 0 20px;
  box-shadow: 0 4px 20px rgba(139,69,19,0.08);
}

.rx-card .rx-header {
  text-align: center;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.rx-card .rx-header h2 {
  font-size: 22px;
  color: var(--primary);
  letter-spacing: 6px;
}
.rx-card .rx-header p {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.rx-section { margin-bottom: 20px; }
.rx-section h3 {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rx-section h3::before {
  content: '▎';
  color: var(--accent);
}

.rx-diagnosis {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.rx-item {
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.rx-item .drug-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}
.rx-item .drug-detail {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
}

.rx-advice {
  font-size: 14px;
  line-height: 1.8;
  color: #5a4a3a;
  font-style: italic;
  padding: 12px 16px;
  background: var(--paper);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.rx-footer {
  text-align: center;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  margin-top: 8px;
}
.rx-footer .stamp {
  display: inline-block;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  transform: rotate(-5deg);
  margin-bottom: 8px;
  font-weight: 600;
}
.rx-footer .sign {
  font-size: 11px;
  color: var(--text-light);
}

.rx-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
  max-width: 440px;
  padding: 0 20px;
}
.rx-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-download {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.btn-again {
  background: transparent;
  border: 1px solid var(--border) !important;
  color: var(--text);
}
.btn-again:hover { border-color: var(--primary) !important; }

.rx-disclaimer {
  margin-top: 20px;
  font-size: 11px;
  color: #a09080;
  text-align: center;
  padding: 0 20px;
}

/* ===== 设置按钮 ===== */
.settings-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-light);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-btn:hover { color: var(--primary); border-color: var(--primary); }

.current-model-badge {
  font-size: 12px;
  color: var(--text-light);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: 6px;
  margin-bottom: 24px;
}

.model-tag {
  font-size: 10px;
  color: var(--text-light);
  background: var(--paper);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  font-weight: 400;
  vertical-align: middle;
}

/* ===== 模型配置弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58,42,26,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.modal-header h3 { font-size: 16px; color: var(--primary); }
.modal-close {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 18px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.model-list { display: flex; flex-direction: column; gap: 8px; }

.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.model-option:hover { border-color: var(--primary); }
.model-option.active { border-color: var(--primary); box-shadow: 0 0 8px var(--primary-dim); }
.model-option .model-name { font-size: 14px; flex: 1; color: var(--text); }
.model-option .model-tag-label {
  font-size: 11px;
  color: var(--text-light);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 10px;
}
.model-option .model-check { color: var(--accent); font-size: 16px; font-weight: bold; }

.modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.modal-footer input {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.modal-footer input:focus { border-color: var(--primary); }
.modal-footer input::placeholder { color: #b0a090; }

.btn-apply {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== 挂号单入口 ===== */
.ticket-entry {
  text-align: center;
  padding: 24px 20px 32px;
  max-width: 480px;
  margin: 0 auto;
}
.ticket-entry .divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-light);
  font-size: 13px;
}
.ticket-entry .divider::before,
.ticket-entry .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.btn-ticket-open {
  padding: 10px 28px;
  background: transparent;
  border: 1px dashed var(--primary);
  color: var(--primary);
  font-size: 14px;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}
.btn-ticket-open:hover {
  background: var(--primary-dim);
  border-style: solid;
}

/* ===== 挂号单弹窗 ===== */
.ticket-modal-card {
  text-align: center;
}
.ticket-modal-card .modal-header {
  justify-content: center;
  position: relative;
}
.ticket-modal-card .modal-header .modal-close {
  position: absolute;
  right: 0;
  top: 0;
}
.ticket-modal-card .modal-desc {
  text-align: center;
}
.ticket-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}
.ticket-inputs input {
  width: 42px;
  height: 50px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--primary);
  outline: none;
  transition: border-color 0.2s;
}
.ticket-inputs input:focus {
  border-color: var(--accent);
}
.ticket-inputs input.filled {
  border-color: var(--primary);
  background: var(--paper);
}
.ticket-msg {
  font-size: 12px;
  min-height: 18px;
  margin-bottom: 8px;
}
.ticket-msg.error { color: var(--accent); }
.ticket-msg.success { color: #2e7d32; }

/* ===== 交挂号单动画 (正面拍入) ===== */
.ticket-anim-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.ticket-anim-overlay.playing { display: flex; }
.ticket-anim-overlay.fade-out {
  animation: animFadeOut 0.5s ease forwards;
}

/* 木板背景 (整块) */
.slam-board {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0px,
      rgba(0,0,0,0.03) 1px,
      transparent 2px,
      transparent 6px
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0px,
      rgba(255,255,255,0.02) 2px,
      transparent 4px,
      transparent 12px
    ),
    linear-gradient(90deg, #4a3520 0%, #5e4430 20%, #6b4f38 50%, #5e4430 80%, #4a3520 100%);
  opacity: 0;
  animation: boardFadeIn 0.3s ease-out forwards;
}

/* 等待交单阶段 */
.slam-wait {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  z-index: 20;
}
.slam-wait.hidden { display: none; }
.slam-wait-hint {
  color: rgba(210,195,165,0.6);
  font-size: 14px;
  letter-spacing: 4px;
  animation: hintPulse 2s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 3D 按钮 */
.slam-btn-3d {
  perspective: 600px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  animation: btnFloat 3s ease-in-out infinite;
}
.slam-btn-face {
  display: block;
  padding: 18px 48px;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 6px;
  color: #fdf5e6;
  background: linear-gradient(145deg, #8b4513, #a0522d, #8b4513);
  border: 2px solid rgba(255,220,180,0.3);
  border-radius: 12px;
  box-shadow:
    0 6px 0 #5a2d0a,
    0 8px 16px rgba(0,0,0,0.4),
    inset 0 1px 1px rgba(255,255,255,0.15);
  transform: translateY(0);
  transition: transform 0.08s, box-shadow 0.08s;
}
.slam-btn-3d:hover .slam-btn-face {
  transform: translateY(-2px);
  box-shadow:
    0 8px 0 #5a2d0a,
    0 12px 24px rgba(0,0,0,0.45),
    inset 0 1px 1px rgba(255,255,255,0.15);
}
.slam-btn-3d:active .slam-btn-face {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #5a2d0a,
    0 3px 6px rgba(0,0,0,0.3),
    inset 0 1px 1px rgba(255,255,255,0.1);
}
@keyframes btnFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.slam-label {
  position: absolute;
  top: max(60px, 12vh);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(210,195,165,0.7);
  font-size: 15px;
  letter-spacing: 8px;
  white-space: nowrap;
  opacity: 0;
  display: none;
}
.slam-label.show {
  display: block;
  animation: labelFadeIn 0.3s ease forwards;
}

/* 挂号单 (仿收据凭条) */
.slam-ticket {
  position: absolute;
  width: 260px;
  background: #fdf9f0;
  border: 1px solid #d4c5a9;
  border-radius: 4px;
  padding: 24px 22px 20px;
  text-align: center;
  box-shadow: 0 4px 30px rgba(0,0,0,0.45);
  transform: scale(0) rotate(-8deg);
  opacity: 0;
  pointer-events: none;
}
.slam-ticket.slam-in {
  animation: slamIn 0.13s cubic-bezier(0.2, 0, 0.4, 1) forwards;
}
.slam-ticket.slam-bounce {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  animation: slamBounce 0.35s ease-out forwards;
}
.slam-ticket.slam-hold {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.slam-t-title {
  font-size: 18px;
  font-weight: 700;
  color: #3a2a1a;
  letter-spacing: 4px;
  margin-bottom: 4px;
}
.slam-t-subtitle {
  font-size: 12px;
  color: #8a7a6a;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.slam-t-sep {
  border-top: 1.5px dashed #d4c5a9;
  margin: 10px 0;
}
.slam-t-label {
  font-size: 12px;
  color: #8a7a6a;
  margin-bottom: 4px;
}
.slam-t-name {
  font-size: 28px;
  font-weight: 900;
  color: #3a2a1a;
  margin-bottom: 4px;
  letter-spacing: 2px;
}
.slam-t-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #5a4a3a;
  line-height: 2;
}
.slam-t-footer {
  font-size: 10px;
  color: #a09080;
  margin-top: 4px;
}
.slam-t-stamp {
  position: absolute;
  bottom: 28px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 2px solid #c41e3a;
  border-radius: 50%;
  color: #c41e3a;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-15deg);
  opacity: 0.85;
}

/* 图钉 */
.slam-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin-top: -130px;
  margin-left: -12px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #e8e0d8, #b8b0a0 40%, #8a8070 80%, #6a6050);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.5),
    inset 0 1px 2px rgba(255,255,255,0.4),
    inset 0 -1px 2px rgba(0,0,0,0.2);
  transform: scale(0);
  opacity: 0;
  z-index: 10;
}
.slam-pin.show {
  animation: pinAppear 0.15s cubic-bezier(0.2, 0, 0.4, 1) forwards;
}
.slam-pin::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 5px;
  width: 6px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
}

/* 撞击波纹 */
.slam-board::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  margin-top: -130px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.slam-board.impact::after {
  animation: impactWave 0.4s ease-out forwards;
}

@keyframes boardFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes labelFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes slamIn {
  0%   { transform: scale(0) rotate(-12deg); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes slamBounce {
  0%   { transform: scale(1) rotate(0deg); }
  25%  { transform: scale(1.04) rotate(1.5deg); }
  50%  { transform: scale(0.98) rotate(-0.8deg); }
  75%  { transform: scale(1.01) rotate(0.3deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes pinAppear {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes impactWave {
  0%   { width: 0; height: 0; box-shadow: 0 0 0 0 rgba(200,180,150,0.4); }
  100% { width: 80px; height: 80px; box-shadow: 0 0 0 20px rgba(200,180,150,0); }
}
@keyframes animFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 加载态 ===== */
.loading-dots::after {
  content: '';
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}
