﻿/* ============================================================
   components.css — 图表、统计条、时间轴、芯片、空状态
   ============================================================ */

/* ---------- 图表 ---------- */
.chart{width:100%;display:block;overflow:visible}
.chart .grid-line{stroke:#eef2f8;stroke-width:1}
.chart .axis-text{fill:#8b97ac;font-size:10.5px;font-family:inherit}
.chart .line{fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.chart .dot{stroke:#fff;stroke-width:1.8}
.chart .chart-bar{transition:opacity .15s}
.chart .chart-bar:hover{opacity:.78}
.chart-legend{display:flex;gap:14px;margin-top:8px;font-size:11.5px;color:var(--txt-2);flex-wrap:wrap}
.chart-legend span{display:inline-flex;align-items:center;gap:5px}
.chart-legend i{width:8px;height:8px;border-radius:2px;display:inline-block}

/* ---------- 统计横条（品质） ---------- */
.stat-line{display:flex;align-items:center;gap:10px;padding:8px 0}
.stat-line .name{width:78px;flex:none;font-size:12px;color:var(--txt-2)}
.stat-line .bar{flex:1;height:8px}
.stat-line .num{width:52px;text-align:right;font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}

/* ---------- 时间轴 ---------- */
.timeline{position:relative;padding-left:18px}
.timeline::before{content:"";position:absolute;left:4px;top:6px;bottom:6px;width:1px;background:var(--line)}
.tl-item{position:relative;padding:0 0 14px}
.tl-item:last-child{padding-bottom:0}
.tl-item::before{
  content:"";position:absolute;left:-18px;top:4px;width:9px;height:9px;border-radius:50%;
  background:#fff;border:2px solid var(--brand);
}
.tl-item.ok::before{border-color:var(--ok)}
.tl-item.bad::before{border-color:var(--bad)}
.tl-item.warn::before{border-color:var(--warn)}
.tl-item .tl-title{font-size:12.5px;font-weight:500;line-height:1.45}
.tl-item .tl-sub{font-size:11.5px;color:var(--txt-3);margin-top:2px}

/* ---------- 芯片 / 键值 ---------- */
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{
  font-size:11.5px;padding:3px 9px;border-radius:20px;background:var(--panel-2);
  border:1px solid var(--line);color:var(--txt-2);
}
.chip b{color:var(--txt);font-weight:600}

.kv-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:11px 18px}
.kv-item .k{font-size:11.5px;color:var(--txt-3);margin-bottom:2px}
.kv-item .v{font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}

/* ---------- 空状态 ---------- */
.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:44px 16px;color:var(--txt-3);gap:9px}
.empty-state svg{width:30px;height:30px;opacity:.35}
.empty-state p{font-size:12.5px}

/* ---------- 搜索面板 ---------- */
.search-panel{
  position:fixed;left:0;right:0;top:0;bottom:0;z-index:7000;background:rgba(14,26,44,.28);
  backdrop-filter:blur(2px);display:flex;justify-content:center;padding-top:12vh;
}
.search-box{width:100%;max-width:560px;height:fit-content;background:#fff;border-radius:14px;box-shadow:var(--shadow-lg);overflow:hidden;animation:modalIn .18s ease}
.search-box .sb-head{display:flex;align-items:center;gap:9px;padding:13px 16px;border-bottom:1px solid var(--line-2)}
.search-box .sb-head input{flex:1;border:none;outline:none;font-size:14px}
.search-box .sb-body{max-height:52vh;overflow:auto;padding:8px}
.sb-item{display:flex;align-items:center;gap:10px;padding:9px 11px;border-radius:9px;cursor:pointer}
.sb-item:hover{background:var(--panel-2)}
.sb-item .t{font-size:12.5px;font-weight:500}
.sb-item .s{font-size:11.5px;color:var(--txt-3)}
.sb-item .tag{margin-left:auto}
.sb-empty{padding:26px;text-align:center;color:var(--txt-3);font-size:12.5px}

/* ---------- 分段控件 ---------- */
.segmented{display:inline-flex;padding:3px;background:#eef2f8;border-radius:9px;gap:2px}
.segmented button{
  border:none;background:transparent;height:27px;padding:0 12px;border-radius:7px;
  font-size:12.5px;color:var(--txt-2);font-weight:500;transition:all .14s;
}
.segmented button.on{background:#fff;color:var(--txt);box-shadow:0 1px 3px rgba(16,32,56,.14)}

/* ---------- 小提示条 ---------- */
.notice{
  display:flex;align-items:flex-start;gap:9px;padding:10px 13px;border-radius:10px;
  background:var(--brand-l);color:#1e40af;font-size:12.5px;line-height:1.55;border:1px solid #d6e3fd;
}
.notice svg{width:15px;height:15px;flex:none;margin-top:1px}
.notice.warn{background:var(--warn-l);color:#92400e;border-color:#f6e2c2}

/* ============================================================
   模板骨架占位（内容清空后的页面留白区）
   ============================================================ */
.slot{
  position:relative;
  display:flex;align-items:center;justify-content:center;
  min-height:240px;padding:30px 22px;
  border:1.5px dashed #d2dcea;border-radius:var(--radius);
  background:
    repeating-linear-gradient(45deg,rgba(37,99,235,.022) 0 10px,transparent 10px 20px),
    #fbfcfe;
}
.slot.mini{min-height:132px;padding:18px 14px;border-radius:12px}
.slot-inner{text-align:center;max-width:430px}
.slot-icon{
  width:38px;height:38px;margin:0 auto 11px;border-radius:11px;
  display:flex;align-items:center;justify-content:center;
  background:#eef2f8;color:#9aa8bf;
}
.slot-icon svg{width:19px;height:19px}
.slot.mini .slot-icon{width:30px;height:30px;border-radius:9px;margin-bottom:8px}
.slot.mini .slot-icon svg{width:15px;height:15px}
.slot-title{font-size:13px;font-weight:600;color:var(--txt-2);letter-spacing:.01em}
.slot.mini .slot-title{font-size:12.5px}
.slot-desc{font-size:12px;color:var(--txt-3);line-height:1.7;margin-top:5px}
.slot.mini .slot-desc{font-size:11.5px;line-height:1.6}
.slot-tags{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:11px}
.slot-tags span{
  font-size:11px;color:var(--txt-3);background:#fff;
  border:1px solid var(--line);border-radius:20px;padding:2px 9px;
}
.slot-badge{
  position:absolute;top:10px;right:12px;
  font-size:10.5px;letter-spacing:.08em;color:#a3aec2;
  background:#fff;border:1px solid var(--line);border-radius:20px;padding:1px 8px;
}

/* 占位按钮：保留位置但不响应 */
.tpl-btn[disabled]{
  opacity:.62;cursor:not-allowed;box-shadow:none;
  border-style:dashed;border-color:#d5deec;
}
.tpl-btn.btn-primary[disabled]{background:#93b0e8;border-color:#93b0e8;border-style:dashed}
.tpl-input[disabled]{background:#fbfcfe;border-style:dashed;color:var(--txt-3);cursor:not-allowed}
.tpl-seg button[disabled]{cursor:not-allowed;opacity:.75}
.tpl-hint{font-size:11.5px;color:#a3aec2}

/* 指标卡占位：数值弱化 */
.kpi.tpl-kpi .val{color:#c2cbd9;letter-spacing:.02em}
.kpi.tpl-kpi::after{opacity:.3;background:#9aa8bf}

/* 关于页说明文字 */
.card-body-note{padding:4px 2px;color:var(--txt-2);font-size:12.5px;line-height:1.85}
.card-body-note p{margin:0 0 8px}
.card-body-note p:last-child{margin-bottom:0}
.card-body-note b{color:var(--txt);font-weight:600}

/* 账号权限矩阵 */
.acl-toolbar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:0 0 12px}
.acl-mini{padding:5px 9px;font-size:11.5px;gap:4px;min-height:auto;height:auto}
.acl-mini svg{width:13px;height:13px}
.matrix-tbl{font-size:12px}
.matrix-tbl th,.matrix-tbl td{padding:9px 10px;vertical-align:middle}
.matrix-tbl .acl-page-col{width:38%;min-width:220px;text-align:left}
.matrix-tbl .acl-role-col{min-width:116px;text-align:center}
.acl-sub{font-weight:400;color:#a3aec2;font-size:10.5px;margin-left:5px}
.acl-role-head{display:flex;align-items:center;justify-content:center;gap:5px;margin-bottom:3px}
.acl-user-name{font-size:10.5px;color:var(--txt-3);margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acl-lock{font-size:10px;color:#9aa8bf;background:#f1f4f9;border:1px solid var(--line);border-radius:20px;padding:1px 6px}
.acl-x{padding:2px;border-radius:5px;color:#9aa8bf}
.acl-x:hover{color:var(--bad);background:#fff1f1}
.acl-all{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:var(--txt-3);cursor:pointer;font-weight:400}
.acl-group-row td{background:#f7f9fc;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.acl-group-row td:first-child{display:flex;align-items:center;justify-content:space-between;gap:8px}
.acl-group-row b{font-size:12px;color:var(--txt-2)}
.acl-page{display:flex;flex-direction:column;gap:2px}
.acl-page span{color:var(--txt);font-weight:500}
.acl-page code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10.5px;color:#a3aec2}
.acl-cell{text-align:center}
.acl-check{display:inline-flex;align-items:center;gap:5px;font-size:11px;color:var(--txt-3);cursor:pointer;font-weight:400}
.acl-check input{width:14px;height:14px;accent-color:#2563eb;cursor:pointer}
.acl-check input:disabled{cursor:not-allowed;opacity:.55}
@media (max-width:860px){
  .matrix-tbl .acl-page-col{min-width:170px}
  .matrix-tbl .acl-role-col{min-width:96px}
}

/* 保存回执：保存中 / 已保存（点击处立刻可见，避免「点了没反应」的错觉） */
.btn.saving{opacity:.72;pointer-events:none}
.btn.saved{background:#e8f8ef;border-color:#9cdcbb;color:#0f7a52}
.btn.saved .ico,.btn.saved svg{color:#0f7a52}
