body {
  height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}

#SearchFrameWrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-dark);
  backdrop-filter: blur(1.2vw);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#SearchFrameWrapper.hidden {
  display: none;
}

#SearchFrame {
  width: 100vw;
  height: 100vh;
  border: none;
}

#CloseFrameButton {
  position: fixed;
  top: 1.1vh;
  left: 4vw;
  z-index: 10000;
}

.video-container {
  margin-top: 14vh;
  width: 92vw;
  height: 77vh;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 1.8vw;
  box-shadow: var(--shadow-xl);
  background: var(--bg-glass-light);
  border: 0.15vw solid var(--card-border);
  backdrop-filter: blur(2vw) saturate(150%);
  -webkit-backdrop-filter: blur(2vw) saturate(150%);
}

#SentenceArea {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2vh;
  padding: 2vh 4vw;
  overflow: hidden;
}

#ChineseText {
  font-size: 5vw;
  font-weight: 600;
  color: var(--text-primary);
  transition: opacity 0.3s ease;
  text-align: center;
  line-height: 1.2;
}

#PinyinText {
  font-size: 4vw;
  color: var(--text-secondary);
  transition: opacity 0.3s ease;
  text-align: center;
  line-height: 1.3;
}

#MeaningText {
  font-size: 3.5vw;
  color: var(--text-muted);
  transition: opacity 0.3s ease;
  text-align: center;
  line-height: 1.4;
  max-width: 90vw;
}

.hidden {
  opacity: 0;
  visibility: hidden;
}

.controls {
  background: var(--bg-dark);
  backdrop-filter: blur(3vw);
  padding: 1vh 1vw;
  border-top: 0.2vw solid var(--border-subtle);
  border-radius: 0 0 2vw 2vw;
}

.all-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1vh;
}

.left-controls,
.center-controls,
.right-controls {
  display: flex;
  align-items: center;
  gap: 1.5vw;
  justify-content: center;
  flex-wrap: wrap;
}

.playback-controls {
  display: flex;
  gap: 1.5vw;
  align-items: center;
}

.control-btn {
  background: var(--btn-secondary-bg);
  border: 0.2vw solid var(--btn-secondary-border);
  color: var(--text-primary);
  cursor: pointer;
  padding: 2vw;
  border-radius: 1.5vw;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  min-width: 9vw;
  min-height: 9vw;
}

.control-btn:hover {
  background: var(--btn-secondary-hover);
  transform: translateY(-0.3vh);
  box-shadow: 0 0.8vh 2.5vw rgba(0, 217, 232, 0.4);
}

.control-btn:active {
  transform: translateY(0);
}

.control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.control-btn.primary {
  background: var(--btn-primary-bg);
  border: 0.2vw solid var(--accent-primary);
  padding: 2.5vw;
  box-shadow: var(--btn-primary-shadow);
  min-width: 11vw;
  min-height: 11vw;
}

.control-btn.primary:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-0.5vh) scale(1.05);
  box-shadow: 0 1.2vh 3.5vw rgba(0, 217, 232, 0.6);
}

