:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --soft: #f9fafb;
  --line: #d9dde5;
  --text: #1f2328;
  --muted: #667085;
  --blue: #0b63ce;
  --blue-dark: #084f9f;
  --green: #087443;
  --warn: #95620a;
  --shadow: 0 10px 28px rgba(27, 39, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

.topbar,
.bottombar {
  position: sticky;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.topbar {
  top: 0;
  min-height: 72px;
  padding: 12px 20px;
}

.bottombar {
  bottom: 0;
  min-height: 64px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

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

h1 {
  font-size: 22px;
  line-height: 1.25;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

h3 {
  font-size: 14px;
  line-height: 1.3;
}

.brand {
  display: grid;
  gap: 4px;
}

#statusText,
.panelHead span,
.bottombar span,
.notice,
.statusBox {
  color: var(--muted);
  font-size: 13px;
}

.toolbar,
.bottomActions,
.buttonGrid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(420px, 1fr) minmax(300px, 340px);
  gap: 14px;
  padding: 14px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
}

.left,
.right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - 164px);
  overflow: auto;
}

.center {
  min-height: calc(100vh - 164px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

label {
  display: grid;
  gap: 6px;
  color: #374151;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 99, 206, 0.13);
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: #aeb7c5;
  background: #f8fafc;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

button.primary:hover:not(:disabled) {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
}

.runButton {
  min-height: 44px;
  font-weight: 700;
}

.notice {
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  background: #fff8ec;
  padding: 10px;
  line-height: 1.6;
}

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

.metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.metrics strong {
  font-size: 22px;
  line-height: 1.1;
}

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

.trendPanel {
  min-height: 210px;
}

.trendList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.trend {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

.trend strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.trend p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.trend a {
  display: inline-block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 12px;
  text-decoration: none;
}

.outputPanel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.output {
  flex: 1;
  min-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 12px;
  padding: 14px;
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 14px;
}

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

.toolGroup {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}

.statusBox {
  min-height: 44px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  line-height: 1.5;
}

.publishLinks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.publishLinks a {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  padding: 10px;
  text-decoration: none;
  background: #fff;
}

.videoPreview {
  width: 100%;
  max-height: 420px;
  border-radius: 8px;
  background: #111;
  margin-top: 10px;
}

.providerBox {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.providerBox summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.providerBox label,
.providerBox button {
  margin-top: 10px;
}

pre {
  white-space: pre-wrap;
  overflow: auto;
  max-height: 220px;
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 6px;
  background: #f3f4f6;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .left,
  .right,
  .center {
    height: auto;
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .topbar,
  .bottombar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .bottomActions,
  .buttonGrid {
    justify-content: flex-start;
    width: 100%;
  }

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

  button {
    width: 100%;
  }
}
