/* 基本樣式 */
:root {
  --primary: #ec4899;
  --primary-light: #f9a8d4;
  --primary-dark: #be185d;
  --success: #22c55e;
  --error: #ef4444;
  --background: #ffffff;
  --card-background: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --border: #e5e7eb;
  --border-focus: #f9a8d4;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fce7f3, #eff6ff);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.container {
  width: 100%;
  max-width: 500px;
}

.hidden {
  display: none !important;
}

/* 卡片樣式 */
.card {
  background-color: var(--card-background);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

/* 頭部樣式 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

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

.controls {
  display: flex;
  gap: 0.5rem;
}

.controls button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
  color: var(--text);
}

.controls button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* 設置面板樣式 */
.settings h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.setting-group {
  margin-bottom: 1rem;
}

.setting-group h3 {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.5rem;
  text-align: center;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  cursor: pointer;
}

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

.checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.checkbox-item, .switch-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.button-outline {
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  background-color: transparent;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.button-outline:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* 練習面板樣式 */
.practice {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
}

.character {
  font-size: 6rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  color: var(--primary);
  height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#answer-input {
  width: 100%;
  padding: 1rem;
  text-align: center;
  font-size: 1.5rem;
  border: 2px solid var(--border);
  border-radius: 0.375rem;
  outline: none;
}

#answer-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(249, 168, 212, 0.25);
}

#answer-input.correct {
  border-color: var(--success);
  background-color: rgba(34, 197, 94, 0.1);
}

#answer-input.incorrect {
  border-color: var(--error);
  background-color: rgba(239, 68, 68, 0.1);
}

.feedback {
  margin-top: 0.5rem;
  color: var(--error);
}

.hint {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
}

/* 頁腳樣式 */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badges {
  display: flex;
  gap: 0.5rem;
}

.badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background-color: white;
  border: 1px solid var(--border);
  border-radius: 9999px;
}

.score {
  font-size: 0.875rem;
}

/* 響應式設計 */
@media (max-width: 640px) {
  .character {
    font-size: 5rem;
    height: 6rem;
  }
  
  #answer-input {
    font-size: 1.25rem;
    padding: 0.75rem;
  }
  
  .checkboxes {
    grid-template-columns: 1fr;
  }
}

/* PWA相關樣式 */
@media (display-mode: standalone) {
  body {
    padding: 0;
    height: 100vh;
    overflow: hidden;
  }
  
  .container {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem;
  }
  
  .card.practice {
    flex: 1;
  }
}