:root {
  color-scheme: light;
  --bg: #ffffff;
  --navy: #1a365d;
  --navy-soft: rgba(26, 54, 93, 0.1);
  --accent: #e65100;
  --magenta: #d61f69;
  --sea: #0477bf;
  --line: rgba(26, 54, 93, 0.16);
  --muted: #5f6f83;
  --panel: rgba(255, 255, 255, 0.9);
  --glass: rgba(255, 255, 255, 0.74);
  --shadow: 0 24px 70px rgba(26, 54, 93, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft JhengHei", "Noto Sans TC", "PingFang TC", Arial, sans-serif;
  color: var(--navy);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), #ffffff 38%),
    url("assets/coastal-anime-hero.png") top center / 100% auto no-repeat fixed,
    #ffffff;
}

button,
select,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  min-height: 340px;
  display: flex;
  align-items: end;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(6, 18, 38, 0.78), rgba(6, 18, 38, 0.28) 54%, rgba(6, 18, 38, 0.04)),
    url("assets/coastal-anime-hero.png") center / cover no-repeat;
  box-shadow: var(--shadow);
}

.hero-overlay {
  width: min(760px, 100%);
  padding: 42px;
  color: #ffffff;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.46);
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: #ffb25d;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.14;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
  letter-spacing: 0;
}

.intro {
  max-width: 660px;
  margin-top: 14px;
  font-size: 18px;
  line-height: 1.75;
}

.step-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.step-tab {
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  color: var(--navy);
  text-align: left;
  font-weight: 900;
  backdrop-filter: blur(12px);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.step-tab span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 13px;
}

.step-tab:hover,
.step-tab.is-active {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: #ffffff;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.content-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(26, 54, 93, 0.11);
  backdrop-filter: blur(14px);
}

.split-card {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  align-items: start;
}

.body-copy {
  margin-top: 12px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.check-list,
.process-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li,
.process-list li {
  padding: 14px 16px;
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 26px rgba(26, 54, 93, 0.08);
  font-weight: 800;
  line-height: 1.55;
}

.process-list {
  counter-reset: steps;
}

.process-list li {
  counter-increment: steps;
}

.process-list li::before {
  content: counter(steps) ". ";
  color: var(--accent);
}

.section-heading,
.mini-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--navy-soft);
  color: var(--navy);
  font-size: 13px;
  font-weight: 900;
}

.pill.accent {
  background: rgba(230, 81, 0, 0.12);
  color: var(--accent);
}

.controls {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.5fr) auto;
  gap: 12px;
  align-items: end;
}

label {
  color: var(--navy);
  font-weight: 900;
}

select,
textarea,
input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--navy);
}

select,
input[type="number"] {
  min-height: 48px;
  padding: 0 12px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  border: 0;
  font-weight: 900;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(230, 81, 0, 0.24);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--navy);
}

.status-row,
.hint-text {
  min-height: 28px;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 900;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.preview-area,
.word-grid {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mini-heading {
  margin-bottom: 0;
}

.mini-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

textarea {
  min-height: 370px;
  resize: vertical;
  padding: 16px;
  line-height: 1.75;
}

#word-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: words;
}

#word-list li {
  counter-increment: words;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(214, 31, 105, 0.1);
  color: #7c1642;
  font-weight: 900;
}

#word-list li::before {
  content: counter(words, decimal-leading-zero);
  color: rgba(124, 22, 66, 0.58);
  font-size: 12px;
}

.cutter-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 18px;
}

.cutter-controls {
  display: grid;
  gap: 14px;
  align-content: start;
}

.upload-box {
  display: grid;
  gap: 6px;
  min-height: 126px;
  align-content: center;
  justify-items: center;
  padding: 18px;
  border: 2px dashed var(--sea);
  border-radius: 8px;
  background: rgba(4, 119, 191, 0.08);
  color: var(--navy);
  text-align: center;
}

.upload-box small {
  color: var(--muted);
}

.upload-box input {
  display: none;
}

.number-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.number-row label,
.range-row {
  display: grid;
  gap: 8px;
}

.range-row span {
  justify-self: end;
  color: var(--accent);
}

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

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.cutter-preview {
  min-height: 560px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
}

.empty-preview,
.original-wrap {
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  overflow: auto;
}

.original-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.original-stage img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  pointer-events: none;
}

.grid-overlay span {
  border: 1px dashed rgba(230, 81, 0, 0.72);
  background: rgba(230, 81, 0, 0.05);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.result-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.checker {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #edf2f7 25%, transparent 25%),
    linear-gradient(-45deg, #edf2f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf2f7 75%),
    linear-gradient(-45deg, transparent 75%, #edf2f7 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.checker img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.download-single {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--navy);
  font-weight: 900;
}

@media (max-width: 860px) {
  body {
    background-size: auto 420px;
  }

  .hero-overlay {
    padding: 28px;
  }

  .step-tabs,
  .tool-grid,
  .cutter-layout,
  .split-card {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 520px) {
  .app {
    width: min(100% - 18px, 1180px);
    padding-top: 12px;
  }

  .hero {
    min-height: 300px;
  }

  .content-card {
    padding: 18px;
  }

  #word-list,
  .result-grid {
    grid-template-columns: 1fr;
  }
}
