:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1b1e28;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hero {
  background: linear-gradient(120deg, #1d4ed8, #60a5fa);
  color: #fff;
  padding: 48px 16px;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.brand {
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.9;
}

.hero h1 {
  font-size: 32px;
  font-weight: 700;
}

.hero p {
  font-size: 16px;
  opacity: 0.9;
}

.container {
  max-width: 1100px;
  margin: -24px auto 40px;
  padding: 0 16px 40px;
  display: grid;
  gap: 32px;
}

.type-section,
.play-section {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.type-section h2,
.play-section h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.type-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: grid;
  gap: 6px;
  background: #fff;
}

.type-card:hover,
.type-card.active {
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.12);
}

.type-card .title {
  font-size: 16px;
  font-weight: 600;
}

.type-card .desc {
  font-size: 13px;
  color: var(--muted);
}

.play-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.play-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
}

.btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.board-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.board {
  display: grid;
  gap: 0;
  background: #fff;
  border: 2px solid var(--text);
  border-radius: 12px;
  overflow: hidden;
}

.cell {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  background: #fff;
  transition: background 0.15s ease;
}

.cell.selected {
  background: #e0e7ff;
}

.cell.fixed {
  background: #f3f4f6;
  font-weight: 600;
  cursor: default;
}

.cell.conflict {
  background: #fee2e2;
  color: var(--danger);
}

.cell.answer {
  color: var(--primary);
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.pad-btn {
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 16px;
  cursor: pointer;
}

.status {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 16px 40px;
  max-width: 1100px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.muted {
  color: var(--muted);
}

@media (max-width: 600px) {
  .cell {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .hero h1 {
    font-size: 26px;
  }
}
