:root {
  color-scheme: light;
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.hero {
  margin-bottom: 24px;
}

.page-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 24px;
  border: 1px solid #d5deec;
  border-radius: 999px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(22, 34, 51, 0.06);
}

.tab-button {
  border-radius: 999px;
  background: transparent;
  color: #5b6b8c;
  padding: 10px 18px;
}

.tab-button.active {
  background: #172033;
  color: #fff;
}

.tool-page {
  display: none;
}

.tool-page.active {
  display: block;
}

.eyebrow {
  margin: 0 0 10px;
  color: #5b6b8c;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.05;
}

.subtitle {
  max-width: 720px;
  color: #5b6b8c;
  font-size: 18px;
}

.card,
.results {
  border: 1px solid #e1e7f2;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(22, 34, 51, 0.08);
}

.card {
  padding: 28px;
}

.form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
  color: #253047;
  font-weight: 700;
}

.field small {
  color: #7b879d;
  font-weight: 400;
}

input[type="file"],
input[type="text"],
select,
textarea {
  width: 100%;
  border: 1px solid #d5deec;
  border-radius: 14px;
  background: #fbfcff;
  color: #172033;
  outline: none;
  padding: 12px 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

input[type="file"] {
  padding: 10px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #3b73ff;
  box-shadow: 0 0 0 4px rgba(59, 115, 255, 0.12);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.hidden {
  display: none;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #253047;
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

button {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
}

#submitButton,
.primary-button {
  padding: 14px 18px;
  background: linear-gradient(135deg, #245cff, #7d5cff);
  color: #fff;
  box-shadow: 0 14px 24px rgba(36, 92, 255, 0.22);
}

#submitButton:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.ghost {
  border: 1px solid #d5deec;
  background: #fff;
  color: #3b4b66;
  padding: 10px 14px;
}

.status {
  min-height: 24px;
  margin: 0;
  color: #5b6b8c;
}

.status.error {
  color: #c53030;
}

.preview-grid,
.result-grid {
  display: grid;
  gap: 14px;
}

.preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.result-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.empty {
  min-height: 120px;
  place-items: center;
  border: 1px dashed #c9d4e5;
  border-radius: 18px;
  color: #7b879d;
  background: #fbfcff;
}

.preview-card,
.result-card {
  overflow: hidden;
  border: 1px solid #e1e7f2;
  border-radius: 18px;
  background: #fff;
}

.preview-card {
  position: relative;
}

.remove-preview {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.78);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(23, 32, 51, 0.22);
}

.remove-preview:hover {
  background: #c53030;
}

.preview-card img,
.result-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #eef2f8;
}

.preview-info,
.result-actions {
  padding: 12px;
}

.preview-info {
  color: #5b6b8c;
  font-size: 13px;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-actions a {
  flex: 1;
  border-radius: 12px;
  background: #172033;
  color: #fff;
  padding: 10px 12px;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
}

.result-actions a.secondary {
  border: 1px solid #d5deec;
  background: #fff;
  color: #3b4b66;
}

.video-card {
  grid-column: 1 / -1;
}

.video-card video {
  display: block;
  width: 100%;
  max-height: 640px;
  border-radius: 18px 18px 0 0;
  background: #000;
}

.task-meta {
  margin: 0;
  color: #7b879d;
  font-size: 13px;
  word-break: break-all;
}

.results {
  margin-top: 24px;
  padding: 28px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 1120px);
    padding-top: 24px;
  }

  .card,
  .results {
    padding: 18px;
    border-radius: 18px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}