.control-icon {
  width: 4vw;
  height: 4vw;
  fill: var(--text-primary);
  filter: drop-shadow(0 0.3vh 0.6vw rgba(0, 0, 0, 0.3));
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 1vw;
  background: rgba(0, 217, 232, 0.12);
  padding: 0.8vh 1.8vw;
  border-radius: 1.5vw;
  border: 0.2vw solid var(--btn-secondary-border);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.speed-label {
  color: var(--text-muted);
  font-size: 2.5vw;
  font-weight: 600;
  white-space: nowrap;
}

.speed-value {
  color: var(--accent-primary);
  font-weight: 700;
  min-width: 6vw;
  text-align: center;
  font-size: 3.5vw;
}

.speed-slider {
  width: 20vw;
  height: 0.8vw;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.4vw;
  outline: none;
  cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 2.5vw;
  height: 2.5vw;
  background: var(--btn-primary-bg);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 1.5vw rgba(0, 217, 232, 0.6);
}

.speed-slider::-moz-range-thumb {
  width: 2.5vw;
  height: 2.5vw;
  background: var(--btn-primary-bg);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 1.5vw rgba(0, 217, 232, 0.6);
}

.index-display {
  display: flex;
  align-items: center;
  gap: 1.5vw;
  background: rgba(0, 217, 232, 0.12);
  padding: 1.1vh 2.5vw;
  border-radius: 1.5vw;
  border: 0.2vw solid var(--btn-secondary-border);
  box-shadow: var(--shadow-md);
}

.index-value {
  color: var(--accent-primary);
  font-size: 4vw;
  font-weight: 700;
  min-width: 13vw;
  text-align: center;
  text-shadow: 0 0 1.5vw rgba(0, 217, 232, 0.5);
}

.mode-btn {
  background: rgba(0, 217, 232, 0.12);
  border: 0.2vw solid var(--btn-secondary-border);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 1vh 3vw;
  border-radius: 1.5vw;
  font-size: 2.8vw;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.mode-btn:hover {
  background: var(--btn-secondary-hover);
  transform: translateY(-0.3vh);
  box-shadow: 0 0.8vh 2.5vw rgba(0, 217, 232, 0.45);
  color: var(--text-primary);
}

.mode-btn:active {
  transform: translateY(0);
}

.mode-btn.active {
  background: rgba(0, 217, 232, 0.25);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 
    0 0.8vh 3.5vw rgba(0, 217, 232, 0.5),
    0 0 5vw rgba(0, 217, 232, 0.35);
}

.hide-btn {
  background: var(--btn-danger-bg);
  border: 0.2vw solid rgba(239, 68, 68, 0.3);
  color: var(--btn-danger-text);
  cursor: pointer;
  padding: 1vh 2.5vw;
  border-radius: 1.5vw;
  font-size: 2.6vw;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.8vw;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}

.hide-btn:hover {
  background: var(--btn-danger-hover);
  transform: translateY(-0.3vh);
  box-shadow: 0 0.8vh 2.5vw rgba(239, 68, 68, 0.35);
}

.hide-btn:active {
  transform: translateY(0);
}

.hide-btn.active {
  background: var(--btn-success-bg);
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--btn-success-text);
}

.hide-btn.active .hide-slash {
  opacity: 0;
}

.hide-icon {
  width: 2.8vw;
  height: 2.8vw;
  fill: currentColor;
  filter: drop-shadow(0 0.3vh 0.6vw rgba(239, 68, 68, 0.3));
  transition: transform 0.3s ease;
}

.hide-slash {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.jump-control {
  display: flex;
  align-items: center;
  gap: 1.2vw;
  background: rgba(0, 217, 232, 0.12);
  padding: 0.4vh 2vw;
  border-radius: 1.5vw;
  border: 0.2vw solid var(--btn-secondary-border);
  box-shadow: var(--shadow-md);
}

.jump-btn {
  background: var(--btn-primary-bg);
  border: none;
  color: var(--btn-primary-text);
  cursor: pointer;
  padding: 1vh 3.5vw;
  border-radius: 1.2vw;
  font-size: 3.2vw;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 0.4vh 1.5vw rgba(0, 217, 232, 0.3);
}

.jump-btn:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-0.3vh);
  box-shadow: 0 0.8vh 2vw rgba(0, 217, 232, 0.5);
}

.jump-btn:active {
  transform: translateY(0);
}

.jump-input {
  width: 14vw;
  background: var(--input-bg);
  border: 0.2vw solid var(--input-border);
  color: var(--accent-primary);
  padding: 0.8vh 1.5vw;
  border-radius: 1.2vw;
  font-size: 3.2vw;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: all 0.3s ease;
}

.jump-input:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 1.5vw rgba(0, 217, 232, 0.4);
  background: rgba(0, 217, 232, 0.12);
}

.jump-input::placeholder {
  color: var(--input-placeholder);
}

.jump-input::-webkit-outer-spin-button,
.jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.jump-input[type=number] {
  -moz-appearance: textfield;
}

.save-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 0.2vw solid rgba(16, 185, 129, 0.3);
  color: var(--btn-success-text);
  cursor: pointer;
  padding: 1vh 2.5vw;
  border-radius: 1.5vw;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  min-width: 9vw;
  min-height: 9vw;
}

.save-btn:hover {
  background: var(--btn-success-bg);
  transform: translateY(-0.3vh);
  box-shadow: 0 0.8vh 2.5vw rgba(16, 185, 129, 0.4);
}

.save-btn:active {
  transform: translateY(0);
}

.save-btn.saved {
  background: var(--btn-success-bg);
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0.8vh 3vw rgba(16, 185, 129, 0.5);
}

.save-icon {
  width: 4vw;
  height: 4vw;
  fill: currentColor;
  filter: drop-shadow(0 0.3vh 0.6vw rgba(16, 185, 129, 0.3));
}

