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

:root {
  --page: #F0F4F9;
  --white: #FFFFFF;
  --blue: #1A73E8;
  --blue-light: #E8F0FE;
  --text: #1F2937;
  --text-2: #5F6368;
  --text-3: #9AA0A6;
  --border: #DADCE0;
  --border-strong: #BBBFC3;
  --green: #1EA952;
  --green-light: #E7F8EE;
  --red: #DC2626;
  --red-light: #FEF2F2;
  --f: 'Figtree', sans-serif;
  --r: 8px;
  --r-lg: 16px;
  --r-xl: 24px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--f);
  background: var(--page);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 7px; background: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.logo-text { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.logo-text span { color: var(--blue); }
.header-spacer { flex: 1; }
.lang-toggle {
  display: flex; align-items: center; gap: 4px; padding: 5px 10px;
  border-radius: 100px; border: 1px solid var(--border); background: transparent;
  font-family: var(--f); font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all 0.15s ease;
}
.lang-toggle:hover { background: var(--page); border-color: var(--border-strong); }

/* Page */
.page { max-width: 960px; margin: 0 auto; padding: 48px 32px 80px; }

/* Greeting */
.greeting-block {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 24px 28px; margin-bottom: 16px;
  opacity: 0; animation: appear 0.5s ease forwards;
}
.greeting-text { font-size: 14.5px; color: var(--text-2); line-height: 1.7; }
.greeting-text strong { color: var(--text); font-weight: 600; }

/* Waveform */
.waveform-wrap { display: flex; align-items: center; justify-content: center; gap: 3px; height: 40px; margin: 20px 0 4px; }
.wave-bar {
  width: 3px; border-radius: 2px; background: var(--blue); opacity: 0.55;
  animation: wave-anim var(--dur, 1.2s) ease-in-out infinite; animation-delay: var(--d, 0s);
}
@keyframes wave-anim {
  0%, 100% { height: var(--min-h, 4px); opacity: 0.3; }
  50%      { height: var(--max-h, 28px); opacity: 0.9; }
}

/* Form toggle */
.form-toggle {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 16px 24px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; transition: all 0.15s ease;
}
.form-toggle:hover { background: var(--page); border-color: var(--border-strong); }
.form-toggle.open {
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-bottom: none;
}
.form-toggle-left { display: flex; align-items: center; gap: 12px; }
.form-toggle-icon {
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.form-toggle-label { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.form-toggle-chevron { color: var(--text-3); transition: transform 0.25s ease; flex-shrink: 0; }
.form-toggle-chevron.open { transform: rotate(180deg); }

/* Form collapsible */
#form-collapsible {
  overflow: hidden;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-section-collapsed {
  border-top: none !important;
  border-radius: 0 0 var(--r-xl) var(--r-xl) !important;
}

/* Form section */
.form-section {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-xl);
  overflow: hidden; opacity: 0; animation: appear 0.5s ease forwards 0.1s;
}
.form-row { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.form-row:last-child { border-bottom: none; }
.row-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 14px;
}

/* Guide accordion */
.guide-header {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; gap: 12px;
}
.guide-left { display: flex; align-items: center; gap: 10px; }
.wa-dot {
  width: 28px; height: 28px; border-radius: 7px; background: #E7F8EE;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.guide-title { font-size: 14px; font-weight: 500; color: var(--text); }
.guide-sub { font-size: 12px; color: var(--text-2); }
.guide-chevron { color: var(--text-3); transition: transform 0.22s ease; flex-shrink: 0; }
.guide-chevron.open { transform: rotate(180deg); }
.guide-body { overflow: hidden; transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.guide-steps { padding-top: 16px; display: flex; flex-direction: column; }
.guide-step {
  display: flex; align-items: flex-start; gap: 14px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.guide-step:last-child { border-bottom: none; padding-bottom: 4px; }
.g-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.g-text { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.g-text strong { color: var(--text); font-weight: 500; }

/* Upload zone */
.upload-zone {
  position: relative; border: 2px dashed var(--border); border-radius: var(--r-lg);
  padding: 36px 24px; text-align: center; cursor: pointer;
  transition: all 0.2s ease; background: var(--white); overflow: hidden;
}
.upload-zone::after {
  content: ''; position: absolute; inset: 0; background: var(--blue-light);
  opacity: 0; transition: opacity 0.2s ease; pointer-events: none;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--blue); border-style: solid; }
.upload-zone:hover::after, .upload-zone.dragover::after { opacity: 1; }
.upload-zone > * { position: relative; z-index: 1; }
.mic-container {
  width: 52px; height: 52px; border-radius: 50%; background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; transition: all 0.2s ease;
}
.upload-zone:hover .mic-container, .upload-zone.dragover .mic-container { background: var(--blue); transform: scale(1.08); }
.upload-zone:hover .mic-icon, .upload-zone.dragover .mic-icon { stroke: white; }
.mic-icon { transition: stroke 0.2s ease; }
.upload-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-sub { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.upload-limit { font-size: 11px; color: var(--text-3); margin-bottom: 14px; }
.upload-lang-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 5px 14px;
  background: var(--blue-light); color: var(--blue);
  border-radius: 100px; font-size: 12px; font-weight: 600;
}
.format-chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; padding: 3px 8px;
  border-radius: 4px; background: var(--page); color: var(--text-2);
  border: 1px solid var(--border); text-transform: uppercase;
}
input[type="file"] { display: none; }

/* File list */
.file-list { display: none; flex-direction: column; gap: 8px; margin-top: 12px; }
.file-list.has-files { display: flex; }
.file-card {
  display: flex; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--page); overflow: hidden; animation: appear 0.2s ease;
}
.file-card-stripe { width: 4px; align-self: stretch; background: var(--blue); border-radius: 12px 0 0 12px; flex-shrink: 0; }
.file-card-body { flex: 1; display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; min-width: 0; }
.file-card-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--blue-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.file-card-info { flex: 1; min-width: 0; }
.file-card-name { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-card-meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; }
.file-card-size { font-size: 12px; color: var(--text-3); }
.file-card-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.file-card-duration { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--blue); }
.file-card-actions { display: flex; gap: 4px; padding-right: 12px; flex-shrink: 0; }
.file-remove {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: none; background: transparent;
  cursor: pointer; color: var(--text-3); transition: all 0.15s; flex-shrink: 0;
}
.file-remove:hover { background: #FEE2E2; color: var(--red); }

/* Toggle switch */
.option-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; user-select: none; }
.option-name { font-size: 14px; font-weight: 500; color: var(--text); }
.option-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 11px; background: var(--border);
  border: 1.5px solid var(--border-strong); cursor: pointer; transition: all 0.2s ease;
}
.toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toggle input:checked + .toggle-track { background: var(--blue); border-color: var(--blue); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* Submit button */
.submit-wrap-inner { margin-top: 16px; opacity: 0; animation: appear 0.5s ease forwards 0.2s; }
.btn-primary {
  width: 100%; height: 48px; background: var(--blue); color: white;
  font-family: var(--f); font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  border: none; border-radius: 100px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px rgba(26,115,232,0.3), 0 4px 12px rgba(26,115,232,0.15);
}
.btn-primary:hover:not(:disabled) {
  background: #1557B0;
  box-shadow: 0 2px 6px rgba(26,115,232,0.35), 0 8px 20px rgba(26,115,232,0.2);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: scale(0.99); }
.btn-primary:disabled { background: var(--border); color: var(--text-3); cursor: not-allowed; box-shadow: none; transform: none; }

/* Results section */
#results-section { margin-top: 32px; }
.results-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.results-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); }
.results-summary { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.results-summary strong { color: var(--text); font-weight: 600; }
.results-actions { display: flex; gap: 8px; flex-shrink: 0; }
.results-dl-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 100px; border: 1px solid var(--border); background: var(--white);
  font-family: var(--f); font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all 0.15s ease;
}
.results-dl-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

