:root {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #fff;
  --line: #d8e0ea;
  --text: #172033;
  --muted: #667387;
  --brand: #0f6f5f;
  --brand-dark: #0a574a;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #067647;
}
* { 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; }
a { color: var(--brand); }
.hidden { display: none !important; }
.button { border: 0; border-radius: 8px; padding: 10px 16px; background: var(--brand); color: #fff; font-size: 15px; cursor: pointer; }
.button:hover { background: var(--brand-dark); }
.button.ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.button.small { padding: 7px 11px; font-size: 13px; }
.button.danger { background: var(--danger); }
.button.warn { background: var(--warn); }
.button:disabled { opacity: .5; cursor: not-allowed; }
input, textarea, select { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; background: #fff; color: var(--text); width: 100%; }
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-box { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 16px 45px #1f2a3c14; }
.login-box h1 { margin: 0 0 8px; font-size: 24px; }
.login-box p { margin: 0 0 20px; color: var(--muted); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.app-shell { display: grid; grid-template-columns: minmax(300px, 390px) 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 18px; overflow: auto; }
.main { padding: 22px 26px 50px; overflow: auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: 24px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.searchbar { display: flex; gap: 8px; margin: 18px 0; }
.create-box { border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; padding: 10px 12px; }
.create-box summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.create-form { display: grid; gap: 10px; margin-top: 12px; }
.create-form textarea { font-family: Consolas, Monaco, monospace; font-size: 12px; min-height: 180px; }
.button-row { display: flex; justify-content: flex-end; gap: 8px; }
.section-title { font-size: 16px; font-weight: 700; margin: 24px 0 10px; }
.task-list { display: grid; gap: 10px; }
.task-item { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 12px; cursor: pointer; text-align: left; width: 100%; }
.task-item:hover, .task-item.active { border-color: var(--brand); box-shadow: 0 3px 12px #0f6f5f1a; }
.task-item-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.task-code { font-weight: 700; }
.task-time { color: var(--muted); font-size: 12px; margin-top: 5px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 12px; background: #e8edf4; color: var(--muted); white-space: nowrap; }
.pill.pending { background: #eef4ff; color: #175cd3; }
.pill.processing { background: #fff4e5; color: var(--warn); }
.pill.reviewing { background: #f4f3ff; color: #5925dc; }
.pill.published { background: #ecfdf3; color: var(--ok); }
.pill.rejected, .pill.cancelled { background: #fef3f2; color: var(--danger); }
.pill.online { background: #ecfdf3; color: var(--ok); }
.detail-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.detail-head { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 15px; margin-bottom: 15px; }
.detail-head h2 { margin: 0 0 7px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0px, 1fr)); gap: 12px; }
.info { background: #f7f9fc; border-radius: 10px; padding: 10px 12px; }
.info b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 400; }
.info span { font-weight: 600; word-break: break-all; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.preview-panel { border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; padding: 14px; margin: 18px 0; }
.preview-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.preview-toolbar h3 { margin: 0 0 6px; font-size: 16px; }
.preview-toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
.preview-controls { display: grid; grid-template-columns: minmax(90px, 130px) minmax(0px, 1fr) auto auto; gap: 8px; align-items: center; margin-top: 12px; }
.preview-controls label { margin: 0; }
.preview-frame { position: relative; margin-top: 10px; border-radius: 10px; overflow: hidden; background: #101826; aspect-ratio: 16/9; }
.preview-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.preview-meta { position: absolute; left: 10px; bottom: 8px; right: 10px; color: #fff; font-size: 12px; text-shadow: 0 1px 3px #000; }
.preview-meta.error { color: #fecaca; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.media-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.media-card img, .media-card video { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #111; }
.media-meta { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 10px; }
.platform-card { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; background: #fbfcfe; }
.platform-card h4 { margin: 0 0 7px; font-size: 14px; }
.platform-card pre { white-space: pre-wrap; word-break: break-all; color: var(--muted); font-size: 12px; max-height: 220px; overflow: auto; margin: 0; }
.command-list { display: grid; gap: 7px; font-size: 13px; }
.command-row { display: flex; gap: 10px; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.empty { border: 1px dashed var(--line); color: var(--muted); background: #ffffff80; border-radius: 12px; padding: 30px; text-align: center; }
.status-line { margin-top: 12px; font-size: 13px; color: var(--muted); }
.query-page { max-width: 900px; margin: 0 auto; padding: 36px 18px 70px; }
.query-hero { text-align: center; margin-bottom: 24px; }
.query-hero h1 { margin: 0 0 8px; font-size: 30px; }
.query-hero p { margin: 0; color: var(--muted); }
.query-form { display: flex; gap: 8px; max-width: 620px; margin: 0 auto; }
.result-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-top: 20px; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .grid2 { grid-template-columns: 1fr; }
  .preview-controls { grid-template-columns: 1fr; }
  .preview-controls label { margin-bottom: 4px; }
}
