* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
  font-family: "Microsoft YaHei", "YouYuan", "幼圆", sans-serif !important; 
}

body {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

#fireworks-container {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9999;
  display: none;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  background: #fff;
  border-radius: 24px;
  padding: 30px 15px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.12);
  z-index: 10;
  width: 100%;
}

#login-page { text-align: center; padding: 20px 10px; }
#menu-page { text-align: center; padding: 20px 10px; display: none; }
#practice-page { text-align: center; padding: 20px 10px; display: none; }

.login-title {
  font-size: 24px;
  color: #ff6b6b;
  margin-bottom: 12px;
  font-weight: 800;
  text-shadow: 2px 2px 4px rgba(255, 107, 107, 0.2);
}

.login-subtitle {
  color: #868e96;
  font-size: 18px;
  margin-bottom: 35px;
  line-height: 1.5;
}

.name-input {
  width: 260px;
  height: 60px;
  font-size: 24px;
  text-align: center;
  border: 3px solid #ffd93d;
  border-radius: 16px;
  margin-bottom: 15px;
  box-shadow: 0 3px 8px rgba(255, 217, 61, 0.2);
  pointer-events: auto;
  user-select: auto;
  outline: none;
}

.name-input:focus {
  border-color: #ff6b6b;
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
  outline: none;
}

