:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d9e0e7;
  --soft: #f5f7f9;
  --teal: #0f9f92;
  --teal-dark: #087b73;
  --amber: #b7791f;
  --blue: #2563eb;
  --green: #15803d;
  --red: #c2410c;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 20px;
  font-weight: 800;
}
.nav {
  display: flex;
  gap: 8px;
}
.nav a {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
}
.nav a:hover { background: var(--soft); color: var(--text); }
.page {
  width: min(1180px, calc(100vw - 32px));
  margin: 32px auto;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 24px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
}
h1, h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.15;
}
h1 { font-size: 28px; }
h2 { font-size: 20px; }
.muted {
  color: var(--muted);
}
.submit-panel .muted {
  margin: 10px 0 24px;
}
.field {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  border: 0;
  padding: 0;
}
.field > span,
legend {
  font-size: 13px;
  font-weight: 800;
  color: #344054;
}
input[type="url"] {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
}
input[type="url"]:focus {
  outline: 2px solid rgba(15, 159, 146, 0.2);
  border-color: var(--teal);
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.segmented label {
  min-height: 42px;
}
.segmented input,
.mode-option input {
  position: absolute;
  opacity: 0;
}
.segmented span {
  display: grid;
  place-items: center;
  min-height: 42px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
}
.segmented label + label span {
  border-left: 1px solid var(--line);
}
.segmented input:checked + span {
  background: #e9fbf7;
  color: var(--teal-dark);
}
.mode-grid {
  display: grid;
  gap: 10px;
}
.mode-option {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  cursor: pointer;
}
.mode-option:has(input:checked) {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(15, 159, 146, 0.12);
}
.mode-title {
  font-weight: 800;
}
.mode-copy {
  color: var(--muted);
  font-size: 13px;
}
.primary-button,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--teal);
  color: white;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.primary-button:hover,
.primary-link:hover { background: var(--teal-dark); }
.inline-button { width: max-content; margin-top: 20px; }
.text-link {
  color: var(--teal-dark);
  font-weight: 800;
}
.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-head { padding: 24px 24px 0; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}
th, td {
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: #475467;
  background: var(--soft);
  font-size: 12px;
  text-transform: uppercase;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--teal-dark); }
.nowrap { white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 32px; }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  background: #eef2f6;
  color: #475467;
}
.status-downloading,
.status-separating,
.status-transcribing,
.status-translating,
.status-burning,
.status-uploading { background: #eaf1ff; color: var(--blue); }
.status-done { background: #e9f8ee; color: var(--green); }
.status-error { background: #fff1e8; color: var(--red); }
.download {
  color: var(--teal-dark);
  font-weight: 800;
}
.mini-table-panel {
  padding: 0;
  overflow: hidden;
}
.mini-table-panel .panel-head {
  padding: 24px 24px 0;
}
.compact-table {
  min-width: 680px;
}
.flow-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 18px 24px 24px;
  border-top: 1px solid var(--line);
}
.flow-strip span {
  border-left: 3px solid var(--teal);
  padding-left: 10px;
  color: var(--muted);
  font-weight: 800;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}
.detail-grid div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.error-box {
  margin: 20px 0 0;
  padding: 14px;
  border-radius: 6px;
  background: #fff7ed;
  color: var(--red);
  white-space: pre-wrap;
}
@media (max-width: 820px) {
  .topbar { padding: 0 16px; }
  .workspace { grid-template-columns: 1fr; }
  .page { margin: 20px auto; }
  .panel { padding: 18px; }
  .detail-grid { grid-template-columns: 1fr; }
}
