:root {
  color-scheme: light;
  --ink: #15251e;
  --muted: #65736c;
  --line: #dce5e0;
  --paper: #ffffff;
  --canvas: #f3f7f4;
  --green: #178354;
  --green-dark: #0f6942;
  --green-soft: #e8f5ee;
  --orange: #db672a;
  --red: #bd3b3b;
  --shadow: 0 24px 70px rgba(25, 59, 43, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(134, 207, 165, .18), transparent 28rem),
    radial-gradient(circle at 90% 28%, rgba(255, 208, 155, .16), transparent 24rem),
    var(--canvas);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  width: min(1120px, calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 11px 11px 11px 3px;
  background: var(--green);
  box-shadow: 0 7px 18px rgba(23, 131, 84, .22);
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  color: var(--green-dark);
  border: 1px solid #cde5d7;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 700;
}

.service-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #29a96e;
  box-shadow: 0 0 0 4px rgba(41, 169, 110, .13);
}

main { width: min(900px, calc(100% - 32px)); margin: 44px auto 0; }

.hero { max-width: 720px; margin: 0 auto 34px; text-align: center; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.12;
  letter-spacing: -.045em;
  font-weight: 700;
}

.hero-copy { margin: 17px 0 0; color: var(--muted); font-size: 16px; line-height: 1.8; }

.converter-card {
  padding: clamp(22px, 5vw, 42px);
  border: 1px solid rgba(213, 225, 218, .9);
  border-radius: 28px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset + fieldset { margin-top: 32px; }
.mode-tabs { display: flex; gap: 6px; margin: 0 0 28px; padding: 4px; border-radius: 14px; background: #f0f5f2; }
.mode-tab { flex: 1; min-height: 40px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 800; cursor: pointer; }
.mode-tab.active { color: var(--green-dark); background: white; box-shadow: 0 3px 10px rgba(25, 59, 43, .09); }
legend {
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
}
legend > span#upload-title { width: auto; height: auto; color: inherit; border-radius: 0; background: transparent; font-size: inherit; font-weight: inherit; }

legend > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--green);
  border-radius: 50%;
  background: var(--green-soft);
  font-size: 12px;
}

