body {
  background: #f5f7fa;
  font-family: 'Segoe UI', '微软雅黑', Arial, sans-serif;
  margin: 0;
  padding: 0;
}
.container {
  max-width: 700px;
  margin: 40px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 32px 24px 24px 24px;
}
header {
  text-align: center;
  margin-bottom: 24px;
}
h1 {
  margin: 0 0 12px 0;
  color: #2d8cf0;
  font-size: 2.2em;
  letter-spacing: 2px;
}
.tabs {
  margin-bottom: 12px;
}
.tab-btn {
  background: #e5e7eb;
  border: none;
  border-radius: 6px 6px 0 0;
  padding: 8px 18px;
  margin-right: 4px;
  font-size: 1em;
  cursor: pointer;
  color: #333;
  transition: background 0.2s;
}
.tab-btn.active {
  background: #2d8cf0;
  color: #fff;
}
#progress {
  font-size: 1.1em;
  color: #666;
  margin-bottom: 8px;
}
#jump-area {
  margin-bottom: 10px;
}
#jump-input {
  width: 80px;
  padding: 4px 8px;
  font-size: 1em;
  border-radius: 4px;
  border: 1px solid #ccc;
}
#jump-btn {
  padding: 4px 14px;
  font-size: 1em;
  border: none;
  border-radius: 4px;
  background: #2d8cf0;
  color: #fff;
  cursor: pointer;
}
#question-area {
  font-size: 1.2em;
  margin-bottom: 18px;
  min-height: 48px;
}
#options-area {
  margin-bottom: 18px;
}
.option {
  display: block;
  background: #f0f4fa;
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s;
  border: 2px solid transparent;
}
.option.selected {
  background: #dbeafe;
  border-color: #2d8cf0;
}
.option.correct {
  background: #22c55e !important;
  border-color: #16a34a !important;
  color: #fff !important;
}
.option.wrong {
  background: #ef4444 !important;
  border-color: #b91c1c !important;
  color: #fff !important;
}
#actions {
  text-align: center;
  margin-bottom: 18px;
}
#actions button {
  margin: 0 8px 8px 0;
  padding: 8px 20px;
  font-size: 1em;
  border: none;
  border-radius: 6px;
  background: #2d8cf0;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
#actions button:disabled {
  background: #bcdffb;
  cursor: not-allowed;
}
#actions button#submit-btn {
  background: #10b981;
}
#result-area {
  font-size: 1.1em;
  color: #333;
  text-align: center;
  margin-top: 16px;
}
@media (max-width: 600px) {
  html, body {
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }
  body {
    font-size: 1.08em;
    background: #f5f7fa;
  }
  .container {
    width: 100vw;
    min-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    box-shadow: none;
    padding: 8px 2vw 16vw 2vw;
  }
  h1 {
    font-size: 1.2em;
    margin-bottom: 8px;
  }
  .tabs {
    font-size: 1em;
    margin-bottom: 8px;
  }
  .tab-btn {
    padding: 7px 10px;
    font-size: 1em;
    margin-right: 2px;
  }
  .top-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-bottom: 8px;
  }
  #search-input, #jump-input {
    width: 100%;
    font-size: 1em;
    padding: 8px 10px;
    margin-bottom: 4px;
    box-sizing: border-box;
  }
  #night-mode-btn, #jump-btn {
    width: 100%;
    font-size: 1em;
    padding: 8px 0;
    margin-bottom: 4px;
  }
  #question-area {
    font-size: 1.1em;
    min-height: 40px;
    margin-bottom: 12px;
    word-break: break-all;
  }
  #options-area {
    margin-bottom: 12px;
  }
  .option {
    font-size: 1.08em;
    padding: 14px 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    min-height: 44px;
  }
  #actions {
    margin-bottom: 12px;
  }
  #actions button {
    width: 100%;
    font-size: 1.08em;
    padding: 12px 0;
    margin: 0 0 8px 0;
    border-radius: 8px;
  }
  #result-area {
    font-size: 1.08em;
    margin-top: 10px;
  }
  .fav-btn {
    font-size: 1.6em;
    margin-left: 6px;
  }
}
.top-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}
#search-input {
  padding: 10px 16px;
  font-size: 1.08em;
  border-radius: 24px;
  border: 1.5px solid #d1d5db;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(45,140,240,0.06);
  width: 220px;
  max-width: 60vw;
}
#search-input:focus {
  border-color: #2d8cf0;
  background: #fff;
  box-shadow: 0 2px 12px rgba(45,140,240,0.13);
}
#night-mode-btn {
  padding: 8px 18px;
  font-size: 1em;
  border-radius: 20px;
  border: none;
  background: #333;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
