/* 松阳千变双扣 - 出牌分析器样式 */

:root {
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --secondary: #3498db;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #dee2e6;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.header {
  text-align: center;
  padding: 20px 0;
}

.header h1 {
  font-size: 1.6rem;
  color: var(--primary);
}

.subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 4px;
}

.section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.section h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* 选牌区 */
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 4px;
  margin-bottom: 12px;
}

.picker-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  background: white;
  transition: all 0.15s;
  user-select: none;
  min-height: 38px;
  position: relative;
}

.picker-card:hover {
  border-color: var(--secondary);
  transform: translateY(-1px);
}

.picker-card.selected {
  border-color: var(--primary);
  background: #ffeaa7;
  transform: scale(1.05);
}

/* 统一出牌网格三状态：手牌(in-hand) / 本手待出(to-play) / 已出(played 置灰禁用) */
.round-grid .picker-card.in-hand {
  border-color: var(--secondary);
  background: #d6eaf8;
}
.round-grid .picker-card.to-play {
  border-color: var(--primary);
  background: #ffeaa7;
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--primary) inset;
}
.round-grid .picker-card.played {
  background: #e9ecef;
  border-color: #ced4da;
  color: #adb5bd !important;
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}
.round-grid .picker-card.played:hover {
  border-color: #ced4da;
  transform: none;
}

