/* Content Agent 发布台 · 基础层：设计令牌、布局、通用控件 */
:root {
  color-scheme: light;
  --font: "Inter", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  --bg: #f4f4f9;
  --bg-elev: rgba(255, 255, 255, 0.74);
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --surface-3: #e7e7ef;
  --line: rgba(22, 22, 44, 0.08);
  --line-strong: rgba(22, 22, 44, 0.14);
  --text: #15151f;
  --text-2: #585870;
  --text-3: #9393a8;

  --accent: #5b5bf6;
  --accent-soft: rgba(91, 91, 246, 0.1);
  --accent-grad: linear-gradient(135deg, #a855f7 0%, #5b5bf6 52%, #06b6d4 100%);
  --ok: #0ea371;
  --ok-soft: rgba(16, 185, 129, 0.12);
  --warn: #d97706;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --err: #e5484d;
  --err-soft: rgba(229, 72, 77, 0.12);

  --radius-lg: 24px;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(22, 22, 44, 0.04),
    0 12px 32px -18px rgba(22, 22, 44, 0.14);
  --shadow-pop: 0 30px 80px -24px rgba(22, 22, 44, 0.38);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090f;
  --bg-elev: rgba(20, 20, 31, 0.68);
  --surface: #13131d;
  --surface-2: #1b1b28;
  --surface-3: #262636;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #eeeef6;
  --text-2: #a5a5ba;
  --text-3: #6d6d84;
  --accent: #8d8dff;
  --accent-soft: rgba(141, 141, 255, 0.16);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #ff6b6f;
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 30px 90px -20px rgba(0, 0, 0, 0.75);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--font);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
img, video, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 背景极光 ---------- */
.aurora {
  position: fixed;
  inset: -25vh -10vw auto;
  height: 75vh;
  z-index: 0;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.5;
  background:
    radial-gradient(38% 50% at 18% 32%, rgba(168, 85, 247, 0.4), transparent 70%),
    radial-gradient(34% 44% at 62% 18%, rgba(91, 91, 246, 0.34), transparent 70%),
    radial-gradient(30% 40% at 92% 48%, rgba(6, 182, 212, 0.3), transparent 70%);
  animation: aurora-drift 26s var(--ease) infinite alternate;
}
[data-theme="dark"] .aurora { opacity: 0.36; }
@keyframes aurora-drift { to { transform: translate3d(4vw, 5vh, 0) scale(1.1); } }

/* ---------- 顶栏与布局 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: inherit; text-decoration: none; }
.brand img { width: 34px; height: 34px; filter: drop-shadow(0 6px 14px rgba(91, 91, 246, 0.45)); }
.brand-name { display: block; font-weight: 680; font-size: 15px; letter-spacing: -0.015em; }
.brand-sub { display: block; font-size: 12px; color: var(--text-3); line-height: 1.2; }

.workspace {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 404px;
  gap: 20px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 32px) 72px;
  align-items: start;
}
.hero { grid-column: 1 / -1; margin-bottom: 4px; }
.hero h1 { margin: 0; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.12; letter-spacing: -0.035em; font-weight: 720; }
.hero h1 em { font-style: normal; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 8px 0 0; color: var(--text-2); max-width: 640px; }
.column { display: grid; gap: 20px; min-width: 0; }
.sidebar { position: sticky; top: 80px; }
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-elev);
  backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  animation: rise 0.55s var(--ease) both;
}
.column > .card:nth-child(2) { animation-delay: 0.05s; }
.column > .card:nth-child(3) { animation-delay: 0.1s; }
.column > .card:nth-child(4) { animation-delay: 0.15s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-index {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
  transition: background 0.3s var(--ease), color 0.3s;
}
.card-index.done { background: var(--accent-grad); color: #fff; }
.card-title { margin: 0; font-size: 15px; font-weight: 640; letter-spacing: -0.01em; }
.card-desc { margin: 0; font-size: 12.5px; color: var(--text-3); }
.card-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 560;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.25s, color 0.2s;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-sm { height: 30px; padding: 0 11px; border-radius: 10px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn-icon { width: 36px; padding: 0; }
.btn-block { width: 100%; }
.btn-danger { color: var(--err); }
.btn-primary {
  height: 54px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-size: 15px;
  font-weight: 640;
  background: var(--accent-grad);
  background-size: 180% 180%;
  box-shadow: 0 14px 30px -12px rgba(91, 91, 246, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  animation: gradient-shift 9s ease infinite;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 18px 38px -12px rgba(91, 91, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.32); }
.btn-primary:disabled { opacity: 0.55; box-shadow: none; }
@keyframes gradient-shift { 50% { background-position: 100% 50%; } }

/* ---------- 表单控件 ---------- */
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 580; color: var(--text-2); }
.field-meta { font-size: 12px; font-weight: 450; color: var(--text-3); font-variant-numeric: tabular-nums; }
.field-meta.over { color: var(--warn); }
.input, .textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.25s var(--ease);
}
.input:hover, .textarea:hover { border-color: color-mix(in srgb, var(--accent) 28%, var(--line-strong)); }
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { min-height: 128px; resize: vertical; line-height: 1.65; }

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}
.segmented.block { display: grid; width: 100%; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.2s, box-shadow 0.25s;
}
.segmented label svg { width: 15px; height: 15px; }
.segmented label:hover { color: var(--text); }
.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(22, 22, 44, 0.08), 0 4px 12px -4px rgba(22, 22, 44, 0.12); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); }

.switch { position: relative; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: relative; flex: none; width: 44px; height: 26px; margin-top: 1px; border-radius: 99px; background: var(--surface-3); transition: background 0.3s var(--ease); }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.35s var(--spring); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text strong { display: block; font-weight: 580; }
.switch-text small { display: block; margin-top: 1px; color: var(--text-3); font-size: 12px; }

/* ---------- 徽标与指示 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 580;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
button.badge { cursor: pointer; transition: filter 0.2s; }
button.badge:hover { filter: brightness(0.96); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot.pulse { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  80%, 100% { box-shadow: 0 0 0 7px transparent; }
}
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
