@import url("https://fonts.googleapis.com/css2?family=Fira+Sans:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap");

:root {
  --bg: #ecfeff;
  --card: #ffffff;
  --primary: #0891b2;
  --primary-dark: #0e7490;
  --accent: #22c55e;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --shadow: 0 16px 40px rgba(14, 116, 144, 0.15);
}

* {
  box-sizing: border-box;
  font-family: "Fira Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px 48px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
}

.hero-content h1 {
  margin: 8px 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
}

.hero-content p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.eyebrow {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(8, 145, 178, 0.15);
  border-radius: 999px;
  color: var(--primary-dark);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.hero-card {
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(8, 145, 178, 0.15);
  display: grid;
  gap: 12px;
}

.metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 145, 178, 0.08);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  font-family: "Fira Code", "Fira Sans", monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(8, 145, 178, 0.12);
}

.card h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

label {
  display: block;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--text);
}

.label-title {
  display: block;
  margin-bottom: 6px;
}

.hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

textarea,
input {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: #f8fafc;
}

textarea {
  resize: vertical;
}

textarea:focus,
input:focus,
button:focus {
  outline: 2px solid rgba(8, 145, 178, 0.4);
  outline-offset: 2px;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.upload-field input[type="file"] {
  background: #ffffff;
  border: 1px dashed rgba(8, 145, 178, 0.35);
  padding: 16px;
}

.preview-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.preview-title {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.preview-item {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.preview-item img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 6px;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  background: var(--primary-dark);
}

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

button.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

button.primary {
  background: var(--accent);
}

button.primary:hover {
  background: #16a34a;
}

.actions {
  margin-top: 16px;
}

.empty {
  color: var(--muted);
}

.score {
  font-size: 18px;
  margin-bottom: 8px;
}

.summary {
  margin-bottom: 16px;
  color: var(--text);
}

.ocr {
  margin-bottom: 16px;
  font-size: 13px;
  background: rgba(8, 145, 178, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--primary-dark);
  border: 1px solid rgba(8, 145, 178, 0.2);
  white-space: pre-wrap;
}

.stream-status {
  font-size: 14px;
  color: var(--primary-dark);
  margin-bottom: 12px;
}

.stream-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.stream-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.stream-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  color: var(--text);
  font-family: "Fira Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.mistake-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mistake-section li {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #f8fafc;
}

.mistake-detail {
  font-size: 14px;
  margin-top: 4px;
  color: var(--muted);
}

.mistake-point {
  font-weight: 600;
  margin-bottom: 4px;
}

.mistake-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  background: #f8fafc;
}

.mistake-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.mistake-question,
.mistake-summary {
  margin-bottom: 8px;
}

.mistake-item {
  background: #ffffff;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.muted {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
