/* [v2.0 完全合并 / P3] 投放方案 原生页样式 —— 移植自 adpilot static/style.css 的 plan/card/seg/pchip 部分,
   全部收敛到 .ads-plan 作用域, 自带 CSS 变量 (adpilot 浅色主题), 与宿主 vvdig 深色主题隔离, 零全局污染。 */
.ads-plan {
  --brand: #5b4bdb; --brand2: #8b7cf5;
  --txt: #1f2533; --muted: #8a93a5; --line: #e6e9f0;
  --panel: #ffffff; --panel2: #f3f5f9; --bg: #f7f8fb;
  --warn: #c98a00; --ok: #1aa564; --accent: #ef5b34; --danger: #e5484d;
  height: 100%; background: var(--bg); color: var(--txt); border-radius: 10px;
  padding: 16px 18px; box-sizing: border-box; overflow: auto;
  font-size: 14px; line-height: 1.55;
}
.ads-plan *, .ads-plan *::before, .ads-plan *::after { box-sizing: border-box; }

.ads-plan .sso-warn { padding: 6px 12px; margin-bottom: 8px; border-radius: 8px; background: #fdf6ec; color: #b88230; font-size: 12.5px; }

/* 标题区 */
.ads-plan .page-title { font-size: 21px; font-weight: 800; margin: 2px 0 4px; color: var(--txt); }
.ads-plan .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* 卡片 */
.ads-plan .card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(20, 24, 38, .03); }
.ads-plan .card h3 { font-size: 15px; font-weight: 700; margin: 0 0 12px; color: var(--txt); }
.ads-plan .muted { color: var(--muted); }

.ads-plan .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ads-plan .grid2 .card { margin-bottom: 0; }
@media (max-width: 880px) { .ads-plan .grid2 { grid-template-columns: 1fr; } }

/* 表单控件 */
.ads-plan label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
.ads-plan select, .ads-plan input, .ads-plan textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2);
  color: var(--txt); font-size: 13.5px; padding: 8px 10px; font-family: inherit;
}
.ads-plan select { height: 36px; padding: 0 8px; }
.ads-plan textarea { min-height: 64px; max-height: 200px; resize: vertical; line-height: 1.5; }
.ads-plan select:focus, .ads-plan input:focus, .ads-plan textarea:focus { outline: none; border-color: var(--brand); background: var(--panel); }
.ads-plan .row { display: flex; gap: 10px; }
.ads-plan .row > div { flex: 1; min-width: 0; }

/* 分段控件 (方案维度) */
.ads-plan .seg { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel2); }
.ads-plan .seg button { border: none; background: transparent; color: var(--muted); font-size: 13px; padding: 7px 16px; cursor: pointer; font-family: inherit; }
.ads-plan .seg button + button { border-left: 1px solid var(--line); }
.ads-plan .seg button.on { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; font-weight: 600; }

/* 多选平台胶囊 */
.ads-plan .pchips { display: flex; gap: 7px; flex-wrap: wrap; }
.ads-plan .pchip { border: 1px solid var(--line); background: var(--panel2); color: #46505f; border-radius: 16px; padding: 5px 13px; font-size: 12.5px; cursor: pointer; user-select: none; }
.ads-plan .pchip:hover { border-color: var(--brand); color: var(--brand); }
.ads-plan .pchip.on { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; border-color: transparent; font-weight: 600; }

/* 按钮 */
.ads-plan .btn { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; border: none; border-radius: 9px; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; margin-top: 14px; }
.ads-plan .btn:disabled { opacity: .6; cursor: default; }
.ads-plan .btn.ghost { background: var(--panel); color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.ads-plan .btn.mini { padding: 5px 12px; font-size: 12.5px; margin-top: 0; }
.ads-plan .spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: ads-plan-spin .7s linear infinite; vertical-align: -1px; margin-right: 5px; }
@keyframes ads-plan-spin { to { transform: rotate(360deg); } }

/* 演示模式横幅 */
.ads-plan .mockbar { background: rgba(255, 211, 42, .14); border: 1px solid rgba(255, 211, 42, .45); color: var(--warn); padding: 6px 12px; border-radius: 8px; font-size: 12.5px; margin-bottom: 10px; }

/* 结果区 */
.ads-plan .out { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.65; font-family: inherit; margin: 0; color: var(--txt); }
.ads-plan .danger { color: var(--danger); font-size: 13.5px; }

/* 历史方案列表 */
.ads-plan .list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; background: var(--panel2); }
.ads-plan .list-item:last-child { margin-bottom: 0; }
.ads-plan .list-item b { font-size: 13.5px; color: var(--txt); }
.ads-plan .list-item .when { color: var(--muted); font-size: 12px; margin-left: 6px; }
.ads-plan .list-item .ops { display: flex; gap: 6px; flex: 0 0 auto; }
