:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-soft: #edf6f3;
  --text: #17202a;
  --muted: #627084;
  --line: #d9e1ea;
  --accent: #1769d1;
  --accent-strong: #0f4f9f;
  --success: #16855f;
  --shadow: 0 18px 48px rgba(20, 36, 56, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  font-weight: 820;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.nav a:hover {
  color: var(--text);
}

.workspace {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 24px 40px;
}

.workspace.is-tool-page {
  padding-top: 44px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.breadcrumb a {
  color: var(--accent);
}

.breadcrumb span::before {
  content: "/";
  margin-right: 8px;
  color: #9aa9b8;
}

.intro {
  max-width: 760px;
  margin-bottom: 28px;
}

.intro h1 {
  margin: 0 0 14px;
  font-size: clamp(40px, 6vw, 70px);
  line-height: 0.96;
  letter-spacing: 0;
}

.intro p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-panel {
  grid-row: span 2;
  padding: 22px;
}

.controls-panel,
.results-panel {
  padding: 20px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 340px;
  padding: 28px;
  text-align: center;
  border: 1px dashed #9db1c8;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(237, 246, 243, 0.85)),
    var(--surface-soft);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--accent);
  background: #eef7ff;
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 10px 28px rgba(23, 105, 209, 0.16);
}

.drop-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-title {
  display: block;
  margin-bottom: 6px;
  font-size: 23px;
  font-weight: 780;
}

.drop-copy {
  display: block;
  color: var(--muted);
  font-size: 15px;
}

.preview-wrap {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f8;
}

.preview-wrap img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

label,
output {
  color: #344457;
  font-size: 13px;
  font-weight: 720;
}

select,
input[type="number"] {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.image-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.image-details div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.image-details span,
.image-details strong {
  display: block;
}

.image-details span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.image-details strong {
  font-size: 15px;
  line-height: 1.2;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.primary-btn,
.ghost-btn,
.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
}

.primary-btn {
  flex: 1;
  background: var(--accent);
  color: #ffffff;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-strong);
}

.ghost-btn {
  min-width: 92px;
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

button:disabled,
.download-btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.metrics div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.metrics span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.metrics strong {
  display: block;
  font-size: 19px;
  line-height: 1.1;
}

.download-btn {
  width: 100%;
  background: var(--success);
  color: #ffffff;
}

.zip-btn {
  width: 100%;
  margin-top: 10px;
}

.batch-results {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.batch-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.batch-heading strong {
  font-size: 14px;
}

.batch-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.batch-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.batch-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.batch-item.is-error {
  border-color: #efc6c1;
  background: #fff7f5;
}

.batch-item strong,
.batch-item span {
  display: block;
}

.batch-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.batch-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.batch-item a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  font-size: 12px;
  font-weight: 760;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.format-guide {
  max-width: 1180px;
  margin: 28px auto 0;
  padding: 40px 24px 12px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.1;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.capability-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.capability-strip div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.capability-strip strong,
.capability-strip span {
  display: block;
}

.capability-strip strong {
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text);
}

.capability-strip span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.format-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.format-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.format-table th,
.format-table td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
  vertical-align: top;
}

.format-table th {
  background: #f3f7fb;
  color: #334257;
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.format-table tr:last-child td {
  border-bottom: 0;
}

.method-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
  gap: 28px;
  max-width: 1180px;
  margin: 32px auto 0;
  padding: 34px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.method-band h2,
.experiment h2 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.1;
}

.method-band p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.method-list {
  align-self: center;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #334257;
  font-size: 15px;
  font-weight: 680;
}

.method-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.experiment {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 24px 72px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.note-grid article {
  min-height: 160px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.note-grid h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.note-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.seo-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 42px 24px 0;
}

.seo-section h2 {
  margin: 0 0 16px;
  font-size: 32px;
  line-height: 1.12;
}

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

.step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.step-list li {
  position: relative;
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(20, 36, 56, 0.07);
  counter-increment: steps;
}

.step-list li::before {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--text);
  color: #ffffff;
  content: counter(steps);
  font-size: 13px;
  font-weight: 820;
}

.step-list strong {
  display: block;
  margin-bottom: 7px;
  font-size: 16px;
}

.benefit-grid,
.format-copy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.benefit-card,
.format-copy-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.benefit-card h3,
.format-copy-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.link-cloud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.link-cloud a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #334257;
  font-size: 14px;
  font-weight: 690;
}

.link-cloud a:hover {
  border-color: #9db1c8;
  color: var(--text);
}

.time-tool {
  display: grid;
  gap: 18px;
  max-width: 820px;
  padding: 24px;
}

.time-input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.time-field {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.time-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.time-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.time-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.time-difference {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #bfdfd3;
  border-radius: 8px;
  background: #effaf6;
  color: #176245;
  font-size: 14px;
  font-weight: 720;
}

.time-note {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
  color: #334257;
  font-size: 14px;
  line-height: 1.45;
}

.time-note[data-type="warning"] {
  border-color: #efc6c1;
  background: #fff7f5;
  color: #8a3b31;
}

.time-chart {
  width: 100%;
  border-collapse: collapse;
}

.time-chart-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.time-chart th,
.time-chart td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.time-chart th {
  background: #f3f7fb;
  color: #334257;
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.time-chart tr:last-child td {
  border-bottom: 0;
}

.time-directory {
  max-height: 560px;
  overflow-y: auto;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 20px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 4px;
  }

  .workspace {
    padding-top: 42px;
  }

  .tool-grid,
  .capability-strip,
  .method-band,
  .note-grid,
  .step-list,
  .benefit-grid,
  .format-copy-grid,
  .time-input-grid {
    grid-template-columns: 1fr;
  }

  .link-cloud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dropzone {
    min-height: 260px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .image-details {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .intro h1 {
    font-size: 38px;
  }

  .actions {
    flex-direction: column;
  }

  .ghost-btn,
  .batch-item {
    width: 100%;
  }

  .batch-item {
    grid-template-columns: 1fr;
  }

  .link-cloud {
    grid-template-columns: 1fr;
  }
}
