:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --ink: #15171c;
  --muted: #626a76;
  --line: #d9dee7;
  --panel: #ffffff;
  --accent: #176b87;
  --accent-dark: #0f5268;
  --danger: #b42318;
  --ok: #287a3e;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 4px 0 22px;
  text-align: center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.08;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.topbar p {
  margin-top: 8px;
  color: var(--muted);
}

.status {
  min-width: 112px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.status.ok {
  color: var(--ok);
}

.status.bad {
  color: var(--danger);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 10px 22px rgba(20, 28, 38, 0.05);
}

.panel + .panel,
.grid + .panel {
  margin-top: 18px;
}

.adPanel {
  margin-top: 18px;
}

.adCard {
  display: grid;
  grid-template-columns: 192px 1fr;
  align-items: center;
  gap: 16px;
  height: 136px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 14px;
  box-shadow: 0 10px 22px rgba(20, 28, 38, 0.05);
  text-decoration: none;
}

.adMedia {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 116px;
  border-radius: 7px;
  background: transparent;
  overflow: hidden;
}

.adCard img {
  width: 100%;
  height: 116px;
  border-radius: 7px;
  object-fit: cover;
  background: transparent;
}

.adFallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.adCard strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
}

.adCard em {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-style: normal;
  font-weight: 720;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 650;
}

.inputRow,
.formatRow,
.sectionHead {
  display: flex;
  gap: 10px;
  align-items: center;
}

.formatRow {
  margin-top: 14px;
}

.formatRow label {
  margin: 0;
}

input,
select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

input {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
}

select {
  padding: 0 10px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 720;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  background: #9aa7b3;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}

.result {
  min-height: 260px;
}

.empty {
  color: var(--muted);
}

.meta {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.videoLayout {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  align-items: start;
}

.thumb {
  width: 150px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #eef2f6;
}

.title {
  font-weight: 760;
  line-height: 1.35;
}

.subtle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.formatList,
.logBox,
.fileList,
.articleBox {
  margin-top: 14px;
}

.formatList {
  display: grid;
  gap: 6px;
  max-height: 132px;
  overflow: auto;
  padding-right: 4px;
}

.formatItem,
.fileItem {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.formatItem:first-child,
.fileItem:first-child {
  border-top: 0;
}

.logBox {
  height: 176px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111822;
  color: #d7e4f2;
  padding: 12px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.articleBox {
  min-height: 180px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  color: var(--ink);
  padding: 14px;
  white-space: pre-wrap;
  line-height: 1.7;
  font-family: inherit;
}

.articleBox pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
}

.articleActions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.articleActions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 7px;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.sectionHead {
  justify-content: space-between;
}

.sectionHead button {
  min-height: 36px;
  padding: 0 12px;
}

a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .app {
    padding: 18px;
  }

  .topbar,
  .inputRow,
  .formatRow,
  .sectionHead {
    align-items: stretch;
    flex-direction: column;
  }

  .status {
    width: 100%;
  }

  .grid,
  .videoLayout {
    grid-template-columns: 1fr;
  }

  .adCard {
    grid-template-columns: 120px 1fr;
    height: 116px;
  }

  .adMedia,
  .adCard img {
    height: 94px;
  }

  .adCard strong {
    font-size: 15px;
  }

  .thumb {
    width: 100%;
  }
}


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

.payModal[hidden] {
  display: none;
}

.payDialog {
  width: min(460px, 100%);
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  padding: 20px;
}

.payText {
  color: var(--muted);
  line-height: 1.7;
}

.payActions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.qrPanel {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.qrPanel[hidden] {
  display: none;
}

.qrPanel img {
  width: min(260px, 100%);
  max-height: 360px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.qrTip {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
