:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #fcfdff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe3ee;
  --line-strong: #cbd5e1;
  --navy: #0f172a;
  --blue: #2f6fed;
  --green: #35a66a;
  --success-bg: #ecfdf5;
  --success-line: #86efac;
  --success-text: #166534;
  --working-bg: #eff6ff;
  --working-line: #93c5fd;
  --working-text: #1d4ed8;
  --error-bg: #fef2f2;
  --error-line: #fca5a5;
  --error-text: #b91c1c;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  #font-family: Arial, Helvetica, sans-serif;
  #font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -0.01em;
  line-height: 1.55;
}

h1, h2, h3 {
  font-weight: 700;
}

a {
  color: #1d4ed8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 2px;
}

.brand a {
  color: var(--navy);
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.nav a {
  color: #334155;
  font-weight: 600;
}

.main-content {
  padding: 28px 0 56px;
}

.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 800;
}

.hero p {
  margin: 0;
  color: #334155;
  font-size: 1.02rem;
}

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

.card {
  display: block;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  color: inherit;
}

.card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.card h2 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 800;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.page-section h1 {
  margin: 0 0 14px;
  font-size: 2.1rem;
  line-height: 1.2;
  font-weight: 800;
}

.page-section h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 800;
}

.page-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
}

.lead {
  margin: 0 0 20px;
  color: #334155;
  font-size: 1.03rem;
  line-height: 1.65;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  margin: 0 0 18px;
  box-shadow: var(--shadow);
}

.upload-form {
  margin: 0;
}

.form-row {
  margin-bottom: 18px;
}

.form-row label {
  display: block;
  margin-bottom: 8px;
}

.form-row input[type="file"],
.form-row select {
  width: 100%;
  max-width: 640px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
}

.checkbox-line {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 8px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hint {
  color: var(--muted);
  font-size: 0.97rem;
  margin: 8px 0 0;
  line-height: 1.55;
}

.inner-panel {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 16px;
  background: var(--surface-soft);
}

.service-list {
  margin: 0;
  padding-left: 20px;
}

.service-list li {
  margin: 0 0 12px;
  line-height: 1.5;
}

.form-actions {
  margin-top: 16px;
}

.form-actions button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.form-actions button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.status-box {
  border-radius: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
  margin-bottom: 12px;
}

.status-box.success {
  background: var(--success-bg);
  border-color: var(--success-line);
  color: var(--success-text);
}

.status-box.working {
  background: var(--working-bg);
  border-color: var(--working-line);
  color: var(--working-text);
}

.status-box.error {
  background: var(--error-bg);
  border-color: var(--error-line);
  color: var(--error-text);
}

.progress-full {
  margin-left: 20px;
  margin-right: 20px;
}

.progress-wrap {
  width: 100%;
  height: 32px;
  background: #e9edf3;
  overflow: hidden;
  border-top: 1px solid #d6dce5;
  border-bottom: 1px solid #d6dce5;
}

.progress-bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--blue), var(--green));
  color: #fff;
  font-weight: 700;
  transition: width 0.25s ease;
  white-space: nowrap;
}

.progress-label {
  font-size: 13px;
  line-height: 1;
}

.video-shell {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #d9e0ea;
  box-shadow: var(--shadow);
}

.result-video-player {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
}

.result-actions {
  margin-top: 12px;
}

.result-box {
  margin: 0;
  background: #0b1220;
  color: #dbeafe;
  border-radius: 14px;
  padding: 16px 18px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 20px, 1120px);
  }

  .header-inner {
    min-height: auto;
    padding: 12px 2px;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    gap: 12px;
  }

  .panel {
    padding: 16px 14px;
  }

  .progress-full {
    margin-left: -14px;
    margin-right: -14px;
  }

  .hero {
    padding: 22px 18px;
  }

  .page-section h1,
  .hero h1 {
    font-size: 1.7rem;
  }
}