:root {
  --bg: #f7f4ee;
  --paper: #fffdf8;
  --ink: #111827;
  --text: #374151;
  --muted: #7a7166;
  --line: #d8d0c3;
  --line-dark: #b8ac9c;
  --accent: #c76a2a;
  --accent-dark: #9e4e1f;
  --green: #12715f;
  --green-soft: #d7eee7;
  --red: #b42318;
  --shadow: 0 18px 42px rgba(45, 35, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  color: #9b9388;
  background: #ece5da;
  border-color: #d8d0c3;
  opacity: 1;
}

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

.hidden {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 46px);
  color: #fff;
  background: rgba(17, 24, 39, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: #fff8ee;
  background: var(--accent);
  border-radius: 8px;
  font-size: 21px;
  font-weight: 900;
}

.brand strong,
.brand em {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 22px;
  white-space: nowrap;
}

.brand em {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-style: normal;
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.account-bar span {
  max-width: 190px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 20px;
}

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  padding: 28px 0 24px;
}

.intro-copy p,
.section-head p,
.mini-head span,
.modal-card p {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: "DIN Alternate", "Courier New", monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.intro-copy h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.mobile-title {
  display: none;
}

.intro-copy > span {
  display: block;
  max-width: 650px;
  margin-top: 14px;
  color: #5d554d;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.step-strip {
  display: grid;
  gap: 8px;
  min-width: 210px;
  padding: 12px;
  background: #111827;
  border-radius: 8px;
}

.step-strip span {
  display: block;
  padding: 9px 12px;
  color: #fff8ee;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
}

.converter-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
  gap: 16px;
  align-items: stretch;
}

.tool-panel,
.work-panel,
.result-panel,
.history-panel {
  min-width: 0;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-panel,
.work-panel,
.result-panel {
  padding: 18px;
}

.result-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr) auto;
  gap: 16px;
  align-items: center;
}

.history-panel {
  margin-top: 16px;
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head strong,
.mini-head strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 25px;
  overflow-wrap: anywhere;
}

.section-head > strong {
  color: var(--accent-dark);
  font-size: 17px;
}

.work-topline span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.category-tab,
.tool-button,
.primary-button,
.ghost-button {
  border-radius: 8px;
}

.category-tab {
  min-height: 38px;
  padding: 0 14px;
  color: #5d554d;
  background: #fffaf2;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 900;
}

.category-tab.active {
  color: #fff8ee;
  background: var(--ink);
  border-color: var(--ink);
}

.tool-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tool-button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 10px;
  text-align: left;
  background: #fffaf2;
  border: 1px solid var(--line);
}

.tool-button.active {
  background: #fff4e5;
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.tool-icon,
.file-type,
.result-box > span {
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-family: "DIN Alternate", "Courier New", monospace;
  font-weight: 900;
  text-transform: uppercase;
}

.tool-icon {
  width: 48px;
  height: 48px;
  font-size: 12px;
}

.file-icon {
  overflow: hidden;
  background: transparent;
}

.file-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tool-button strong,
.history-item strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 20px;
}

.tool-button span,
.history-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.upload-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 246px;
  margin-top: 18px;
  padding: 30px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(199, 106, 42, 0.08), transparent 48%),
    #fffaf2;
  border: 2px dashed var(--line-dark);
  border-radius: 8px;
}

.upload-zone.dragging {
  background: var(--green-soft);
  border-color: var(--green);
}

.upload-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  color: #fff8ee;
  background: var(--accent);
  border-radius: 8px;
  font-size: 34px;
  font-weight: 900;
}

.upload-zone strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 34px;
}

