:root {
  --primary-color: #4A90E2;
  --secondary-color: #50E3C2;
  --bg-color: #F5F7FA;
  --text-color: #333333;
  --card-bg: #FFFFFF;
  --radius: 12px;
}

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

body {
  font-family: "PingFang TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  padding-bottom: 40px;
}

.navbar {
  background-color: var(--primary-color);
  color: white;
  padding: 15px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: center;
}

.navbar a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}


.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

h1, h2, h3 {
  margin-bottom: 15px;
  color: #2c3e50;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

input[type="text"], input[type="number"] {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: var(--radius);
  font-size: 1rem;
  width: 100%;
}

.btn {
  display: block;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: #004d40;
  margin-top: 10px;
}

.btn:active {
  opacity: 0.8;
}

.score-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    
  background-color: #f0f0f0; 
}

.audio-player-wrapper {
  margin-bottom: 20px;
}

.label-text {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
  color: #666;
  font-size: 0.9rem;
}

audio {
  width: 100%;
  border-radius: 30px;
}

.text-center { text-align: center; }
.mt-2 { margin-top: 20px; }

#reader {
    background-color: #000000;
    border-radius: 8px;
    padding: 10px;
    color: #ffffff;
}

#reader__status_span {
    color: #ffffff !important; 
    font-size: 1.1rem;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

#reader__dashboard_section_csr button {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: 2px solid white !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
}

#reader__dashboard_section_swaplink {
    display: none !important; 
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    border-radius: 12px;
    position: relative;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    background: none;
    border: none;
}

#reader {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
    background: black;
}

.tone-section {
    background-color: #FFF8E1;
    border: 2px dashed #FFC107;
    text-align: center;
}

.tone-answer-box, 
.hint-answer-box {
    margin-top: 15px;
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 3px;
    color: var(--primary-color);
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    display: none; 
    line-height: 1.2;
    word-break: break-word;
}

.btn-reveal {
    background-color: #FFC107;
    color: #333;
    margin-top: 10px;
}

#paper { 
    background-color: #ffffff !important;
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}

#paper svg { 
    display: block; 
    margin: 0 auto;
    fill: #000000 !important; 
}

#paper svg path, 
#paper svg text, 
#paper svg rect {
    fill: #000000 !important;
}

.source-text {
    font-size: 0.85rem;
    color: #999;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

:root {
  --bg-color-dark: #1a1a1a;
  --text-color-dark: #e0e0e0;
  --card-bg-dark: #2a2a2a;
}

body.dark {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --card-bg: #2a2a2a;
}

.dark .card {
  background: var(--card-bg);
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.dark h1, .dark h2, .dark h3 {
  color: #f0f0f0;
}

.dark .source-text {
  color: #aaa;
}

.dark input {
  background: var(--card-bg);
  color: var(--text-color);
  border-color: #444;
}

.dark .tone-section {
  background-color: #333;
  border-color: #666;
}

.dark .btn-reveal {
  background-color: #666;
  color: #fff;
}
