/* 媒介运营工作台样式（自原型移植，Laravel Blade 版） */

  :root {
    --bg: #f3f5f8; --card: #ffffff; --line: #e5e9f0;
    --text: #1f2733; --muted: #7a8494;
    --red: #e5484d; --orange: #f76b15; --yellow: #b8860b; --green: #18a058; --blue: #2f6fed;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { background: var(--bg); color: var(--text); font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; padding: 16px 20px 40px; }
  header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
  .title { font-size: 19px; font-weight: 700; }
  .title .sub { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }
  .head-right { display: flex; align-items: center; gap: 8px; }
  button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--text); }
  button:hover { border-color: var(--blue); color: var(--blue); }
  button.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
  button.primary:hover { opacity: .9; color: #fff; }
  button.green { background: var(--green); color: #fff; border-color: var(--green); }
  button.danger { color: var(--red); }
  button.mini { padding: 2px 8px; font-size: 12px; }
  .badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
  .badge.demo { background: #fff3e0; color: #b45309; border: 1px solid #fdba74; }
  .badge.live { background: #e6f7ee; color: #15803d; border: 1px solid #86efac; }
  .muted { color: var(--muted); font-size: 12px; }
  .hidden { display: none !important; }

  .tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
  .tab { border: none; border-radius: 8px 8px 0 0; background: transparent; padding: 9px 18px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
  .tab.on { color: var(--blue); border-bottom: 2px solid var(--blue); }
  .tab:hover { color: var(--blue); }

  .kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 14px; }
  .kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
  .kpi .k { font-size: 12px; color: var(--muted); }
  .kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
  .kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .kpi.warn .v { color: var(--red); }

  .grid { display: grid; grid-template-columns: 5fr 7fr; gap: 14px; margin-bottom: 14px; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
  @media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } .grid, .grid2 { grid-template-columns: 1fr; } }

  .card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
  .card-title { font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .card-title .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

  .alert-item { border-left: 4px solid var(--line); border-radius: 6px; background: #fafbfc; padding: 10px 12px; margin-bottom: 8px; }
  .alert-item.sev-danger { border-left-color: var(--red); }
  .alert-item.sev-warn { border-left-color: var(--orange); }
  .alert-item.sev-low { border-left-color: var(--yellow); }
  .alert-item.sev-info { border-left-color: var(--blue); }
  .alert-item.done { opacity: .55; }
  .alert-head { display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }
  .chip { font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
  .chip.danger { background: #fde8e8; color: var(--red); }
  .chip.warn { background: #fff0e4; color: var(--orange); }
  .chip.low { background: #fdf6dc; color: var(--yellow); }
  .chip.info { background: #e8f0fe; color: var(--blue); }
  .chip.auto { background: #e6f7ee; color: var(--green); }
  .chip.exec { background: #eef1f5; color: var(--muted); }
  .alert-msg { color: var(--muted); font-size: 13px; margin: 4px 0 6px; }
  .alert-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .alert-act .sug { font-size: 13px; background: #eef3ff; color: #1d4ed8; border-radius: 6px; padding: 3px 8px; }
  .alert-act .st { font-size: 12px; color: var(--muted); }

  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  td { padding: 6px 8px; border-bottom: 1px solid #f0f2f5; white-space: nowrap; }
  tr:hover td { background: #f8fafc; }
  .num { text-align: right; font-variant-numeric: tabular-nums; }
  .ratio { font-weight: 600; padding: 1px 7px; border-radius: 10px; font-size: 12px; }
  .ratio.ok { background: #e6f7ee; color: var(--green); }
  .ratio.near { background: #fdf6dc; color: var(--yellow); }
  .ratio.over { background: #fff0e4; color: var(--orange); }
  .ratio.bad { background: #fde8e8; color: var(--red); }
  .status-tag { font-size: 12px; padding: 1px 7px; border-radius: 4px; }
  .status-tag.running { background: #e6f7ee; color: var(--green); }
  .status-tag.paused { background: #eef1f5; color: var(--muted); }

  .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
  .chips button { padding: 3px 10px; font-size: 12px; border-radius: 16px; }
  .chips button.on { background: var(--blue); color: #fff; border-color: var(--blue); }

  .rule-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; }
  .rule-row .grow { flex: 1; }
  .rule-name { font-weight: 600; font-size: 13px; }
  .rule-desc { color: var(--muted); font-size: 12px; }
  .switch { position: relative; width: 34px; height: 19px; flex: none; margin-top: 2px; }
  .switch input { opacity: 0; width: 0; height: 0; }
  .slider { position: absolute; inset: 0; background: #cfd6e0; border-radius: 19px; transition: .2s; cursor: pointer; }
  .slider:before { content: ""; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
  .switch input:checked + .slider { background: var(--green); }
  .switch input:checked + .slider:before { transform: translateX(15px); }

  .hist { max-height: 320px; overflow-y: auto; font-size: 12.5px; }
  .hist .row { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid #f5f6f8; align-items: center; }
  .hist .t { color: var(--muted); flex: none; width: 56px; }
  .hist .a { flex: 1; }
  .hist .by { flex: none; width: 88px; text-align: right; }
  .by.auto { color: var(--green); font-weight: 600; }
  .by.human { color: var(--blue); }
  .by.ai { color: #7c3aed; }

  #chart { width: 100%; }
  .legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
  .legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

  .tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
  .tpl { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: .15s; }
  .tpl:hover { border-color: var(--blue); }
  .tpl.on { border-color: var(--blue); background: #eef3ff; }
  .tpl .n { font-weight: 700; font-size: 13px; }
  .tpl .d { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
  .tpl .kv { font-size: 12px; color: var(--muted); line-height: 1.5; }

  .form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
  .form-item { display: flex; flex-direction: column; gap: 3px; }
  .form-item label { font-size: 12px; color: var(--muted); }
  input, select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 13px; font-family: inherit; }
  input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
  textarea { width: 100%; min-height: 150px; line-height: 1.5; }
  .pre { white-space: pre-wrap; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.7; }

  .mat-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid #f0f2f5; flex-wrap: wrap; }
  .mat-row .grow { flex: 1; min-width: 220px; }
  .mat-name { font-weight: 600; font-size: 13px; }
  .mat-issues { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .mat-issues .iss { color: var(--red); }
  .mat-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

  .status-chip { font-size: 11px; padding: 1px 8px; border-radius: 10px; font-weight: 600; }
  .st-SCRIPT_DRAFT { background: #e8f0fe; color: var(--blue); }
  .st-SCRIPT_REVIEW { background: #f3e8fd; color: #7c3aed; }
  .st-SHOOTING { background: #fdf6dc; color: var(--yellow); }
  .st-REVIEWING { background: #fff0e4; color: var(--orange); }
  .st-APPROVED { background: #e6f7ee; color: var(--green); }
  .st-REJECTED { background: #fde8e8; color: var(--red); }
  .st-RUNNING { background: #dcfce7; color: #166534; }

  .actionbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
  #toast { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 99; }
  .toast-item { background: #1f2733; color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.18); animation: fadein .2s; }
  .toast-item.err { background: var(--red); }
  .toast-item.ok { background: var(--green); }
  @keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
  .empty { color: var(--muted); text-align: center; padding: 18px 0; font-size: 13px; }

  /* 素材详情与AI预审 */
  .video-box { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, #1e293b, #334155); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; }
  .play { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 22px; }
  .meta-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
  .meta-chips span { font-size: 11px; background: #eef1f5; border-radius: 10px; padding: 2px 8px; color: var(--muted); }
  .frames { display: flex; gap: 3px; margin-top: 6px; overflow-x: auto; padding-bottom: 2px; }
  .frame { min-width: 34px; height: 26px; border-radius: 4px; background: #dbe3ee; font-size: 9px; display: flex; align-items: center; justify-content: center; color: #51617a; }
  .frame.bad { background: #fde8e8; color: var(--red); font-weight: 700; }
  .ai-item { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 13px; }
  .ai-item .ic { width: 18px; height: 18px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; margin-top: 2px; }
  .ai-item.pass .ic { background: #e6f7ee; color: var(--green); }
  .ai-item.fail .ic { background: #fde8e8; color: var(--red); }
  .overall-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 14px; }
  .overall-pass { background: #e6f7ee; color: var(--green); }
  .overall-warn { background: #fff0e4; color: var(--orange); }
  .overall-fail { background: #fde8e8; color: var(--red); }
  .steps { font-size: 12px; color: var(--muted); line-height: 1.9; }
  .steps .done { color: var(--green); font-weight: 600; }
  .mat-click { cursor: pointer; }
  .mat-click:hover { background: #f8fafc; }
  .st-ACTIVE { background: #e6f7ee; color: var(--green); }
  .st-AUDITING { background: #fdf6dc; color: var(--yellow); }
  .st-DISABLED { background: #eef1f5; color: var(--muted); }
  .oauth-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ===== Laravel 版补充 ===== */
a { color: inherit; text-decoration: none; }
a.mini { border: 1px solid #e5e9f0; background: #fff; border-radius: 6px; padding: 2px 8px; font-size: 12px; color: #1f2733; display: inline-block; }
a.mini:hover { border-color: #2f6fed; color: #2f6fed; }
a.primary { border-radius: 6px; padding: 5px 12px; font-size: 13px; }
form { display: inline; }