/* Disclaimer Container - Mobil First */
#DisclaimerContainer {
  position: fixed;
  top: 8vh;
  left: 0;
  width: 100vw;
  padding: 0.5vh 4vw;
  backdrop-filter: blur(2vw);
  border-bottom: 0.2vw solid var(--border-subtle);
  z-index: 100;
}

#DisclaimerText {
  font-size: 1.9vw;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: center;
  opacity: 0.7;
}

@media (min-width: 768px) {
  body {
    padding-top: 0;
  }

  #CloseFrameButton {
  top: 2vh;
  left: 2vw;
  }       

  .video-container {
    margin-top: 16vh;
    width: 85vw;
    height: 75vh;
    border-radius: 1.5vw;
    border-width: 0.12vw;
    display: flex;
    flex-direction: column;
  }

  #SentenceArea {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5vh;
    padding: 3vh 4vw;
    overflow: hidden;
  }

  #ChineseText {
    font-size: 4vw;
    line-height: 1.3;
  }

  #PinyinText {
    font-size: 3vw;
    line-height: 1.4;
  }

  #MeaningText {
    font-size: 2.5vw;
    max-width: 70vw;
    line-height: 1.5;
  }

  .controls {
    width: 100%;
    padding: 1.4vh 1vw;
    border-radius: 0 0 1.5vw 1.5vw;
    border-width: 0;
    margin-top: auto;
  }

  .all-controls {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.7vw;
    flex-wrap: nowrap;
    width: 100%;
  }

  .left-controls {
    display: flex;
    justify-content: flex-start;
    gap: 0.5vw;
    flex-wrap: nowrap;
    flex-shrink: 1;
  }

  .center-controls {
    display: flex;
    gap: 1vw;
    flex-shrink: 0;
    align-items: center;
  }

  .right-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.5vw;
    flex-wrap: nowrap;
    flex-shrink: 1;
  }

  .playback-controls {
    gap: 0.6vw;
  }

  .control-btn {
    padding: 0.8vw;
    border-radius: 0.8vw;
    border-width: 0.1vw;
    min-width: 3.2vw;
    min-height: 3.2vw;
  }

  .control-btn.primary {
    padding: 1vw;
    min-width: 3.8vw;
    min-height: 3.8vw;
  }

  .control-icon {
    width: 1.4vw;
    height: 1.4vw;
  }

  .speed-control {
    padding: 0.6vh 0.5vw;
    border-radius: 0.8vw;
    border-width: 0.1vw;
    gap: 0.1vw;
  }

  .speed-label {
    font-size: 1.3vw;
  }

  .speed-value {
    font-size: 1.3vw;
    min-width: 3vw;
  }

  .speed-slider {
    width: 6vw;
    height: 0.35vw;
    border-radius: 0.2vw;
  }

  .speed-slider::-webkit-slider-thumb {
    width: 1vw;
    height: 1vw;
  }

  .speed-slider::-moz-range-thumb {
    width: 1vw;
    height: 1vw;
  }

  .index-display {
    padding: 0.7vh 1.2vw;
    border-radius: 0.8vw;
    border-width: 0.1vw;
    gap: 0.5vw;
  }

  .index-value {
    font-size: 1.4vw;
    min-width: 4vw;
  }

  .mode-btn {
    padding: 0.8vh 0.6vw;
    font-size: 1vw;
    border-radius: 0.8vw;
    border-width: 0.1vw;
  }

  .hide-btn {
    padding: 0.8vh 0.6vw;
    font-size: 1vw;
    border-radius: 0.8vw;
    border-width: 0.1vw;
    gap: 0.35vw;
  }

  .hide-icon {
    width: 1vw;
    height: 1vw;
  }

  .jump-control {
    padding: 0.35vh 1vw;
    border-radius: 0.8vw;
    border-width: 0.1vw;
    gap: 0.5vw;
  }

  .jump-btn {
    padding: 0.5vh 1vw;
    font-size: 1vw;
    border-radius: 0.7vw;
  }

  .jump-input {
    width: 5vw;
    padding: 0.5vh 0.8vw;
    font-size: 1vw;
    border-radius: 0.7vw;
    border-width: 0.1vw;
  }

  .save-btn {
    padding: 0.8vh 1.2vw;
    border-radius: 0.8vw;
    border-width: 0.1vw;
    min-width: 3.2vw;
    min-height: 3.2vw;
  }

  .save-icon {
    width: 1.4vw;
    height: 1.4vw;
  }

  #DisclaimerContainer {
    top: 10vh;
    padding: 0.5vh 1vw;
    border-width: 0.1vw;
  }

  #DisclaimerText {
    font-size: 1.5vw;
  }  
}

