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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.app-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 16px 0;
}

.app-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 14px;
  color: #666;
  margin-top: 4px;
}

.main-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.canvas-panel {
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

#signCanvas {
  display: block;
  background: linear-gradient(180deg, #e8f0fe 0%, #d4e4f7 40%, #c0d4e8 100%);
}

.sign-overlay {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.sign-label {
  display: inline-block;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity 0.3s;
}

.sign-label.visible {
  opacity: 1;
}

.playback-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

.btn {
  padding: 8px 16px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  transition: all 0.15s;
}

.btn:hover:not(:disabled) {
  background: #f0f0f0;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: #4a6cf7;
  color: #fff;
  border-color: #4a6cf7;
}

.btn-primary:hover:not(:disabled) {
  background: #3b5de7;
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 13px;
  color: #666;
}

.speed-control input[type="range"] {
  width: 80px;
  accent-color: #4a6cf7;
}

#speedValue {
  min-width: 32px;
  text-align: center;
}

.input-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 280px;
}

.input-group label,
.preset-group label,
.sign-list label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: #4a6cf7;
  box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  padding: 6px 14px;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  transition: all 0.15s;
}

.preset-btn:hover {
  background: #eef2ff;
  border-color: #4a6cf7;
  color: #4a6cf7;
}

.sign-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

.sign-word {
  padding: 4px 10px;
  background: #eef2ff;
  border-radius: 4px;
  font-size: 14px;
  color: #4a6cf7;
}

.sign-word.active {
  background: #4a6cf7;
  color: #fff;
}

.sign-word.unknown {
  background: #f0f0f0;
  color: #999;
  text-decoration: line-through;
}

.status-bar {
  font-size: 13px;
  color: #888;
  min-height: 20px;
}

@media (max-width: 900px) {
  .main-content {
    flex-direction: column;
    align-items: stretch;
  }
  .canvas-panel {
    align-self: center;
  }
  #signCanvas {
    width: 100%;
    height: auto;
  }
}