.picker-card.red { color: #e74c3c; }
.picker-card.black { color: #2c3e50; }
.picker-card.wild { color: #8e44ad; background: #f3e5f5; }

.picker-card .count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.picker-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hand-count {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* 手牌展示 */
.hand-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 44px;
  align-items: center;
}

.hand-cards .placeholder {
  color: var(--text-light);
  font-style: italic;
}

.hand-actions {
  margin-top: 12px;
  text-align: center;
}

.hand-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  background: white;
  cursor: pointer;
}

.hand-card:hover {
  background: #ffcccc;
  border-color: var(--danger);
}

.hand-card.red { color: #e74c3c; }
.hand-card.black { color: #2c3e50; }
.hand-card.wild { color: #8e44ad; background: #f3e5f5; }

/* 圆点单选按钮组（出牌方选择等复用） */
.radio-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 0;
}

.radio-label input[type="radio"] {
  display: none;
}

.radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-dot {
  border-color: var(--primary);
}

.radio-label input[type="radio"]:checked + .radio-dot::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* 按钮 */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: #ecf0f1;
  color: var(--text);
}

.btn-secondary:hover { background: #d5dbdb; }

.btn-large {
  padding: 12px 32px;
  font-size: 1.1rem;
}

/* 结果区 */
.results-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.tab {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab:hover { color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* 合并区子标签（选择手牌 / 三色标记） */
.subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.subtab {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.subtab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.subtab:hover { color: var(--primary); }

.subtab-content { display: none; }
.subtab-content.active { display: block; }

/* 拆牌结果 */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-items: start;
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.plan-card.best {
  border-color: var(--success);
  background: #f0fff4;
}

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

.plan-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.plan-moves {
  background: var(--secondary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.plan-groups {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 0.85rem;
}

.plan-group .type-tag {
  background: var(--secondary);
  color: white;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.plan-group .type-tag.bomb { background: var(--danger); }
.plan-group .type-tag.combo { background: var(--success); }

/* 推荐结果 */
.recommend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.recommend-item.top {
  border-color: var(--success);
  background: #f0fff4;
}

.recommend-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--secondary);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.recommend-item.top .recommend-rank {
  background: var(--success);
}

.recommend-body {
  flex: 1;
}

.recommend-cards {
  font-weight: 700;
  margin-bottom: 4px;
}

.recommend-reason {
  font-size: 0.82rem;
  color: var(--text-light);
}

/* 炸弹策略 */
.bomb-advice {
  padding: 12px;
}

.bomb-summary {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.bomb-detail {
  white-space: pre-line;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* 提示栏 */
.tip-bar {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 0.88rem;
}

/* 手牌强度 */
.strength-bar {
  margin-top: 12px;
  padding: 10px;
  background: #f0f0f0;
  border-radius: var(--radius);
}

.strength-meter {
  height: 8px;
  background: #ddd;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.strength-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.footer {
  text-align: center;
  padding: 20px 0;
  color: var(--text-light);
  font-size: 0.8rem;
}

/* 响应式 */
@media (max-width: 600px) {
  .app { padding: 8px; }
  .header h1 { font-size: 1.3rem; }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 3px; }
  .picker-card { font-size: 0.65rem; min-height: 32px; padding: 4px 1px; }
  .results-tabs { overflow-x: auto; }
  .plan-grid { grid-template-columns: 1fr; }

  /* 实战整局主菜单：标题 + 工具按钮压在同一行，溢出可横向滚动 */
  .round-head {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .round-head h2 {
    font-size: 0.95rem;
    flex-shrink: 0;
  }
  .round-tools {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .round-tools .btn-tool,
  .round-tools .btn-link-danger {
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 4px 8px;
    white-space: nowrap;
  }
}

/* 已出牌面板 */
.collapsible {
  cursor: pointer;
  user-select: none;
}

.collapsible:hover {
  color: var(--secondary);
}

.toggle-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: normal;
}

.played-hint {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.played-grid {
  max-height: 280px;
  overflow-y: auto;
}

/* 三色标记图例 */
.marker-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: var(--radius);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-red { background: #e74c3c; }
.dot-yellow { background: #f39c12; }
.dot-green { background: #27ae60; }

/* 三色标记状态 */
.picker-card.marker-red {
  border-color: #e74c3c !important;
  background: #fde8e8 !important;
  box-shadow: 0 0 0 2px #e74c3c;
}

.picker-card.marker-yellow {
  border-color: #f39c12 !important;
  background: #fef9e7 !important;
  box-shadow: 0 0 0 2px #f39c12;
}

.picker-card.marker-green {
  border-color: #27ae60 !important;
  background: #e8f8f0 !important;
  box-shadow: 0 0 0 2px #27ae60;
}

/* 标记计数颜色 */
.count-red { color: #e74c3c; font-weight: 700; }
.count-yellow { color: #f39c12; font-weight: 700; }
.count-green { color: #27ae60; font-weight: 700; }

/* 牌面推断 - 三色分区 */
.tracker-section {
  margin-bottom: 16px;
}

.tracker-section h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.tracker-red-section { border-left: 3px solid #e74c3c; padding-left: 10px; }
.tracker-yellow-section { border-left: 3px solid #f39c12; padding-left: 10px; }
.tracker-green-section { border-left: 3px solid #27ae60; padding-left: 10px; }
.tracker-players-section { border-left: 3px solid #3498db; padding-left: 10px; }

/* 核心牌 + 威胁牌 并排一行 */
.tracker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}
.tracker-row .tracker-section { margin-bottom: 0; }

/* 各玩家推断卡片 */
.player-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.player-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}
.player-card.ally { border-left: 3px solid #1e8449; }
.player-card.foe { border-left: 3px solid #c0392b; }
.player-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.player-name { font-weight: 700; font-size: 0.88rem; }
.player-remain { font-size: 0.78rem; color: var(--text-light); }
.player-insights { display: flex; flex-direction: column; gap: 4px; }
.player-insight {
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 3px 7px;
  border-radius: 4px;
  background: #f4f6f8;
}
.player-insight.lvl-warn { background: #fdecea; color: #c0392b; }
.player-insight.lvl-good { background: #eafaf1; color: #1e8449; }
.player-insight.lvl-info { background: #f4f6f8; color: var(--text); }

.tracker-color-summary {
  font-size: 0.88rem;
  margin-bottom: 8px;
  line-height: 1.5;
}

.tracker-keys {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tracker-key-item {
  padding: 6px 0;
}

.tracker-key-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 0.88rem;
}

.tracker-key-label span:first-child {
  font-weight: 700;
  font-size: 1rem;
}

.tracker-key-nums {
  font-size: 0.78rem;
  color: var(--text-light);
}

.tracker-bar {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.tracker-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.tracker-risks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tracker-risk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 0.85rem;
}

.tracker-risk-tag {
  color: white;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}

.tracker-risk-rank {
  font-weight: 700;
  min-width: 24px;
}

.tracker-risk-reason {
  color: var(--text-light);
  font-size: 0.8rem;
}

.tracker-risk-stars {
  color: #f39c12;
  font-size: 0.75rem;
}

.tracker-green-insights {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tracker-green-item {
  padding: 6px 10px;
  background: #e8f8f0;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* 动态标记建议 */
.tracker-tips-section {
  border-left: 3px solid #8e44ad;
  padding-left: 10px;
}

.tracker-tips {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tracker-tip-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #f8f4fc;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.tracker-tip-phase {
  color: white;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}

.tracker-summary pre {
  white-space: pre-line;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.8;
  background: #f0f8ff;
  padding: 10px;
  border-radius: var(--radius);
}

.tracker-threat {
  margin-bottom: 12px;
}

/* ============ 拍照识别 ============ */
.beta-tag {
  font-size: 0.6rem;
  background: var(--secondary);
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  vertical-align: middle;
  font-weight: 600;
}

.recognize-hint {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.recognize-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.file-btn {
  display: inline-flex;
  align-items: center;
}

.btn-link {
  background: none;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  margin-left: auto;
}

.btn-link:hover { text-decoration: underline; }

.api-settings {
  margin-top: 12px;
  padding: 12px;
  background: #f4f6f8;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.api-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.api-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.api-field label {
  width: 72px;
  font-size: 0.82rem;
  color: var(--text);
  flex-shrink: 0;
}

.api-field input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.api-warn {
  font-size: 0.76rem;
  color: var(--warning);
  margin-top: 6px;
}

.photo-preview {
  margin-top: 12px;
  text-align: center;
}

.photo-preview img {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.recognize-status {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.status-loading { background: #eaf2fb; color: var(--secondary); }
.status-success { background: #e8f8f0; color: var(--success); }
.status-error   { background: #fdecea; color: var(--danger); }

/* 校对面板 */
.proof-panel {
  margin-top: 16px;
  padding: 14px;
  background: #fffdf6;
  border: 1px solid #f0e6c8;
  border-radius: var(--radius);
}

.proof-panel h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.proof-total { font-size: 0.82rem; color: var(--text-light); font-weight: normal; }

.proof-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.proof-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.proof-item.red { color: #e74c3c; }
.proof-item.black { color: #2c3e50; }
.proof-item.wild { color: #8e44ad; background: #f3e5f5; }

.proof-label { font-weight: 700; font-size: 0.95rem; }

.proof-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.proof-step {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  background: #f4f6f8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--text);
}

.proof-step:hover { background: #e3e8ec; }

.proof-count { min-width: 14px; text-align: center; font-weight: 700; color: var(--text); }

.proof-empty { font-size: 0.85rem; color: var(--text-light); }

.proof-actions {
  display: flex;
  gap: 8px;
}

/* ============ 实战整局跟踪 ============ */
.round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.round-head h2 { margin: 0; }

/* 标题后工具按钮：三色标记 / 拍照识别 + 结束整局 */
.round-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-tool {
  font-size: 0.82rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.btn-tool.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 工具折叠面板 */
.tool-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  background: var(--bg);
}

/* 当前手牌头部：标题 + 重新分析按钮 */
.hand-display { margin-bottom: 12px; }
.hand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.hand-head h2 {
  margin: 0;
  font-size: 1.1rem;
}
.hand-head .hand-count { font-size: 0.85rem; color: var(--text-light); font-weight: 400; }

/* 待出标记：当前手牌中被选中准备打出的牌 */
.hand-card.to-play {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
  transform: translateY(-2px);
}

/* 四座：可点击切换当前出牌方 */
.seat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.seat-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: var(--radius);
  background: #f4f6f8;
  border: 2px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.seat-item:hover { border-color: var(--secondary); }

.seat-item .seat-name { font-size: 0.78rem; color: var(--text-light); }
.seat-item strong { font-size: 1.3rem; color: var(--text); }

/* 可编辑座位名输入框 */
.seat-name-input {
  width: 100%;
  text-align: center;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px dashed transparent;
  padding: 1px 2px;
  margin-bottom: 2px;
}
.seat-name-input:hover { border-bottom-color: var(--border); }
.seat-name-input:focus {
  outline: none;
  border-bottom-color: var(--secondary);
  background: #fff;
}
.seat-name-input[readonly] { cursor: default; color: var(--text-light); }

/* 队友/对手 圆点切换 */
.seat-team {
  margin-top: 4px;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: #fdecea;
  color: #c0392b;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.seat-team.is-partner {
  background: #eafaf1;
  color: #1e8449;
}
.seat-item[data-seat="self"] .seat-team,
.seat-item[data-seat="partner"] .seat-team { cursor: default; }

/* 当前轮到谁：高亮 + 显示箭头 */
.seat-item .seat-turn {
  position: absolute;
  top: -10px;
  font-size: 0.85rem;
  opacity: 0;
}
.seat-item.is-turn {
  border-color: var(--primary);
  background: #fff5f5;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
}
.seat-item.is-turn .seat-turn { opacity: 1; }
.seat-item.is-turn .seat-name,
.seat-item.is-turn .seat-name-input { color: var(--primary); font-weight: 700; }

/* 合并状态条：轮到谁 + 需压什么 */
.round-status {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.round-status.free-play { background: #e8f8f0; color: var(--success); }
.round-status.need-beat { background: #fff4e5; color: #e67e22; }

/* 出牌录入 */
.round-entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}

.entry-tip {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.round-grid {
  margin-bottom: 12px;
}

.entry-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* 主操作按钮：确认/PASS 等宽显眼 */
.btn-record { flex: 1; padding: 10px; font-size: 1rem; }

.btn-link-danger {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.82rem;
}
.btn-link-danger:hover { text-decoration: underline; }

/* 出牌历史 */
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.history-head h3 { font-size: 0.95rem; margin: 0; }

.history-list {
  max-height: 360px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.history-empty { font-size: 0.82rem; color: var(--text-light); grid-column: 1 / -1; }

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 0.85rem;
}

.history-item.is-pass { opacity: 0.6; }

.history-seat {
  flex-shrink: 0;
  min-width: 56px;
  font-weight: 700;
  color: var(--secondary);
}

/* 出牌历史中的 我方/对手 角标 */
.history-team {
  margin-left: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0 5px;
  border-radius: 8px;
  vertical-align: middle;
}
.history-team.ally { background: #eafaf1; color: #1e8449; }
.history-team.foe { background: #fdecea; color: #c0392b; }

.history-cards { color: var(--text); }

/* 历史局归档面板 */
.archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.archive-head h3 { font-size: 0.95rem; margin: 0; }
.archive-list {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.archive-game {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #fff;
}
.archive-game-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
}
.archive-plays {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.archive-play {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 0.82rem;
}
.archive-play.is-pass { opacity: 0.6; }

@media (max-width: 600px) {
  .round-grid { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 3px; }
  .seat-item strong { font-size: 1.1rem; }
  .seat-item .seat-name { font-size: 0.68rem; }
  .history-list { grid-template-columns: 1fr; }
  .archive-plays { grid-template-columns: 1fr; }
  .tracker-row { grid-template-columns: 1fr; }
}