.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.format-option {
  position: relative;
  min-height: 84px;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.format-option:hover { transform: translateY(-2px); border-color: #a9c9b7; }
.format-option.selected { border-color: var(--green); background: #f6fbf8; }
.format-option input { position: absolute; opacity: 0; pointer-events: none; }
.format-option > span:nth-of-type(2) { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.format-option strong { font-size: 13px; white-space: nowrap; }
.format-option small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.file-icon {
  flex: 0 0 38px;
  height: 44px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 7px 7px 7px 2px;
  font-size: 15px;
  font-weight: 900;
}
.file-icon.word { background: #3272c8; }
.file-icon.excel { background: #268658; }
.file-icon.powerpoint { background: #d16135; }
.checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--green);
  font-size: 10px;
  font-style: normal;
}
.selected .checkmark { display: grid; }

.drop-zone {
  min-height: 176px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed #a9beb2;
  border-radius: 18px;
  background: #fafcfb;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--green); background: var(--green-soft); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone strong { font-size: 15px; }
.drop-zone small { color: var(--muted); font-size: 12px; }
.upload-symbol {
  width: 44px;
  height: 44px;
  margin-bottom: 3px;
  display: grid;
  place-items: center;
  color: var(--green);
  border: 1px solid #cde3d5;
  border-radius: 14px;
  background: white;
  font-size: 24px;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(34, 81, 57, .08);
}

.selected-file {
  min-height: 76px;
  padding: 12px 14px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fafcfb;
}
.selected-file:not([hidden]) { display: flex; }
.pdf-badge {
  width: 42px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 8px 8px 8px 2px;
  background: #d95252;
  font-size: 10px;
  font-weight: 900;
}
.file-details { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.file-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-details small { color: var(--muted); font-size: 11px; }
#remove-file {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}
#remove-file:hover { color: var(--red); background: #fceeee; }
.image-preview-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.image-preview { min-width: 0; position: relative; padding: 7px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: grab; }
.image-preview:active { cursor: grabbing; }
.image-preview img { width: 36px; height: 36px; flex: 0 0 auto; object-fit: cover; border-radius: 6px; background: var(--canvas); }
.image-preview span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.image-preview button { width: 20px; height: 20px; flex: 0 0 auto; margin-left: auto; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.image-preview button:hover { color: var(--red); background: #fceeee; }

.auto-detect-note {
  margin: 20px 0;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: #f7fbf8;
}
.auto-detect-note > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-weight: 800;
}
.auto-detect-note p { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.auto-detect-note strong { font-size: 13px; }
.auto-detect-note small { color: var(--muted); font-size: 11px; }

.form-error {
  margin: 0 0 12px;
  padding: 11px 13px;
  color: #8f2929;
  border-radius: 10px;
  background: #fcecec;
  font-size: 12px;
}
.primary-button, .download-button {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: white;
  border: 0;
  border-radius: 14px;
  background: var(--green);
  box-shadow: 0 11px 26px rgba(23, 131, 84, .22);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, transform .18s;
}
.primary-button:hover, .download-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }

.job-panel { align-items: center; gap: 22px; text-align: left; }
.job-panel:not([hidden]) { display: flex; }
.job-status-icon {
  flex: 0 0 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: var(--green-soft);
}
.job-status-icon span {
  width: 28px;
  height: 28px;
  border: 3px solid #a9d5bd;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.job-status-icon.success span, .job-status-icon.failed span { border: 0; animation: none; }
.job-status-icon.success span::before { content: "✓"; color: var(--green); font-size: 32px; font-weight: 900; }
.job-status-icon.failed { background: #fcecec; }
.job-status-icon.failed span::before { content: "!"; color: var(--red); font-size: 32px; font-weight: 900; }
@keyframes spin { to { transform: rotate(360deg); } }
.job-copy { min-width: 0; flex: 1; }
.job-kicker { margin: 0 0 4px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.job-copy h2 { margin: 0; font-size: 21px; }
.job-copy > p:not(.job-kicker) { margin: 7px 0 11px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.job-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 10px; }
.job-actions { width: 205px; display: flex; flex-direction: column; gap: 8px; }
.download-button { min-height: 43px; font-size: 12px; }
.secondary-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.text-button { border: 0; color: var(--muted); background: transparent; font-size: 11px; cursor: pointer; }
.text-button:hover { color: var(--red); }

.feature-strip {
  margin: 24px auto 0;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(213, 225, 218, .8);
  border-radius: 20px;
  background: rgba(255, 255, 255, .58);
}
.feature-strip > div { display: flex; justify-content: center; align-items: center; gap: 11px; }
.feature-strip > div + div { border-left: 1px solid var(--line); }
.feature-strip > div > span { color: var(--green); font-size: 22px; }
.feature-strip p { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.feature-strip strong { font-size: 12px; }
.feature-strip small { color: var(--muted); font-size: 10px; }

footer { padding: 28px 20px 36px; color: var(--muted); text-align: center; font-size: 11px; }
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .site-header { width: calc(100% - 28px); height: 64px; }
  .service-state { padding: 6px 9px; }
  main { width: min(100% - 22px, 620px); margin-top: 30px; }
  .hero { margin-bottom: 25px; }
  .hero-copy { padding: 0 12px; font-size: 14px; }
  .converter-card { border-radius: 22px; }
  .format-grid { grid-template-columns: 1fr; }
  .format-option { min-height: 72px; }
  .format-option small { font-size: 11px; }
  .job-panel:not([hidden]) { flex-direction: column; text-align: center; }
  .job-meta { justify-content: center; }
  .job-actions { width: 100%; }
  .feature-strip { grid-template-columns: 1fr; gap: 16px; }
  .feature-strip > div { justify-content: flex-start; padding-left: 18%; }
  .feature-strip > div + div { padding-top: 16px; border-top: 1px solid var(--line); border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
