/* ==================== 深色奇幻公共主题 ==================== */
:root {
  --bg-deep: #0d0d1a;
  --bg-primary: #1a0a2e;
  --bg-secondary: #0f0f23;
  --bg-card: rgba(26, 10, 46, 0.85);
  --bg-card-hover: rgba(36, 15, 60, 0.95);
  --bg-input: rgba(15, 15, 35, 0.9);
  --bg-overlay: rgba(0, 0, 0, 0.85);

  --accent-gold: #d4a843;
  --accent-gold-bright: #ffd700;
  --accent-gold-glow: rgba(212, 168, 67, 0.4);
  --accent-cyan: #69d8ff;
  --accent-red: #c0392b;
  --accent-red-dark: #8b0000;
  --accent-purple: #764ba2;
  --accent-purple-light: #a78bfa;

  --text-primary: #f0e6d3;
  --text-secondary: #a09080;
  --text-muted: #6a5a4a;
  --text-gold: #d4a843;

  --border-gold: rgba(212, 168, 67, 0.25);
  --border-subtle: rgba(100, 100, 130, 0.3);
  --border-glow: rgba(212, 168, 67, 0.5);

  --role-god: #ffd700;
  --role-wolf: #ff6b6b;
  --role-villager: #90EE90;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow-gold: 0 0 20px rgba(212, 168, 67, 0.3);
  --shadow-glow-red: 0 0 20px rgba(192, 57, 43, 0.3);
}

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

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: linear-gradient(160deg, #080818 0%, var(--bg-primary) 40%, #0a0a20 70%, #0d0818 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.5;
  position: relative;
}

/* 背景氛围光效 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 600px 400px at 20% 10%, rgba(100, 50, 150, 0.08), transparent),
    radial-gradient(ellipse 500px 500px at 80% 80%, rgba(30, 60, 120, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

/* ==================== 布局 ==================== */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

.page-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

/* ==================== 卡片 ==================== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card), var(--shadow-glow-gold);
}

.card-compact {
  padding: 16px;
  border-radius: 12px;
}

/* ==================== 标题 ==================== */
.page-title {
  font-size: 1.8rem;
  font-weight: bold;
  text-align: center;
  color: var(--accent-gold-bright);
  text-shadow: 0 0 20px var(--accent-gold-glow);
  margin-bottom: 8px;
}

.page-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
  font-weight: bold;
}

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #b8860b);
  color: #1a0a2e;
  box-shadow: 0 4px 15px rgba(212, 168, 67, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(212, 168, 67, 0.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(100, 100, 130, 0.3);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  background: rgba(100, 100, 130, 0.5);
  border-color: var(--text-secondary);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
}
.btn-danger:hover { transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}
.btn-outline:hover {
  background: rgba(212, 168, 67, 0.1);
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==================== 输入框 ==================== */
.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
  outline: none;
}
.input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.15);
}
.input::placeholder {
  color: var(--text-muted);
}

.input-group {
  display: flex;
  gap: 8px;
}
.input-group .input {
  flex: 1;
}

/* ==================== 标签/选项 ==================== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
}
.tag-god { background: rgba(255, 215, 0, 0.15); color: var(--role-god); }
.tag-wolf { background: rgba(255, 0, 0, 0.15); color: var(--role-wolf); }
.tag-villager { background: rgba(144, 238, 144, 0.15); color: var(--role-villager); }

/* ==================== 选项按钮组 ==================== */
.option-group {
  display: flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.option-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: rgba(30, 20, 50, 0.8);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.option-btn:hover {
  background: rgba(50, 30, 80, 0.8);
  color: var(--text-secondary);
}
.option-btn.active {
  background: linear-gradient(135deg, var(--accent-gold), #b8860b);
  color: #1a0a2e;
}

/* ==================== 弹窗 ==================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-overlay);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--bg-card);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 28px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-overlay.marker-modal .modal-box {
  width: min(92vw, 420px);
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.modal-overlay.result-modal .modal-box {
  width: min(92vw, 460px);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.modal-overlay.marker-modal .modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  margin-bottom: 14px;
}

.modal-overlay.result-modal .modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  margin-bottom: 14px;
}

.modal-overlay.marker-modal .modal-buttons {
  flex-shrink: 0;
}

.modal-overlay.result-modal .modal-buttons {
  flex-shrink: 0;
  flex-wrap: wrap;
}

.modal-overlay.share-card-modal .modal-box {
  width: min(92vw, 460px);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.modal-overlay.share-card-modal .modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  margin-bottom: 14px;
}

.modal-overlay.share-card-modal .modal-buttons {
  flex-shrink: 0;
  flex-wrap: wrap;
}

.modal-title {
  font-size: 1.2rem;
  color: var(--accent-gold-bright);
  margin-bottom: 16px;
}

.modal-body {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ==================== 在线状态点 ==================== */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.status-dot.online { background: #2ecc71; box-shadow: 0 0 6px rgba(46, 204, 113, 0.5); }
.status-dot.offline { background: #666; }

/* ==================== 提示文字 ==================== */
.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.error-text {
  color: var(--accent-red);
  font-size: 0.85rem;
}

.success-text {
  color: #2ecc71;
  font-size: 0.85rem;
}

/* ==================== 分割线 ==================== */
.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 20px 0;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

/* ==================== 响应式 ==================== */
@media (max-width: 480px) {
  .container {
    padding: 12px;
  }
  .page-title {
    font-size: 1.4rem;
  }
  .card {
    padding: 18px;
  }
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}
