body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f5f5f5;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

h1 {
  color: #333;
  text-align: center;
  margin: 0;
  padding: 20px 20px 10px 20px;
}

.main-content {
  display: flex;
  min-height: 600px;
}

.left-panel {
  flex: 1;
  padding: 20px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.right-panel {
  width: 400px;
  padding: 20px;
  background: white;
  border-left: 1px solid #e9ecef;
  overflow-y: auto;
}

.controls {
  margin-top: 15px;
  display: flex;
  gap: 8px;
  flex-direction: column;
}

.controls.horizontal {
  flex-direction: row;
  flex-wrap: wrap;
}

button {
  padding: 12px 16px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

button:hover {
  background: #0056b3;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.input-group {
  margin-bottom: 20px;
}

.input-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
  font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.status {
  margin-top: 15px;
  padding: 10px;
  border-radius: 4px;
  font-weight: bold;
  white-space: break-spaces;
}

.status.loading {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status.ready {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.dh-viewer-container {
  position: relative;
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 10px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.dh-viewer-container.resizing {
  border-color: #007bff;
  background: #f0f8ff;
}

dh-view {
  width: 600px;
  height: 400px;
  display: block;
  margin: 0 auto;
}

.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: #007bff;
  cursor: nw-resize;
  border-radius: 4px 0 4px 0;
}

.resize-handle:hover {
  background: #0056b3;
}

.size-display {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-family: monospace;
}

.preset-sizes {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.preset-size-btn {
  padding: 5px 10px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.preset-size-btn:hover {
  background: #218838;
}

.section-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e9ecef;
}

.recording-info {
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
}

.recording-time {
  font-size: 14px;
  color: #333;
}

.recording-time span:last-child {
  font-weight: bold;
  color: #007bff;
  font-family: monospace;
  font-size: 16px;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #dc3545;
  font-weight: bold;
  font-size: 14px;
}

.audio-timing-info {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.audio-timing-info .section-title {
  margin: 0 0 15px 0;
  padding-bottom: 8px;
}

.timing-details {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.timing-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timing-item .label {
  font-weight: bold;
  color: #333;
  font-size: 13px;
}

.info-values {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  font-size: 13px;
}

.info-value {
  padding: 8px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  text-align: center;
}

.info-value-label {
  display: block;
  font-weight: 600;
  color: #666;
  font-size: 11px;
  margin-bottom: 3px;
}

.info-value-content {
  color: #007bff;
  font-family: monospace;
  font-size: 12px;
}

.pulse {
  display: inline-block;
  width: 12px;
  height: 12px;
  background: #dc3545;
  border-radius: 50%;
  animation: pulse-animation 1s infinite;
}

@keyframes pulse-animation {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* 音量滑塊樣式 */
input[type="range"].volume-slider {
  width: 100%;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    #007bff 0%,
    #007bff var(--volume),
    #e9ecef var(--volume),
    #e9ecef 100%
  );
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background 0.1s ease;
}

input[type="range"].volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007bff;
  cursor: pointer;
  box-shadow:
    0 2px 6px rgba(0, 123, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.2s;
  border: 2px solid white;
}

input[type="range"].volume-slider::-webkit-slider-thumb:hover {
  background: #0056b3;
  box-shadow:
    0 2px 12px rgba(0, 123, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

input[type="range"].volume-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007bff;
  cursor: pointer;
  border: 2px solid white;
  box-shadow:
    0 2px 6px rgba(0, 123, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.2s;
}

input[type="range"].volume-slider::-moz-range-thumb:hover {
  background: #0056b3;
  box-shadow:
    0 2px 12px rgba(0, 123, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

input[type="range"].volume-slider::-moz-range-track {
  background: transparent;
  border: none;
}

input[type="range"].volume-slider::-moz-range-progress {
  background: #007bff;
  height: 8px;
  border-radius: 4px;
}

input[type="range"].volume-slider:disabled {
  background: linear-gradient(
    to right,
    #ccc 0%,
    #ccc var(--volume),
    #e9ecef var(--volume),
    #e9ecef 100%
  );
  cursor: not-allowed;
  opacity: 0.6;
}

input[type="range"].volume-slider:disabled::-webkit-slider-thumb {
  background: #b3b3b3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: not-allowed;
}

input[type="range"].volume-slider:disabled::-moz-range-thumb {
  background: #b3b3b3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: not-allowed;
}

input[type="range"].volume-slider:disabled::-moz-range-progress {
  background: #ccc;
}

/* 響應式設計 */
@media (max-width: 1024px) {
  .main-content {
    flex-direction: column;
  }

  .right-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid #e9ecef;
  }

  .left-panel {
    padding: 20px 20px 10px 20px;
  }

  dh-view {
    width: 100%;
    max-width: 600px;
    height: 350px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    border-radius: 8px;
  }

  .left-panel,
  .right-panel {
    padding: 15px;
  }

  dh-view {
    height: 250px;
  }

  .preset-sizes {
    flex-direction: column;
    gap: 6px;
  }

  .preset-size-btn {
    width: 100%;
  }

  .controls.horizontal {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5em;
    padding: 15px 15px 8px 15px;
  }

  .section-title {
    font-size: 16px;
  }

  dh-view {
    height: 200px;
  }
}
.audio-timing-info {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.audio-timing-info .section-title {
  margin: 0 0 15px 0;
  padding-bottom: 8px;
}

.timing-details {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.timing-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timing-item .label {
  font-weight: bold;
  color: #333;
  font-size: 13px;
}

.info-values {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  font-size: 13px;
}

.info-value {
  padding: 8px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  text-align: center;
}

.info-value-label {
  display: block;
  font-weight: 600;
  color: #666;
  font-size: 11px;
  margin-bottom: 3px;
}

.info-value-content {
  color: #007bff;
  font-family: monospace;
  font-size: 12px;
}