#night-mode-btn:hover {
  background: #2d8cf0;
  color: #fff;
}
body.night {
  background: #181c25;
  color: #e5e7eb;
}
body.night .container {
  background: #23283a;
  color: #e5e7eb;
}
body.night .option {
  background: #23283a;
  color: #e5e7eb;
}
body.night .option.selected {
  background: #2d8cf0;
  color: #fff;
}
body.night .option.correct {
  background: #1e3a1e;
  color: #10b981;
}
body.night .option.wrong {
  background: #3a1e1e;
  color: #ef4444;
}
body.night #night-mode-btn {
  background: #e5e7eb;
  color: #23283a;
}
.fav-btn {
  float: right;
  font-size: 1.5em;
  color: #f59e42;
  cursor: pointer;
  user-select: none;
}
.fav-btn.faved {
  color: #f59e42;
}
.fav-btn.not-faved {
  color: #ccc;
}
.main-title {
  margin: 0 0 6px 0;
  color: #2d8cf0;
  font-size: 2.1em;
  letter-spacing: 2px;
  font-weight: 700;
  font-family: 'Segoe UI', '微软雅黑', Arial, sans-serif;
  text-shadow: 1px 2px 8px rgba(45,140,240,0.08);
}
.subtitle {
  margin: 0 0 18px 0;
  color: #888;
  font-size: 1.08em;
  font-weight: 400;
  letter-spacing: 1px;
  font-family: 'Segoe UI', '微软雅黑', Arial, sans-serif;
}
@media (max-width: 600px) {
  .main-title {
    font-size: 1.18em;
    margin-bottom: 2px;
  }
  .subtitle {
    font-size: 0.98em;
    margin-bottom: 10px;
  }
}
body.mobile-ui {
  background: #f5f7fa;
}
body.mobile-ui .container {
  width: 100vw;
  min-height: 100vh;
  max-width: 100vw;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
body.mobile-ui header {
  padding: 12px 8px 0 8px;
  text-align: left;
}
body.mobile-ui .main-title {
  font-size: 1.1em;
  margin-bottom: 2px;
}
body.mobile-ui .subtitle {
  font-size: 0.9em;
  margin-bottom: 6px;
}
body.mobile-ui .top-tools {
  flex-direction: row;
  gap: 6px;
  margin-bottom: 6px;
}
body.mobile-ui #search-input {
  width: 100%;
  max-width: 100vw;
  font-size: 1em;
  padding: 10px 12px;
  border-radius: 18px;
  margin-bottom: 0;
}
body.mobile-ui #night-mode-btn {
  width: auto;
  font-size: 1em;
  padding: 8px 12px;
  border-radius: 18px;
  margin-bottom: 0;
}
body.mobile-ui .tabs {
  display: flex !important;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100vw;
  max-width: 100vw;
  padding: 0 2vw;
  margin: 0 0 8px 0;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 50;
}
body.mobile-ui .tab-btn {
  flex: 1;
  margin: 0 2px;
  padding: 12px 0;
  font-size: 1.08em;
  border-radius: 0;
  background: none;
  border: none;
  color: #2d8cf0;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
body.mobile-ui .tab-btn.active {
  background: #2d8cf0;
  color: #fff;
  border-radius: 8px 8px 0 0;
}
body.mobile-ui #question-area {
  font-size: 1.1em;
  min-height: 40px;
  margin-bottom: 10px;
  word-break: break-all;
  padding: 0 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
body.mobile-ui #options-area {
  margin-bottom: 10px;
  padding: 0 10px;
}
body.mobile-ui .option {
  font-size: 1.1em;
  padding: 18px 12px;
  margin-bottom: 12px;
  border-radius: 12px;
  min-height: 48px;
}
body.mobile-ui #actions {
  margin-bottom: 10px;
  padding: 0 10px;
}
body.mobile-ui #actions button {
  width: 100%;
  font-size: 1.1em;
  padding: 16px 0;
  margin: 0 0 10px 0;
  border-radius: 12px;
}
body.mobile-ui #result-area {
  font-size: 1.1em;
  margin-top: 10px;
  padding: 0 10px;
}
body.mobile-ui .fav-btn {
  font-size: 1.5em;
  margin-left: 8px;
}
body.mobile-ui .mobile-bottom-actions {
  position: fixed;
  left: 0; right: 0; bottom: 56px; /* 56px为底部Tab栏高度 */
  width: 100vw;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 0 8px 0;
}
body.mobile-ui #mobile-action-btn {
  width: 92vw;
  max-width: 480px;
  font-size: 1.18em;
  padding: 16px 0;
  border-radius: 32px;
  border: none;
  background: #2d8cf0;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(45,140,240,0.08);
  margin: 0 auto;
  display: block;
}
body.mobile-ui #mobile-action-btn:active {
  background: #1d6fd2;
}
/*body.mobile-ui #actions {*/
/*  display: none !important;*/
/*}*/
body.mobile-ui #options-area {
  margin-bottom: 80px; /* 留出底部按钮空间 */
}
body.mobile-ui .bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 56px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}
body.mobile-ui .bottom-nav-btn {
  flex: 1;
  text-align: center;
  font-size: 1em;
  color: #2d8cf0;
  background: none;
  border: none;
  padding: 0;
  height: 100%;
  line-height: 56px;
}
body.mobile-ui .bottom-nav-btn.active {
  color: #fff;
  background: #2d8cf0;
}
/* 收藏夹竖向卡片排布 */
body .fav-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 10px 0;
}
body .fav-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(45,140,240,0.08);
  padding: 18px 16px 12px 16px;
  margin: 0 8px;
  transition: box-shadow 0.2s;
}
body .fav-card:hover {
  box-shadow: 0 4px 20px rgba(45,140,240,0.16);
}
body.night .fav-card {
  background: #23283a !important;
  color: #e5e7eb !important;
  box-shadow: 0 2px 12px rgba(45,140,240,0.13);
}
@media (max-width: 600px) {
  body .fav-list {
    max-height: 68vh;
    gap: 14px;
    padding: 6px 0;
  }
  body .fav-card {
    padding: 14px 8px 10px 8px;
    margin: 0 2px;
    border-radius: 10px;
  }
}
#question-nav {
  margin: 18px 0 24px 0;
  padding: 18px 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(45,140,240,0.06);
  font-size: 1.08em;
}
.qnav-group-title {
  font-weight: bold;
  margin: 0 0 10px 0;
}
.qnav-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}
.qnav-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #e6f0ff;
  color: #2d8cf0;
  font-size: 1.15em;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  outline: none;
  font-weight: 500;
}
.qnav-btn.current {
  background: #2d8cf0;
  color: #fff;
  font-weight: bold;
}
.qnav-btn.answered {
  border: 2px solid #10b981;
}
@media (max-width: 600px) {
  #question-nav {
    padding: 10px 2vw;
    font-size: 1em;
    margin: 10px 0 12px 0;
    border-radius: 10px;
  }
  .qnav-btns {
    gap: 10px;
    margin-bottom: 12px;
  }
  .qnav-btn {
    width: 36px;
    height: 36px;
    font-size: 1em;
    border-radius: 7px;
  }
}