.upload-zone span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.selected-files,
.options-panel {
  margin-top: 14px;
  padding: 14px;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.mini-head span {
  margin: 0;
}

.file-list,
.history-list {
  display: grid;
  gap: 8px;
}

.file-item,
.history-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.file-type {
  width: 46px;
  height: 40px;
  font-size: 11px;
}

.file-item strong,
.file-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item strong {
  color: var(--ink);
  font-size: 14px;
}

.file-item span {
  color: var(--muted);
  font-size: 12px;
}

.remove-file {
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.empty-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.field-row span {
  color: var(--ink);
  font-weight: 900;
}

.field-row input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.action-bar,
.result-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.action-bar {
  margin-top: 14px;
}

.action-bar span {
  color: var(--muted);
  font-size: 14px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.primary-button {
  color: #fff8ee;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.ghost-button {
  color: var(--text);
  background: #fffaf2;
  border: 1px solid var(--line);
}

.app-header .ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.price-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  color: #fff8ee;
  background: var(--green);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.result-box {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 12px;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-box > span {
  width: 58px;
  height: 58px;
  font-size: 14px;
}

.result-box strong,
.result-box p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-box strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  line-height: 22px;
}

.result-box p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.result-actions {
  justify-content: flex-end;
}

.history-item {
  grid-template-columns: 42px minmax(0, 1fr);
  cursor: pointer;
}

.history-item.active {
  border-color: var(--accent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 34px;
  padding: 0 8px;
  color: #064e3b;
  background: var(--green-soft);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.failed {
  color: #7f1d1d;
  background: #fee2e2;
}

.status-pill.locked {
  color: #78350f;
  background: #f8dfad;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.58);
}

.modal-card {
  position: relative;
  width: min(460px, 100%);
  padding: 24px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-card h2 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 26px;
  line-height: 32px;
}

.login-card {
  text-align: left;
}

.login-head h2 {
  margin: 0 38px 6px 0;
}

.login-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.wechat-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: #07c160;
  font-family: "DIN Alternate", "Courier New", monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.wechat-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #07c160;
  box-shadow: 0 0 0 4px rgba(7, 193, 96, 0.13);
}

.wechat-login-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  color: #076f3d;
  background: rgba(7, 193, 96, 0.07);
  border: 1px solid rgba(7, 193, 96, 0.14);
  border-radius: 8px;
}

.wechat-login-brand span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
}

.wechat-login-brand span::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 14px;
  border-radius: 9px 9px 9px 3px;
  background: #07c160;
  box-shadow: 12px 5px 0 -4px rgba(7, 193, 96, 0.46);
}

.wechat-login-brand small {
  color: rgba(7, 111, 61, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.wechat-login-box {
  display: grid;
  place-items: center;
  min-height: 430px;
  margin-top: 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 193, 96, 0.06), transparent 42%),
    #fffaf2;
  border: 1px solid rgba(7, 193, 96, 0.18);
  border-radius: 8px;
}

.wechat-login-box iframe {
  width: 410px;
  height: 410px;
  border: 0;
}

.login-loading {
  color: var(--muted);
  font-size: 14px;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 22px;
}

.pay-qr {
  display: block;
  width: 260px;
  max-width: 100%;
  min-height: 260px;
  margin: 0 auto 14px;
  background: #fffaf2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#payStatusText {
  display: block;
  margin: 0 0 12px;
  color: var(--ink);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .intro-panel,
  .converter-shell,
  .result-panel {
    grid-template-columns: 1fr;
  }

  .step-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .result-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .app-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .account-bar {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .account-bar span {
    max-width: 100%;
    flex-basis: 100%;
  }

  .workspace {
    width: min(calc(100% - 20px), 1180px);
    padding-top: 14px;
  }

  .intro-panel {
    padding: 18px 0;
  }

  .intro-copy h1 {
    max-width: 100%;
    font-size: 32px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: inline;
  }

  .intro-copy > span {
    font-size: 15px;
    line-height: 1.6;
  }

  .section-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section-head > strong {
    font-size: 15px;
  }

  .step-strip {
    grid-template-columns: 1fr;
  }

  .tool-panel,
  .work-panel,
  .result-panel,
  .history-panel {
    width: 100%;
    padding: 14px;
    overflow: hidden;
  }

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

  .category-tab {
    width: 100%;
  }

  .tool-button {
    grid-template-columns: 46px minmax(0, 1fr);
    min-width: 0;
  }

  .tool-button > span:last-child {
    min-width: 0;
  }

  .tool-button strong,
  .tool-button span span {
    overflow-wrap: anywhere;
  }

  .upload-zone {
    min-height: 210px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button,
  .result-actions .primary-button,
  .result-actions .ghost-button,
  .action-bar .primary-button {
    width: 100%;
  }

  .result-box,
  .file-item,
  .history-item {
    min-width: 0;
  }

  .result-actions,
  .action-bar {
    align-items: stretch;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100vh - 20px);
    overflow: auto;
  }

  .wechat-login-box {
    min-height: 360px;
  }

  .wechat-login-box iframe {
    width: 340px;
    height: 360px;
  }
}