/* Results area */
.results-area { display: flex; flex-direction: column; gap: 12px; }

/* Result card */
.result-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; animation: appear 0.3s ease; }
.rc-header {
  display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.rc-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.rc-status-dot {
  width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.rc-status-dot.processing { background: var(--blue-light); }
.rc-status-dot.done { background: var(--green-light); }
.rc-filename { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rc-badge {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 100px;
}
.rc-badge.processing { background: var(--blue-light); color: var(--blue); }
.rc-badge.done { background: var(--green-light); color: var(--green); }
.rc-collapse-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: transparent;
  cursor: pointer; color: var(--text-3); display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.rc-collapse-btn:hover { background: var(--page); }
.rc-collapse-chevron { transition: transform 0.22s ease; }
.rc-collapse-chevron.collapsed { transform: rotate(180deg); }

/* Result card body */
.rc-body { padding: 0 20px 20px; }
.rc-body.hidden { display: none; }

/* Processing body */
.rc-processing { display: flex; align-items: center; gap: 14px; padding: 20px; }
.rc-spinner {
  width: 20px; height: 20px; border: 2.5px solid var(--blue-light);
  border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0;
}
.rc-processing-text { font-size: 14px; color: var(--text-2); }
.rc-processing-text strong { color: var(--text); font-weight: 600; }

/* Audio player */
.audio-player {
  margin: 16px 0; padding: 12px 16px; background: var(--page);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  display: flex; align-items: center; gap: 12px;
}
.ap-play-btn {
  width: 34px; height: 34px; border-radius: 50%; background: var(--blue);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.15s ease;
}
.ap-play-btn:hover { background: #1557B0; transform: scale(1.05); }
.ap-play-btn svg { color: white; }
.ap-progress { flex: 1; min-width: 0; }
.ap-track {
  position: relative; height: 4px; background: var(--border); border-radius: 2px;
  cursor: pointer; margin-bottom: 6px;
}
.ap-fill { height: 100%; background: var(--blue); border-radius: 2px; width: 0; position: relative; }
.ap-thumb {
  position: absolute; right: -6px; top: -4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--blue); border: 2px solid var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2); opacity: 0; transition: opacity 0.15s;
}
.ap-track:hover .ap-thumb { opacity: 1; }
.ap-times { display: flex; justify-content: space-between; }
.ap-time { font-size: 11px; color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.ap-vol-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: transparent;
  cursor: pointer; color: var(--text-3); display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.ap-vol-btn:hover { background: var(--border); }

/* Transcript */
.rc-transcript { font-size: 14.5px; color: var(--text); line-height: 1.75; margin-bottom: 16px; white-space: pre-wrap; }

/* Original toggle */
.rc-original-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  color: var(--blue); background: none; border: none; cursor: pointer; font-family: var(--f); padding: 0;
  margin-bottom: 8px;
}
.rc-original-btn:hover { text-decoration: underline; }
.rc-original-text {
  font-size: 13.5px; color: var(--text-2); line-height: 1.7; background: var(--page);
  border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px;
  border-left: 3px solid var(--border-strong); white-space: pre-wrap;
}

/* Card actions */
.rc-actions { display: flex; gap: 8px; }
.rc-action-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: 100px; border: 1px solid var(--border); background: var(--white);
  font-family: var(--f); font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all 0.15s ease;
}
.rc-action-btn:hover { background: var(--page); border-color: var(--border-strong); }
.rc-action-btn.copied { border-color: var(--green); color: var(--green); background: var(--green-light); }

/* Delete all */
.delete-all-btn {
  width: 100%; height: 48px; margin-top: 24px; border-radius: 100px;
  border: 1.5px solid var(--border); background: var(--white); color: var(--text-2);
  font-family: var(--f); font-size: 14px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.18s ease;
}
.delete-all-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }
.delete-all-btn.confirm { border-color: var(--red); color: var(--red); background: var(--red-light); font-weight: 600; }

/* Utilities */
.hidden { display: none !important; }

/* Footer */
footer {
  max-width: 960px; margin: 0 auto; padding: 24px 32px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border);
}
footer a { color: var(--text-2); text-decoration: none; }
footer a:hover { color: var(--blue); text-decoration: underline; }

/* Animations */
@keyframes appear {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 0.8s linear infinite; }
