:root {
  --bg: #eef5f8;
  --panel: rgba(255,255,255,.86);
  --line: #d8e3e8;
  --text: #16232b;
  --muted: #61707a;
  --brand: #146c75;
  --accent: #d3542f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #f6fbfd 0%, #e8f1f3 48%, #f8f1ec 100%);
}
.app-shell { min-height: 100vh; padding: 18px; }
.workspace {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 16px;
  max-width: 1500px;
  margin: 0 auto;
}
.panel, .main-panel {
  background: var(--panel);
  border: 1px solid rgba(180, 198, 205, .7);
  box-shadow: 0 18px 50px rgba(40, 74, 86, .12);
  backdrop-filter: blur(16px);
}
.input-panel { padding: 18px; border-radius: 8px; }
.main-panel { min-height: calc(100vh - 36px); border-radius: 8px; overflow: hidden; }
.brand { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 7px; letter-spacing: 0; }
h2 { font-size: 15px; margin: 0; letter-spacing: 0; }
p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
#sessionState { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; font-size: 12px; color: var(--brand); white-space: nowrap; }
label { display: block; font-size: 13px; color: #40515b; margin: 13px 0 7px; }
textarea, input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.9);
  color: var(--text);
  font: inherit;
  outline: none;
}
textarea { resize: vertical; padding: 11px 12px; line-height: 1.55; }
input, select { height: 38px; padding: 0 10px; }
textarea:focus, input:focus, select:focus { border-color: #78aeb6; box-shadow: 0 0 0 3px rgba(20,108,117,.12); }
textarea[readonly] { background: #f7fafb; color: #273842; cursor: default; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.model-block input { margin-bottom: 7px; }
.actions { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 16px; }
button {
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
button:hover { filter: brightness(.96); }
button:disabled { opacity: .55; cursor: wait; }
.ghost {
  background: white;
  color: var(--brand);
  border: 1px solid var(--line);
  height: 32px;
  padding: 0 12px;
  font-weight: 600;
}
.tabs { display: flex; gap: 4px; padding: 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.58); }
.tabs button { width: auto; min-width: 78px; background: transparent; color: var(--muted); border: 1px solid transparent; }
.tabs button.active { background: white; color: var(--brand); border-color: var(--line); }
.tab-page { display: none; padding: 16px; }
.tab-page.active { display: block; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.section-head, .result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.result-bar { color: var(--muted); }
.prompt-box { height: calc(100vh - 190px); min-height: 520px; font-size: 13px; background: #fbfdfe; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips span { padding: 7px 10px; border-radius: 999px; background: #fff7f1; color: #8c3a1d; border: 1px solid #efd2c2; font-size: 12px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.media-card { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 10px; }
.media-card img { width: 100%; display: block; border-radius: 6px; background: #eef2f4; }
.media-card button { margin-top: 10px; width: 100%; }
.video-box video { width: 100%; max-height: 70vh; background: #101820; border-radius: 8px; }
.video-link, .history-item { display: block; padding: 12px; background: white; border: 1px solid var(--line); border-radius: 8px; color: var(--brand); text-decoration: none; margin-bottom: 10px; }
.history-item { color: var(--text); }
@media (max-width: 980px) {
  .app-shell { padding: 10px; }
  .workspace, .split { grid-template-columns: 1fr; }
  .main-panel { min-height: auto; }
  .prompt-box { min-height: 320px; height: 42vh; }
}
