/* =====================================================================
   主持人库 · 模块覆盖层
   只定义本模块新增组件；基础令牌、顶栏、按钮来自 site.css（生产为线上 style.css）
   ===================================================================== */

/* ---------- KPI 统计条 ---------- */
.kpigrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 17px; box-shadow: var(--shadow); min-width: 0; }
.kpi b { display: block; font-size: 25px; font-weight: 750; line-height: 1.2; letter-spacing: -.7px; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi b small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi span { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.kpi em { display: block; margin-top: 3px; font-size: 11px; color: var(--hint); font-style: normal; }
@media (max-width: 1080px) { .kpigrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpigrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; } .kpi { padding: 13px; } .kpi b { font-size: 21px; } }

/* ---------- 图表卡片 ---------- */
.chartgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chartcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; box-shadow: var(--shadow); min-width: 0; }
.chartcard h3 { margin: 0; font-size: 15px; font-weight: 700; }
.chartcard .sub { margin: 4px 0 16px; font-size: 12px; color: var(--hint); }
.chartgrid > .full { grid-column: 1 / -1; }
@media (max-width: 860px) { .chartgrid { grid-template-columns: 1fr; } }

/* 横向条形图 */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .lbl { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--grad); min-width: 2px; transition: width .5s ease; }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 竖向柱状图 */
.columns { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; align-items: end; height: 150px; padding-top: 10px; }
.col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.col .col-bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent-b), var(--accent)); min-height: 2px; transition: height .5s ease; }
.col .col-v { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-labels { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.col-labels span { text-align: center; font-size: 10.5px; color: var(--hint); line-height: 1.35; word-break: break-all; }

/* 环形图（ conic-gradient 纯 CSS ） */
.donutrow { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.donut { width: 148px; height: 148px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; position: relative; }
.donut::after { content: ''; position: absolute; inset: 22px; border-radius: 50%; background: var(--surface); }
.donut .donut-in { position: relative; z-index: 1; text-align: center; line-height: 1.3; }
.donut .donut-in b { display: block; font-size: 24px; font-weight: 750; }
.donut .donut-in span { font-size: 11px; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: 9px; min-width: 150px; flex: 1; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); }

/* 折线图（内联 SVG） */
.linechart { width: 100%; height: 150px; display: block; }
.linechart .grid { stroke: var(--line); stroke-width: 1; }
.linechart .area { fill: rgba(245, 158, 11, .14); }
.linechart .stroke { fill: none; stroke: var(--accent-deep); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.linechart .dot { fill: var(--surface); stroke: var(--accent-deep); stroke-width: 2; }
.trend-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--hint); margin-top: 4px; }

/* ---------- 筛选栏 ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters select, .filters input {
  height: 38px; padding: 0 26px 0 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text); font-size: 13px; min-width: 146px;
}
.filters input { min-width: 210px; padding-right: 11px; }
.filters .btn { flex-shrink: 0; }
.filters .spacer { flex: 1 1 auto; }
.filter-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.results-note { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }

/* 视图切换用 hidden 控制显隐，避免被布局类覆盖 */
[hidden] { display: none !important; }

/* 视图切换：按主持人 / 账号明细（全部字段） */
.viewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: -4px 0 14px; }
.viewbar .devnote { margin: 0; }
.viewtabs { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.viewtab {
  appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--muted); padding: 7px 14px; border-radius: 8px;
  transition: background .18s ease, color .18s ease;
}
.viewtab:hover { color: var(--text); }
.viewtab.active { background: var(--surface); color: var(--accent-deep); box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.viewbar code { font-size: 11.5px; background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; }

/* 账号明细表：列多，固定最小宽度后横向滚动 */
.detail-grid { min-width: 1180px; }
.detail-grid th, .detail-grid td { white-space: nowrap; vertical-align: middle; }
.detail-grid td:nth-child(9) { white-space: normal; min-width: 190px; }
.detail-grid td small { font-size: 11px; }
.muted { color: var(--hint); font-size: 12px; }
.acct.shared { background: var(--bg-soft); }
.acct.shared .acct-top { margin-bottom: 7px; }

/* ---------- 主持人矩阵表 ---------- */
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table-scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
table.grid th { background: var(--bg-soft); color: var(--muted); font-weight: 600; text-align: left; padding: 12px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.grid td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover { background: #fffdf7; }
table.grid tbody tr { cursor: pointer; }
.name-cell { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.name-cell b { font-weight: 650; }
.name-cell small { display: block; color: var(--hint); font-size: 11px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 11.5px; color: var(--text-2); white-space: nowrap; margin: 2px 4px 2px 0; }
.tag.acc { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-deep); }
.tag.ok { background: #eaf7ee; border-color: #c7e8d1; color: var(--ok); }
.tag.demo { background: #f1f1f5; border-color: #e0e0e6; color: #7a7a86; }
/* 列表页置顶标记 */
.tag.pin { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-deep); font-weight: 700; }
.pill-num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; font-size: 12px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty p { margin: 0 0 16px; font-size: 13px; }

/* ---------- 详情抽屉 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 17, 21, .32); z-index: 130; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.overlay.show { opacity: 1; pointer-events: auto; }
.detail { position: fixed; inset: 0 0 0 auto; width: min(94vw, 480px); height: 100dvh; background: var(--surface); z-index: 140; border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(0,0,0,.14); overflow-y: auto; transform: translateX(100%); transition: transform .25s ease; }
.detail.show { transform: translateX(0); }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.detail-head h3 { margin: 0; font-size: 18px; }
.detail-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.detail-body { padding: 18px 22px 34px; }
.acct { border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px; margin-bottom: 11px; }
.acct-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.acct-top b { font-size: 14px; }
.acct dl { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 5px 10px; margin: 0; font-size: 12.5px; }
.acct dt { color: var(--hint); }
.acct dd { margin: 0; color: var(--text-2); word-break: break-all; }

/* ---------- 表单 ---------- */
.formcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px 28px; }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 18px; }
@media (max-width: 620px) { .formgrid { grid-template-columns: 1fr; } .formcard { padding: 20px 18px 24px; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field label .req { color: #dc2626; margin-left: 2px; }
.field label .opt { color: var(--hint); font-size: 11px; font-weight: 400; margin-left: 5px; }
.field .hint { font-size: 11.5px; color: var(--hint); }
.field select, .field input {
  width: 100%; height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text); font-size: 14px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
/* 账号名称 / 账号ID：input[list] 保留下拉外观，同时允许填写唯一值 */
.field input[list] { padding-right: 34px; }
.field select:focus, .field input:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
.field select:invalid, .field input:invalid { color: var(--hint); }
.formactions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.formnote { font-size: 12px; color: var(--hint); }
.formmsg { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-size: 13px; display: none; }
.formmsg.show { display: block; }
.formmsg.ok { background: #eaf7ee; border: 1px solid #c7e8d1; color: #14532d; }
.formmsg.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.optional { margin-top: 20px; border: 1px dashed var(--line); border-radius: 11px; padding: 0 15px; }
.optional summary { cursor: pointer; padding: 12px 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.optional .formgrid { padding-bottom: 16px; }

/* 平台专属字段：选平台后动态出现，浅底深字保证可读 */
.platform-extra { margin-top: 22px; border: 1px solid var(--accent-border); background: var(--accent-soft); border-radius: 12px; padding: 16px 18px 18px; }
.platform-extra[hidden] { display: none; }
.pextra-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pextra-head b { font-size: 14px; color: var(--accent-deep); }
.pextra-head span { font-size: 12px; color: var(--hint); }
.platform-extra .formnote { margin: 0; }

/* 多平台卡片：平台一、平台二… 每张卡片是一组独立字段 */
.pcard { border: 1px solid var(--line); border-radius: 12px; padding: 17px 18px 19px; margin-bottom: 14px; background: var(--surface); }
.pcard-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pcard-num { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-deep); font-size: 13px; font-weight: 700; white-space: nowrap; }
.pcard-tip { flex: 1; min-width: 150px; font-size: 12px; color: var(--hint); }
.pcard-del { border: none; background: transparent; color: var(--hint); font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.pcard-del:hover { color: #b91c1c; background: #fef2f2; }
.pcard-del[hidden] { display: none; }
.pcard .platform-extra { margin-top: 18px; }
.card-add-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 20px; }
.card-add-row #addPlatform { border-style: dashed; border-color: var(--accent-border); color: var(--accent-deep); font-weight: 600; background: #fffdf8; }
.card-add-row #addPlatform:hover { background: var(--accent-soft); }
.card-add-row #addPlatform:disabled { color: var(--hint); border-color: var(--line); background: var(--surface); }
.card-add-row .formnote { flex: 1; min-width: 200px; }
@media (max-width: 620px) { .pcard { padding: 15px 14px 17px; } .pcard-tip { min-width: 100%; } }

/* ---------- 通告页 ---------- */
.notice-wrap { max-width: 860px; margin: 0 auto; padding: 34px 20px 60px; }
.notice-head { text-align: center; margin-bottom: 26px; }
.notice-head .kicker { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-deep); font-size: 12px; font-weight: 600; }
.notice-head h1 { margin: 16px 0 8px; font-size: clamp(25px, 4vw, 36px); letter-spacing: -.8px; }
.notice-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.brief { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.brief h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
.brief ul { margin: 0; padding-left: 19px; }
.brief li { margin-bottom: 9px; line-height: 1.8; color: var(--text-2); font-size: 14px; }
.brief li b { color: var(--text); }
.brief .callout { margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--accent); background: #fffbf2; border-radius: 0 9px 9px 0; font-size: 13px; color: var(--text-2); }
.form-title { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.form-desc { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.notice-foot { text-align: center; font-size: 11.5px; color: var(--hint); margin-top: 22px; line-height: 1.8; }

/* ---------- 杂项 ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--dark); color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13px; z-index: 200; opacity: 0; transition: .22s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mini-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.devnote { font-size: 11.5px; color: var(--hint); margin-top: 12px; }
.linklist { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 780px) { .linklist { grid-template-columns: 1fr; } }
.linkcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; color: var(--text); box-shadow: var(--shadow); }
.linkcard:hover { text-decoration: none; border-color: var(--accent-border); }
.linkcard b { display: block; font-size: 15px; margin-bottom: 4px; }
.linkcard span { font-size: 12.5px; color: var(--muted); }
.linkcard code { display: inline-block; margin-top: 9px; font-size: 11.5px; color: var(--accent-deep); word-break: break-all; }

/* ---------- 达人通告列表（/notice/） ---------- */
.noticegrid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .noticegrid { grid-template-columns: 1fr; } }
.ncard { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
/* 置顶通告：左侧描边强调，其余排版与普通卡片一致 */
.ncard-pin { border-color: var(--accent-border); box-shadow: 0 10px 24px rgba(0, 0, 0, .07); }
.ncard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ncard-head h3 { margin: 0; font-size: 16.5px; font-weight: 700; line-height: 1.45; letter-spacing: -.2px; color: var(--text); }
.ncard-head .tag { flex-shrink: 0; margin-top: 2px; }
.ncard-sum { margin: 0; font-size: 13.5px; line-height: 1.78; color: var(--text-2); }
.ncard-metas { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.ncard-metas b { color: var(--text); font-weight: 600; }
.ncard-act { margin-top: auto; padding-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.steps { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.step i { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-bottom: 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-deep); font-style: normal; font-weight: 700; font-size: 12.5px; }
.step b { display: block; font-size: 14px; margin-bottom: 4px; color: var(--text); }
.step span { font-size: 12.5px; line-height: 1.72; color: var(--muted); }

/* ---------- 联系人与报价（必填区）+ 其他备注 ---------- */
.contactcard { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 18px; background: var(--surface); }
.contacthead { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.contacthead b { font-size: 14px; color: var(--text); }
.contacthead span { font-size: 12px; color: var(--hint); }
.contacthead i.req { color: #dc2626; font-style: normal; margin: 0 1px; }
.fld-full { grid-column: 1 / -1; }
.field textarea {
  width: 100%; min-height: 82px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit;
  line-height: 1.7; resize: vertical; box-sizing: border-box;
}
.field textarea::placeholder { color: var(--hint); }
.field textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
/* 纯文本输入框不再显示下拉箭头：原规则把 select 的箭头一并套给了 input */
.field input:not([list]) { background-image: none; padding-right: 12px; }
@media (max-width: 620px) { .contactcard { padding: 14px 14px 16px; } }
