* { box-sizing: border-box; margin: 0; padding: 0; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }
body { background: #1a1a2e; color: #eee; min-height: 100vh; }

/* ===== 响应式根字号 ===== */
html { font-size: 16px; }
@media (max-width: 768px) {
  html { font-size: 15px; }
}
@media (max-width: 480px) {
  html { font-size: 14px; }
}

h1 { text-align: center; padding: 12px; color: #e94560; font-size: 1.4rem; }
h3 { margin-bottom: 10px; font-size: 1rem; }
h4 { margin: 8px 0; font-size: 0.9rem; }

button {
  background: #e94560; color: #fff; border: none;
  padding: 8px 14px; border-radius: 6px; cursor: pointer;
  margin: 3px; font-size: 0.85rem; transition: opacity 0.15s;
}
button:disabled { background: #555; cursor: not-allowed; }
button:hover { opacity: 0.85; }
button.secondary { background: #0f3460; }
button.warn { background: #ffd166; color: #1a1a2e; }

input, select, textarea {
  padding: 8px; border-radius: 6px; border: 1px solid #444;
  background: #16213e; color: #eee; margin: 3px; font-size: 0.85rem;
  max-width: 100%;
}
label { display: inline-block; margin: 6px 0; font-size: 0.85rem; }

/* ===== 卡片 ===== */
.card {
  background: #16213e; border-radius: 10px; padding: 14px;
  margin: 10px auto; max-width: 640px;
}
.card-narrow { max-width: 480px; }

.hidden { display: none !important; }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px; border-bottom: 1px solid #333; text-align: left; font-size: 0.8rem; }
th { color: #aaa; }

/* ===== 日志 ===== */
.log {
  max-height: 200px; overflow-y: auto; font-size: 0.75rem;
  background: #0f3460; padding: 8px; border-radius: 6px;
}
.log div { margin-bottom: 3px; line-height: 1.4; }

/* ===== 座位圆环 ===== */
#seat-circle { position: relative; width: 340px; height: 340px; margin: 20px auto; }
.seat { position: absolute; width: 74px; text-align: center; transform: translate(-50%,-50%); cursor: pointer; transition: transform 0.15s; }
.seat:hover { transform: translate(-50%,-50%) scale(1.1); }
.seat img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid #0f3460; background: #0f3460; }
.seat.dead img { filter: grayscale(1); border-color: #900; }
.seat.mine img { border-color: #e94560; }
.seat .num { font-size: 0.7rem; color: #aaa; }
.seat .pname { font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 72px; }

@media (max-width: 480px) {
  #seat-circle { width: 280px; height: 280px; }
  .seat { width: 60px; }
  .seat img { width: 44px; height: 44px; }
  .seat .num, .seat .pname { font-size: 0.6rem; }
}

/* ===== 身份卡 ===== */
.role-badge {
  display: inline-block; background: #e94560; color: #fff;
  padding: 4px 12px; border-radius: 20px; font-size: 1.1rem; font-weight: bold;
}

/* ===== 重连提示 ===== */
.reconnect-bar { background: #ffd166; color: #1a1a2e; padding: 8px; text-align: center; font-weight: bold; font-size: 0.85rem; }

/* ===== 间谍魔典 ===== */
.grimoire-card { border: 2px solid #4a0080; }
.grimoire-card h3 { color: #c77dff; }

/* ===== 头像 ===== */
#avatar-preview { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-left: 10px; border: 2px solid #0f3460; }

/* ===== 局势信息框 ===== */
.game-status {
  background: #0f3460; border-radius: 8px; padding: 10px 14px;
  margin: 8px 0; font-size: 0.85rem; line-height: 1.6;
}
.game-status .phase-badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-weight: bold; font-size: 0.8rem;
}
.game-status .phase-day { background: #ffd166; color: #1a1a2e; }
.game-status .phase-night { background: #4a0080; color: #fff; }
.game-status .phase-setup { background: #555; color: #fff; }
.game-status .death-list { color: #e94560; margin-top: 4px; }

/* ===== 主持人首夜信息面板 ===== */
.fn-info-panel {
  background: #1a1a4e; border: 1px solid #4a4a8a; border-radius: 8px;
  padding: 12px; margin: 8px 0;
}
.fn-info-panel .drunk-row {
  background: #3a2a1e; border-left: 3px solid #ffd166; border-radius: 4px;
  padding: 8px; margin: 6px 0;
}
.fn-info-panel .role-info-preview {
  font-size: 0.75rem; color: #aaa; margin-top: 4px;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  h1 { font-size: 1.2rem; padding: 10px; }
  .card { padding: 12px; margin: 8px; border-radius: 8px; }
  button { padding: 7px 12px; font-size: 0.8rem; }
  input, select, textarea { font-size: 0.8rem; padding: 7px; }
  #seat-circle { width: 300px; height: 300px; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.1rem; padding: 8px; }
  .card { padding: 10px; margin: 6px; }
  button { padding: 6px 10px; font-size: 0.75rem; margin: 2px; }
  input, select, textarea { font-size: 0.75rem; padding: 6px; margin: 2px; }
  th, td { padding: 4px; font-size: 0.7rem; }
  .log { font-size: 0.7rem; max-height: 160px; }
  .role-badge { font-size: 0.95rem; padding: 3px 10px; }
  #seat-circle { width: 260px; height: 260px; }
  .seat { width: 56px; }
  .seat img { width: 40px; height: 40px; }
}

/* ===== 首夜信息角色标记 ===== */
.fn-role-tag {
  display: inline-block; background: #4a4a8a; color: #ccc;
  padding: 1px 6px; border-radius: 8px; font-size: 0.65rem; margin-left: 4px;
}
