@font-face {
  font-family: "MiSans";
  src: url("../data/MiSans-Medium.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}
:root {
  --bg: #F5F4F0;
  --bg-card: #FFFFFF;
  --text: #1a1a1a;
  --text-secondary: #999;
  --border: #e0ddd6;
  --border-light: #d0cdc5;
  --input-bg: #fff;
  --hover-bg: #eae8e2;
  --progress-bg: #e0ddd6;
  --correct-bg: #f0faf0;
  --wrong-bg: #fdf0f0;
}
[data-theme="dark"] {
  --bg: #0D1216;
  --bg-card: #151c22;
  --text: #d8d8d8;
  --text-secondary: #777;
  --border: #1e2830;
  --border-light: #28343e;
  --input-bg: #0D1216;
  --hover-bg: #1e2830;
  --progress-bg: #1e2830;
  --correct-bg: #0f1e14;
  --wrong-bg: #1e0f0f;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "MiSans", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  transition: background 0.3s, color 0.3s;
}
.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: background 0.3s;
}
.welcome-screen.hidden {
  display: none;
}
.welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 40px 50px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  transition: background 0.3s, border-color 0.3s;
}
.welcome-card h1 {
  font-size: 24px;
  margin-bottom: 25px;
}
.welcome-info {
  margin-bottom: 30px;
  text-align: left;
  padding-left: 20px;
}
.welcome-info p {
  margin-bottom: 8px;
  font-size: 15px;
}
.btn-start {
  padding: 12px 40px;
  font-size: 16px;
  cursor: pointer;
  background: #4CAF50;
  color: #fff;
  border: 1px solid #43A047;
}
.btn-start:hover {
  background: #43A047;
}
.welcome-footer {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.welcome-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 14px;
}
.welcome-footer a:hover {
  color: #666;
  text-decoration: underline;
}
.welcome-footer .footer-police img {
  width: 14px;
  height: 14px;
}
.theme-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.3s;
}
.theme-toggle:hover {
  opacity: 0.7;
}
.container {
  display: flex;
  height: 100vh;
  gap: 0;
}
.left-column {
  width: 220px;
  min-width: 220px;
  padding: 20px 10px;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.3s, border-color 0.3s;
}
.left-column h3 {
  margin-bottom: 15px;
  font-size: 16px;
  text-align: center;
}
.timer-display {
  font-size: 48px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  margin: 20px 0;
  color: var(--text);
}
.timer-display.warning {
  color: #e74c3c;
}
.timer-progress {
  width: 100%;
  height: 8px;
  background: var(--progress-bg);
  border: 1px solid var(--border-light);
}
.timer-progress-bar {
  height: 100%;
  background: #4CAF50;
  transition: width 1s linear;
}
.timer-progress-bar.warning {
  background: #e74c3c;
}
.site-footer {
  margin-top: auto;
  padding: 15px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-secondary);
  width: 100%;
}
.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  line-height: 14px;
}
.site-footer a:hover {
  color: #666;
  text-decoration: underline;
}
.site-footer .footer-police img {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.middle-column {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}
.middle-column h2 {
  margin-bottom: 15px;
  font-size: 20px;
}
.masonry {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.question-card {
  break-inside: avoid;
  margin-bottom: 15px;
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: background 0.3s, border-color 0.3s;
}
.question-card.correct {
  border-color: #4CAF50;
  background: var(--correct-bg);
}
.question-card.wrong {
  border-color: #e74c3c;
  background: var(--wrong-bg);
}
.question-card .q-number {
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 17px;
}
.question-card .q-text {
  margin-bottom: 12px;
  line-height: 1.8;
  font-size: 17px;
}
.question-card .q-options .option-item {
  display: flex;
  align-items: center;
  padding: 6px 0;
}
.question-card .q-options label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 16px;
  margin-left: 8px;
}
.question-card .q-options input[type="radio"] {
  margin-right: 0;
  transform: scale(1.1);
  flex-shrink: 0;
}
.question-card .q-result {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
  font-size: 15px;
}
.question-card .q-result.correct {
  color: #4CAF50;
}
.question-card .q-result.wrong {
  color: #e74c3c;
}
.question-card .q-result .result-correct {
  color: #4CAF50;
  font-weight: bold;
}
.question-card .q-result .result-wrong {
  color: #e74c3c;
  font-weight: bold;
}
.question-card .q-result .correct-answer {
  color: #4CAF50;
  font-weight: bold;
}
.question-card .q-result .wrong-answer {
  color: #e74c3c;
  font-weight: bold;
}
.right-column {
  width: 280px;
  min-width: 280px;
  padding: 20px;
  border-left: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  transition: background 0.3s, border-color 0.3s;
}
.right-column h3 {
  margin-bottom: 15px;
  font-size: 16px;
  text-align: center;
}
.answer-sheet {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 20px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
.answer-sheet .sheet-item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  font-size: 14px;
  cursor: default;
  background: var(--bg-card);
  color: var(--text);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}
.answer-sheet .sheet-item.answered {
  background: #4CAF50;
  color: #fff;
  border-color: #4CAF50;
}
.answer-sheet .sheet-item.correct-mark {
  background: #4CAF50;
  color: #fff;
  border-color: #4CAF50;
}
.answer-sheet .sheet-item.wrong-mark {
  background: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
}
.btn-submit {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  cursor: pointer;
  background: #4CAF50;
  color: #fff;
  border: 1px solid #43A047;
  margin-top: auto;
}
#score-area {
  margin-bottom: 10px;
}
.score-display {
  margin-top: 15px;
  padding: 15px;
  border: 1px solid var(--border);
  text-align: center;
  background: var(--bg-card);
}
.score-display .score-big {
  font-size: 32px;
  font-weight: bold;
  color: #4CAF50;
  margin-bottom: 5px;
}
.score-display .score-detail {
  font-size: 14px;
  color: var(--text-secondary);
}
.btn-submit:hover {
  background: #43A047;
}
.btn-submit:disabled {
  background: #ccc;
  border-color: #bbb;
  cursor: not-allowed;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: scale(0.9);
  transition: transform 0.3s, background 0.3s, border-color 0.3s;
}
.modal-overlay.active .modal-content {
  transform: scale(1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-light);
}
.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover {
  color: var(--text);
}
.modal-body {
  padding: 20px;
  line-height: 1.8;
  color: var(--text);
}
.modal-body p {
  margin-bottom: 10px;
}
.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
}
.modal-btn {
  padding: 10px 30px;
  font-size: 14px;
  cursor: pointer;
  background: #4CAF50;
  color: #fff;
  border: 1px solid #43A047;
  border-radius: 4px;
  transition: background 0.2s;
}
.modal-btn:hover {
  background: #43A047;
}
.password-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--border-light);
}
.password-section label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
}
.password-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.2s, background 0.3s, color 0.3s;
}
.password-input:focus {
  outline: none;
  border-color: #4CAF50;
}
.password-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 8px;
}
.modal-btn-cancel {
  background: #999;
  border-color: #888;
  margin-right: 10px;
}
.modal-btn-cancel:hover {
  background: #888;
}
.modal-btn-confirm {
  background: #4CAF50;
  border-color: #43A047;
}
.modal-btn-confirm:hover {
  background: #43A047;
}