select.name-input {
  -webkit-appearance: none;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.start-btn, .history-btn, .practice-btn {
  width: 260px;
  padding: 18px 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 20px;
  margin: 10px auto;
  display: block;
  border: none;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  color: white; 
}

.start-btn {
  background: linear-gradient(to right, #74f2ce, #4ecdc4);
  box-shadow: 0 6px 18px rgba(78, 205, 196, 0.4);
}

.start-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(78, 205, 196, 0.5);
}

/* ====================== 加载动画样式 ====================== */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.start-btn:disabled {
  background: linear-gradient(to right, #74f2ce, #4ecdc4) !important;
  opacity: 0.7 !important;
  cursor: wait !important;
  transform: none !important;
  box-shadow: 0 6px 18px rgba(78, 205, 196, 0.4) !important;
}

.practice-btn {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  box-shadow: 0 6px 18px rgba(250, 112, 154, 0.4);
}

.history-btn {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  box-shadow: 0 6px 18px rgba(168, 237, 234, 0.4);
  color: #333;
}

#login-error {
  color: #ff6b6b;
  font-size: 16px;
  margin-top: 15px;
  display: none;
}

.header { text-align: center; margin-bottom: 20px; }
.user-welcome { 
  font-size: 24px;
  color: #ff5733;
  font-weight: bold; 
  text-align: center; 
  margin: 12px 0; 
  text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.timer-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: #f8f9fa; padding: 12px 20px; border-radius: 12px;
  margin-bottom: 20px; border: 1px solid #eee;
}

.timer { font-size: 24px; font-weight: 800; color: #e74c3c; font-family: monospace; }
.progress { font-size: 16px; color: #3498db; font-weight: bold; }

.question-box {
  background: #f1f8fe; border-radius: 15px; padding: 25px 15px;
  text-align: center; margin-bottom: 25px; min-height: 280px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  border: 2px solid #e1e8ed;
  width: 100%;
}

/* ====================== 普通题目：不换行、自适应 ====================== */
.question-text { 
  font-size: 22px;
  font-weight: bold; 
  color: #2c3e50; 
  margin-bottom: 15px; 
  line-height: 1.4;
  display: block;
  text-align: center;
  white-space: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  width: 100%;
  padding: 5px 0;
}

/* ====================== 应用题专属样式 ====================== */
.word-problem-wrapper {
  width: 100% !important;
  padding: 0 10px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-x: auto !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.word-problem-wrapper .answer-row {
  display: flex;
  align-items: center;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 4px;
  margin: 8px 0 !important;
  padding-left: 0 !important;
  width: 100%;
  white-space: nowrap !important;
  overflow-x: auto !important;
  max-width: 100% !important;
}

.word-problem-wrapper .eq-break {
  display: block !important;
  margin: 6px 0 !important;
  text-align: center !important;
  line-height: 1.5 !important;
}

.word-problem-wrapper .step-two-row {
  margin-top: 18px !important;
}

.word-problem-wrapper .answer-row:last-of-type {
  margin-top: 15px !important;
}

/* ====================== 普通题目输入框 ====================== */
.answer-input, .fill-input {
  font-size: 24px; 
  text-align: center; 
  border: 2px solid #3498db;
  border-radius: 8px; 
  outline: none; 
  transition: all 0.3s;
  font-weight: bold; 
  color: #2c3e50;
  pointer-events: auto;
  width: 55px;
  height: 40px;
  display: inline-block;
  vertical-align: middle;
}

.answer-input:focus, .fill-input:focus { 
  border-color: #ff6b6b; 
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.3); 
}

.inline-answer-input {
  font-size: 20px !important;
  text-align: center;
  border: 2px solid #3498db;
  border-radius: 6px;
  outline: none;
  transition: all 0.3s;
  font-weight: bold;
  color: #2c3e50;
  pointer-events: auto;
  width: 42px !important;
  height: 32px !important;
  display: inline-block;
  vertical-align: middle;
  margin: 0 2px;
  line-height: 1;
}

.inline-answer-input:focus {
  border-color: #ff6b6b;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.3);
}

.ans-inp, .unit-inp {
  font-size: 18px !important;
  text-align: center;
  border: 2px solid #3498db;
  border-radius: 6px;
  outline: none;
  transition: all 0.3s;
  font-weight: bold;
  color: #2c3e50;
  pointer-events: auto;
  width: 40px !important;
  height: 30px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin: 0 2px;
}

.unit-inp {
  cursor: pointer;
  width: 60px;
}

.unit-inp {
  width: 48px !important;
  cursor: pointer;
  margin-left: 1px;
  min-width: 40px;
}

.ans-inp:focus, .unit-inp:focus { 
  border-color: #ff6b6b; 
  box-shadow: 0 0 6px rgba(255, 107, 107, 0.3); 
}

.answer-row span {
  font-size: 22px;
  font-weight: bold;
  color: #2c3e50;
  margin: 0 2px;
}

.answer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 12px;
}

.fill-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fill-label {
  font-size: 20px;
  color: #2c3e50;
  font-weight: bold;
  line-height: 1;
  vertical-align: middle;
}

.label-text { font-size: 20px; color: #2c3e50; font-weight: bold; }

.unit-select {
  font-size: 20px;
  padding: 6px 4px;
  border: 2px solid #3498db;
  border-radius: 8px;
  outline: none;
  background: #fff;
  min-width: 60px;
  text-align: center;
  vertical-align: middle;
}

.btn-group { display: flex; justify-content: center; gap: 15px; margin-bottom: 20px; }

.btn {
  padding: 14px 35px; font-size: 20px; border: none; border-radius: 50px;
  cursor: pointer; transition: all 0.3s; font-weight: bold; color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.next-btn { background: linear-gradient(to right, #3498db, #2980b9); }
.submit-btn { background: linear-gradient(to right, #e74c3c, #c0392b); }
.retry-btn { background: linear-gradient(to right, #f39c12, #d35400); }

.btn:disabled { background: #bdc3c7; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.15); }

/* ====================== 结果页样式 ====================== */
.result-page { display: none; text-align: center; animation: fadeIn 0.5s; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0px); } }

.score-card {
  background: linear-gradient(135deg, #fff, #f0f9ff);
  border: 3px solid #3498db; border-radius: 20px;
  padding: 30px; margin: 20px 0;
  box-shadow: 0 10px 25px rgba(52, 159, 219, 0.2);
}

.student-name-display { font-size: 24px; color: #7f8c8d; margin-bottom: 10px; font-weight: bold; }

.final-score-big {
  font-size: 36px; font-weight: 900; white-space: nowrap;
  background: linear-gradient(to right, #e74c3c, #f39c12);
  -webkit-background-clip: text;
  background-clip: text;   
  -webkit-text-fill-color: transparent;
  margin: 10px 0; line-height: 1.2;
}

.score-details { 
  font-size: 14px; 
  color: #2c3e50; 
  margin-top: 10px; 
  font-weight: bold; 
  white-space: nowrap; 
}

.timestamp-display {
  margin-top: 15px;
  font-size: 16px;
  color: #555;
  font-family: monospace;
  background: #ecf0f1;
  display: inline-block;
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid #bdc3c7;
}

.result-title { font-size: 26px; color: #2d3436; margin-top: 20px; font-weight: bold; }

.perfect-title {
  color: #e74c3c; font-size: 30px;
  text-shadow: 0 0 15px #ffd700; animation: flash 1s infinite alternate;
}

@keyframes flash { from { opacity: 0.8; } to { opacity: 1; text-shadow: 0 0 20px #ffd700; } }

/* ====================== 订正阶段样式 ====================== */
.correction-stage {
  display: none;
  margin-top: 20px;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0px); } }

.correction-header {
  background: #fff3cd;
  color: #856404;
  padding: 15px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 20px;
  border: 2px solid #ffeeba;
}

.correction-feedback-msg {
  margin-top: 15px;
  font-size: 20px;
  font-weight: bold;
  min-height: 30px;
  text-align: center;
}

.feedback-ok { color: #27ae60; }
.feedback-wait { color: #e67e29; }
.feedback-error { color: #e74c3c; }

.final-success-banner {
  display: none;
  margin-top: 30px;
  background: linear-gradient(to right, #2ecc71, #27ae60);
  color: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(46, 204, 113, 0.4);
  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-title { font-size: 24px; font-weight: 900; margin-bottom: 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.success-subtitle { font-size: 18px; opacity: 0.9; }

@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.final-wrong-list {
  display: none;
  text-align: left;
  background: #fdf2f2;
  border-radius: 12px;
  padding: 20px;
  margin: 25px 0;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #fecaca;
}

.wrong-item {
  font-size: 18px; margin: 8px 0; padding: 10px;
  border-bottom: 1px dashed #ffc0c0; background: #fff;
  border-radius: 5px;
}

.wrong-text { color: #e74c3c; font-weight: bold; }
.correct-text { color: #27ae60; font-weight: bold; margin-left: 10px; }

/* ====================== 钟表题样式 ====================== */
.clock-wrapper { 
  margin: 15px auto; 
  --clock-size: 220px; 
  width: var(--clock-size); 
  height: var(--clock-size); 
  position: relative; 
}

.clock-face { 
  width: 100%; 
  height: 100%; 
  border-radius: 50%; 
  border: 4px solid #2c3e50; 
  background: #fff; 
  position: relative; 
}

.clock-center-dot { 
  position: absolute; 
  top: 50%; 
  left: 50%; 
  width: 14px; 
  height: 14px; 
  background: #e74c3c; 
  border: 2px solid #fff; 
  border-radius: 50%; 
  transform: translate(-50%, -50%); 
  z-index: 30; 
}

.clock-ticks, .clock-numbers, .clock-hands { 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  pointer-events: none; 
}

.tick { position: absolute; top: 0; left: 50%; width: 2px; background: #2c3e50; transform-origin: 50% var(--inner-radius); margin-left: -1px; height: 0; }
.tick.minute { height: 8px; background: #95a5a6; width: 1px; margin-left: -0.5px; }
.tick.hour { height: 16px; background: #2c3e50; width: 3px; margin-left: -1.5px; z-index: 2; }

.clock-number { 
  position: absolute; 
  width: 30px; 
  height: 30px; 
  text-align: center; 
  line-height: 30px; 
  font-weight: bold; 
  color: #2c3e50; 
  font-size: 18px; 
  transform: translate(-50%, -50%); 
}

.hand { 
  position: absolute; 
  bottom: 50%; 
  left: 50%; 
  transform-origin: bottom center; 
  transform: translateX(-50%) rotate(0deg); 
  border-radius: 4px 4px 0 0; 
  transition: transform 0.6s cubic-bezier(0.4, 2.5, 0.6, 0.8); 
}

.hour-hand { 
  width: 8px; 
  height: 35%; 
  max-height: 55px; 
  background: #2c3e50; 
  z-index: 10; 
}

.minute-hand { 
  width: 5px; 
  height: 45%; 
  max-height: 75px; 
  background: #e74c3c; 
  z-index: 15; 
}

.clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.clock-input-area {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.clock-input-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.clock-input-item input {
  width: 70px;
  height: 50px;
  font-size: 24px;
  text-align: center;
  border: 2px solid #3498db;
  border-radius: 12px;
}

.clock-input-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.clock-input-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.clock-input-item input {
  width: 70px;
  height: 50px;
  font-size: 24px;
  text-align: center;
  border: 2px solid #3498db;
  border-radius: 12px;
}

.special-question-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 10px;
}

input[type=number]:focus { 
  scroll-margin-bottom: 220px; 
}

/* ====================== 符号选择器样式 ====================== */
.symbol-inp {
  width: 40px;
  height: 26px;
  font-size: 18px;
  text-align: center;
  border: 2px solid #3498db;
  border-radius: 6px;
  outline: none;
  transition: all 0.3s;
  font-weight: bold;
  color: #2c3e50;
  cursor: pointer;
  margin: 0 4px;
}

.symbol-inp:focus {
  border-color: #ff6b6b;
  box-shadow: 0 0 6px rgba(255, 107, 107, 0.3);
}

/* ====================== 找规律题样式 ====================== */
.cycle-color-boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 15px 0;
}

.cycle-box {
  width: 45px;
  height: 45px;
  border: 2px solid #2c3e50;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.cycle-box.red { background: #e74c3c; }
.cycle-box.yellow { background: #f39c12; }
.cycle-box.blue { background: #3498db; }

.unit-bracket {
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  margin: 0 2px;
}

.cycle-seq-boxes {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.shape-select-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: 8px;
}

.shape-radio {
  cursor: pointer;
  position: relative;
}

.shape-radio input[type="radio"] {
  display: none;
}

.shape-radio input[type="radio"]:checked + .cycle-box {
  border: 3px solid #e74c3c;
  transform: scale(1.1);
}

.cycle-shapes-row span {
  font-size: 20px !important;
  line-height: 1;
  padding: 0;
  border: none !important;
  background: transparent !important;
}

.hide-remain {
  display: none !important;
}

.shape-select-input {
  width: clamp(60px, 15vw, 80px) !important;
  height: clamp(30px, 7vw, 36px) !important;
  font-size: clamp(20px, 5vw, 24px) !important;
  border: 2px solid #3498db !important;
  border-radius: 6px !important;
  text-align: center !important;
  cursor: pointer !important;
  margin-left: 4px !important;
  outline: none;
  transition: all 0.3s;
}

.shape-select-input:focus {
  border-color: #27ae60 !important;
}

/* 找规律题图形样式 */
.cycle-shapes-row {
  display: flex !important;
  gap: 6px !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  margin: 10px 0 !important;
  font-size: 24px !important;
  overflow-x: auto !important;
  padding: 0 5px !important;
}

.cycle-shape-item {
  display: inline-block !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  text-align: center !important;
  flex-shrink: 0 !important;
}

.answer-label {
  font-weight: bold !important;
}

.answer-shape-display {
  min-width: 30px;
  display: inline-block;
  text-align: center;
}

/* ====================== 时间计算题样式 ====================== */
.time-calc-container {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 5px !important;
  white-space: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
}

.time-calc-input {
  width: 45px;
  height: 36px;
  font-size: 18px;
  text-align: center;
  border: 2px solid #3498db;
  border-radius: 6px;
}

.time-label {
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  white-space: nowrap;
}

/* ====================== PK对战中心样式 ====================== */
.pk-tab.active {
  background: white !important;
  color: #667eea !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pk-tab:hover {
  background: rgba(255,255,255,0.1) !important;
  color: white !important;
}

#pk-start-match-btn[data-matching="true"] {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
  }
  50% {
    box-shadow: 0 5px 25px rgba(255, 107, 107, 0.7);
  }
  100% {
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
  }
}

#pk-target-name:focus, #pk-reason:focus {
  outline: none;
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

/* ====================== 灵动岛通知样式 ====================== */
@keyframes 灵动岛浮动 {
  0%, 100% { transform: translateX(-50%) translateY(0px); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

/* ====================== 响应式设计 ====================== */
@media (max-width: 768px) {
  #pk-page {
    padding: 15px;
  }
  
  .pk-header h2 {
    font-size: 24px;
  }
  
  .pk-panel {
    padding: 20px !important;
  }
  
  .pk-status-box {
    padding: 20px !important;
    font-size: 16px !important;
  }
  
  .btn {
    padding: 15px 30px !important;
    font-size: 16px !important;
  }
  
  .container { padding: 20px 10px; }
  .login-title { font-size: 20px; }
  .name-input { width: 90%; font-size: 20px; }
  .start-btn, .practice-btn, .history-btn { width: 90%; font-size: 20px; }
  .question-text { font-size: 22px; }
  .clock-wrapper { --clock-size: 160px; }
  
  #scroll-notification {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
  }
}

@media (max-width: 600px) {
  .container { padding: 15px 8px; }
  .question-box { padding: 15px 8px; }

  /* 普通计算题字体 & 输入框放大 */
  .question-text {
    font-size: clamp(20px, 5.5vw, 24px) !important;
    line-height: 1.5 !important;
  }
  
  .answer-row span {
    font-size: clamp(20px, 5vw, 24px) !important;
  }
  
  .inline-answer-input {
    width: clamp(40px, 10vw, 46px) !important;
    height: clamp(30px, 7vw, 36px) !important;
    font-size: clamp(18px, 4vw, 22px) !important;
  }

  /* 时间计算题目移动端优化 - 允许在小屏幕上换行 */
  .time-calc-container {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    white-space: normal !important;
  }
  
  /* 时间计算题目响应式布局 */
  @media (max-width: 480px) {
    .time-calc-container {
      flex-direction: column !important;
      gap: 8px !important;
    }
    
    .time-calc-container > span {
      font-size: clamp(14px, 4vw, 18px) !important;
    }
    
    .time-calc-container .time-label {
      font-size: clamp(14px, 4vw, 18px) !important;
    }
  }
  
  .time-calc-input {
    width: clamp(35px, 8vw, 45px) !important;
    height: clamp(30px, 7vw, 36px) !important;
    font-size: clamp(16px, 3.5vw, 20px) !important;
    flex-shrink: 0 !important;
  }
  
  .time-label {
    white-space: nowrap !important;
    font-size: clamp(16px, 3.5vw, 20px) !important;
    flex-shrink: 0 !important;
  }
  
  /* 解决问题题目移动端优化 */
  .word-problem-wrapper {
    padding: 0 5px !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
  }
  
  .word-problem-wrapper .question-text {
    font-size: clamp(16px, 4vw, 18px) !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    line-height: 1.4 !important;
    margin-bottom: 10px !important;
  }
  
  .word-problem-wrapper .answer-row {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    padding: 0 5px !important;
  }
  
  .word-problem-wrapper .ans-inp {
    width: clamp(35px, 8vw, 45px) !important;
    height: clamp(28px, 6vw, 32px) !important;
    font-size: clamp(16px, 3.5vw, 18px) !important;
    flex-shrink: 0 !important;
  }
  
  .word-problem-wrapper .unit-inp {
    width: clamp(40px, 9vw, 50px) !important;
    height: clamp(28px, 6vw, 32px) !important;
    font-size: clamp(16px, 3.5vw, 18px) !important;
    flex-shrink: 0 !important;
  }
  
  .word-problem-wrapper .symbol-inp {
    width: clamp(35px, 8vw, 45px) !important;
    height: clamp(28px, 6vw, 32px) !important;
    font-size: clamp(16px, 3.5vw, 18px) !important;
    flex-shrink: 0 !important;
  }
  
  .word-problem-wrapper .answer-row span {
    font-size: clamp(16px, 3.5vw, 18px) !important;
    flex-shrink: 0 !important;
  }
  
  /* 找规律题移动端优化 */
  .cycle-shapes-row {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding: 0 5px !important;
  }
  
  .shape-select-input {
    width: clamp(60px, 15vw, 80px) !important;
    height: clamp(30px, 7vw, 36px) !important;
    font-size: clamp(20px, 5vw, 24px) !important;
  }

  /* 以下原样不动，避免影响钟表题、应用题 */
  .ans-inp, .unit-inp { width: 32px !important; height: 26px !important; font-size: 15px !important; }
  .unit-inp { width: 40px !important; } /* 移动端进一步减少单位选框宽度 */
  .answer-input, .fill-input { width: 32px; height: 32px; font-size: 15px; }
  
  /* 有余数除法移动端适配 */
  .question-text:has(.answer-input) {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
  }
  
  .question-text:has(.answer-input) span {
    font-size: clamp(16px, 4vw, 18px) !important;
  }
  .btn { padding: 12px 25px; font-size: 18px; }
  .clock-wrapper { --clock-size: 160px; }
  .clock-number { font-size: 14px; }
  .final-score-big { font-size: 32px; }
  .success-title { font-size: 22px; }
  .fill-label { font-size: 18px; }
  .clock-input-item input { width: 50px; height: 40px; font-size: 18px; }
  .clock-container { flex-direction: column; align-items: center; gap: 15px; }
  .clock-input-area { gap: 12px; }
  
  /* 应用题手机端终极优化 */
  .word-problem-wrapper {
    font-size: clamp(15px, 3.8vw, 17px) !important;
    padding: 0 3px !important;
    line-height: 1.5 !important;
  }

  .word-problem-wrapper .eq-break {
    margin: 6px 0 !important;
  }

  .word-problem-wrapper .ans-inp,
  .word-problem-wrapper .symbol-inp {
    width: clamp(28px, 6vw, 32px) !important;
    height: clamp(24px, 5.5vw, 28px) !important;
    font-size: clamp(13px, 3.2vw, 15px) !important;
  }
  
  .word-problem-wrapper .unit-inp {
    width: clamp(36px, 8vw, 42px) !important;
    font-size: clamp(12px, 3vw, 14px) !important;
    min-width: 32px;
  }

  /* 找规律题图形手机端适配 */
  .cycle-shapes-row span {
    font-size: clamp(16px, 4vw, 18px) !important;
  }

  /* 找规律题算式手机端不换行 */
  .cycle-shapes-row + .question-text + .answer-row {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    width: 100% !important;
    justify-content: flex-start !important;
    padding-bottom: 5px;
  }
  
  /* 普通题目移动端放大，钟表题 & 应用题完全不动 */
  .question-text {
    font-size: clamp(20px, 5.5vw, 24px) !important;
    line-height: 1.5 !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
  }
  .answer-row span {
    font-size: clamp(20px, 5vw, 24px) !important;
  }
  .inline-answer-input {
    width: clamp(40px, 10vw, 46px) !important;
    height: clamp(30px, 7vw, 36px) !important;
    font-size: clamp(18px, 4vw, 22px) !important;
  }
  
  .word-problem-wrapper .answer-row {
    margin: 4px 0 !important;
  }
  
  .word-problem-wrapper .answer-row {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 2px !important;
    padding: 0 3px !important;
  }
  
  .word-problem-wrapper {
    padding: 0 12px !important;
  }
  
  .word-problem-wrapper .answer-row {
    padding-left: 5px !important;
  }
  
  .word-problem-wrapper .step-two-row {
    margin-top: 16px !important;
  }
  
  .cycle-shapes-row { gap: 4px !important; }
  .cycle-shapes-row span { font-size: 18px !important; }
  .ans-inp { width: 32px !important; height: 26px !important; font-size: 14px !important; }
  .unit-inp { width: 46px !important; font-size: 14px !important; }
  .shape-select-input { width: 80px !important; height: 26px !important; font-size: 14px !important; }
}

@media (max-width: 480px) {
  body { padding: 10px; }
  .container { padding: 15px 8px; }
  .question-text { font-size: 18px; }
  
  /* 时间计算题目移动端优化 - 防止分换行 */
  .time-calc-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    white-space: nowrap !important;
  }
  .answer-input { width: 100px; height: 45px; font-size: 20px; }
  
  .pk-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .pk-header div {
    display: none;
  }
  
  .pk-tabs {
    flex-direction: column;
    gap: 5px;
  }
  
  .pk-tab {
    padding: 12px !important;
  }
}