@media (min-width: 1024px), (orientation: landscape) {
  body {
    padding-top: 0;
    overflow: hidden;
  }

  #CloseFrameButton {
  top: 2.3vh;
  }   

  .video-container {
    margin-top: 15vh;
    width: 75vw;
    height: 78vh;
    border-radius: 1.2vw;
    border-width: 0.08vw;
  }

  #SentenceArea {
    flex: 1;
    gap: 2vh;
    padding: 2.5vh 3vw;
  }

  #ChineseText {
    font-size: 2vw;
    line-height: 1.35;
  }

  #PinyinText {
    font-size: 1.6vw;
    line-height: 1.4;
  }

  #MeaningText {
    font-size: 1.4vw;
    max-width: 60vw;
    line-height: 1.5;
  }

  .controls {
    padding: 1.2vh 1.5vw;
    border-radius: 0 0 1.2vw 1.2vw;
  }

  .all-controls {
    gap: 1.5vw;
  }

  .left-controls {
    gap: 0.5vw;
  }

  .center-controls {
    gap: 1vw;
  }

  .right-controls {
    gap: 0.8vw;
  }

  .playback-controls {
    gap: 0.5vw;
  }

  .control-btn {
    padding: 0.7vw;
    border-radius: 0.7vw;
    border-width: 0.08vw;
    min-width: 2.8vw;
    min-height: 2.8vw;
  }

  .control-btn.primary {
    padding: 0.85vw;
    min-width: 3.3vw;
    min-height: 3.3vw;
  }

  .control-icon {
    width: 1.2vw;
    height: 1.2vw;
  }

  .speed-control {
    padding: 0.5vh 0.9vw;
    border-radius: 0.7vw;
    border-width: 0.08vw;
    gap: 0.4vw;
  }

  .speed-label {
    font-size: 0.85vw;
  }

  .speed-value {
    font-size: 1vw;
    min-width: 2.5vw;
  }

  .speed-slider {
    width: 5.5vw;
    height: 0.3vw;
    border-radius: 0.15vw;
  }

  .speed-slider::-webkit-slider-thumb {
    width: 0.9vw;
    height: 0.9vw;
  }

  .speed-slider::-moz-range-thumb {
    width: 0.9vw;
    height: 0.9vw;
  }

  .index-display {
    padding: 0.8vh 1vw;
    border-radius: 0.7vw;
    border-width: 0.08vw;
    gap: 0.4vw;
  }

  .index-value {
    font-size: 0.8vw;
    min-width: 3.5vw;
  }

  .mode-btn {
    padding: 1vh 1vw;
    font-size: 0.8vw;
    border-radius: 0.7vw;
    border-width: 0.08vw;
  }

  .hide-btn {
    padding: 1vh 1vw;
    font-size: 0.8vw;
    border-radius: 0.7vw;
    border-width: 0.08vw;
    gap: 0.3vw;
  }

  .hide-icon {
    width: 0.85vw;
    height: 0.85vw;
  }

  .jump-control {
    padding: 0.5vh 0.4vw;
    border-radius: 0.7vw;
    border-width: 0.08vw;
    gap: 0.4vw;
  }

  .jump-btn {
    padding: 0.4vh 0.6vw;
    font-size: 0.9vw;
    border-radius: 0.6vw;
  }

  .jump-input {
    width: 5vw;
    padding: 0.4vh 0.7vw;
    font-size: 0.9vw;
    border-radius: 0.6vw;
    border-width: 0.08vw;
  }

  .save-btn {
    padding: 0.8vh 1vw;
    border-radius: 0.7vw;
    border-width: 0.08vw;
    min-width: 2.8vw;
    min-height: 2vw;
  }

  .save-icon {
    width: 1.2vw;
    height: 1.2vw;
  }

  #DisclaimerContainer {
    top: 96.5vh;
    border-bottom: none;
    padding: 0.5vh 1vw;
    border-width: 0.08vw;
  }

  #DisclaimerText {
    font-size: 0.9vw;
    line-height: 1.5;
  }  
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
    html, body {
        overflow: auto;
    }
}