/* ==========================================================
   通用组件
   ========================================================== */

/* ---------- 页头 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--cyan);
  text-transform: uppercase;
  font-family: var(--num);
  margin-bottom: 6px;
}
.page-kicker::before {
  content: "";
  width: 16px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.page-title { font-size: 23px; font-weight: 700; letter-spacing: .5px; }
.page-title .accent {
  background: linear-gradient(92deg, var(--cyan), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-desc { color: var(--muted); font-size: 12px; margin-top: 4px; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-actions .stamp {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
}
.page-actions .stamp b { color: var(--txt-2); font-family: var(--num); font-weight: 500; }

/* ---------- 面板 ---------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(51, 226, 206, .45), rgba(91, 140, 255, .3), transparent);
  opacity: .6;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-title i { color: var(--cyan); font-size: 14px; }
.panel-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.panel-extra { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 10px 12px; }
.panel-body.flush { padding: 0; }
.panel-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }

.corner-cut { clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); }

/* ---------- 网格 ---------- */
.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
.grid-3-2 { grid-template-columns: 3fr 2fr; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-full { grid-column: 1 / -1; }

@media (max-width: 1440px) {
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2, .grid-3-2 { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4 { grid-column: auto; }
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
}

/* ---------- KPI ---------- */
.kpi {
  position: relative;
  padding: 15px 16px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(22, 38, 62, .8), rgba(12, 22, 38, .72));
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s;
}
[data-theme="light"] .kpi { background: linear-gradient(160deg, #fff, #f4f8fd); }
.kpi:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.kpi::after {
  content: "";
  position: absolute;
  right: -30px; top: -40px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(51, 226, 206, .16), transparent 70%);
}
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; }
.kpi-ico {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: rgba(51, 226, 206, .1);
  border: 1px solid rgba(51, 226, 206, .2);
  color: var(--cyan);
  font-size: 13px;
}
.kpi-val { margin: 9px 0 2px; font-family: var(--num); font-size: 27px; font-weight: 600; letter-spacing: .5px; line-height: 1.1; }
.kpi-val small { font-size: 12px; color: var(--muted); margin-left: 4px; font-family: var(--font); font-weight: 400; }
.kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.kpi.blue .kpi-ico { color: var(--blue); background: rgba(91, 140, 255, .1); border-color: rgba(91, 140, 255, .22); }
.kpi.blue::after { background: radial-gradient(circle, rgba(91, 140, 255, .16), transparent 70%); }
.kpi.amber .kpi-ico { color: var(--amber); background: rgba(247, 185, 85, .1); border-color: rgba(247, 185, 85, .22); }
.kpi.amber::after { background: radial-gradient(circle, rgba(247, 185, 85, .15), transparent 70%); }
.kpi.red .kpi-ico { color: var(--red); background: rgba(255, 95, 126, .1); border-color: rgba(255, 95, 126, .22); }
.kpi.red::after { background: radial-gradient(circle, rgba(255, 95, 126, .15), transparent 70%); }
.kpi.purple .kpi-ico { color: var(--purple); background: rgba(167, 139, 250, .1); border-color: rgba(167, 139, 250, .22); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: var(--txt-2);
  font-size: 12px;
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.btn:hover { border-color: var(--line-strong); color: var(--txt); background: rgba(91, 140, 255, .08); }
.btn:active { transform: translateY(1px); }
.btn i { font-size: 13px; }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(100deg, #2fe0cb, #38b6f0);
  color: #04222a;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(47, 224, 203, .22);
}
.btn-primary:hover { color: #04222a; filter: brightness(1.06); box-shadow: 0 10px 26px rgba(47, 224, 203, .32); }
.btn-outline { border-color: rgba(51, 226, 206, .35); color: var(--cyan); background: rgba(51, 226, 206, .06); }
.btn-outline:hover { background: rgba(51, 226, 206, .13); border-color: rgba(51, 226, 206, .55); color: var(--cyan); }
.btn-danger { border-color: rgba(255, 95, 126, .3); color: #ff9db0; background: rgba(255, 95, 126, .08); }
.btn-danger:hover { background: rgba(255, 95, 126, .16); border-color: rgba(255, 95, 126, .5); color: #ffc2ce; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--txt); background: rgba(255, 255, 255, .05); border-color: transparent; }
.btn-sm { height: 27px; padding: 0 9px; font-size: 11px; border-radius: 6px; }
.btn-sm i { font-size: 11px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-loading { pointer-events: none; opacity: .7; }
.btn-loading i { animation: spin .9s linear infinite; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--cyan);
  font-size: 12px;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.field > label .req { color: var(--red); }
.input, .select, .textarea {
  width: 100%;
  height: 35px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(5, 11, 21, .45);
  color: var(--txt);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  font-size: 12.5px;
}
[data-theme="light"] .input, [data-theme="light"] .select, [data-theme="light"] .textarea { background: #fff; }
.textarea { height: auto; min-height: 74px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(51, 226, 206, .55);
  box-shadow: 0 0 0 3px rgba(51, 226, 206, .1);
  background: rgba(7, 16, 29, .7);
}
[data-theme="light"] .input:focus, [data-theme="light"] .select:focus, [data-theme="light"] .textarea:focus { background: #fff; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
[data-theme="light"] .select { background-color: #fff; }
.input-sm { height: 30px; font-size: 11.5px; }
.input-group { display: flex; align-items: center; gap: 8px; }
.hint { font-size: 10.5px; color: var(--muted-2); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--txt-2); cursor: pointer; }
.check input { accent-color: #2fe0cb; width: 13px; height: 13px; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 20px;
  background: rgba(120, 145, 170, .3);
  transition: .2s; cursor: pointer;
}
.switch span::after {
  content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + span { background: linear-gradient(90deg, #2fe0cb, #38b6f0); box-shadow: 0 0 12px rgba(47, 224, 203, .35); }
.switch input:checked + span::after { transform: translateX(16px); }

/* ---------- 筛选区 ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 16, 29, .25);
}
.filter-bar .input, .filter-bar .select { width: auto; min-width: 140px; height: 32px; font-size: 12px; }
.filter-bar .search-box { position: relative; min-width: 220px; }
.filter-bar .search-box i { position: absolute; left: 10px; top: 9px; color: var(--muted-2); font-size: 12px; }
.filter-bar .search-box .input { padding-left: 30px; width: 100%; }
.filter-sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.filter-bar .spacer { flex: 1; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.tbl { width: 100%; min-width: 880px; border-collapse: collapse; font-size: 12.3px; }
.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .5px;
  background: rgba(9, 18, 32, .96);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
[data-theme="light"] .tbl thead th { background: #f3f7fc; }
.tbl tbody td { padding: 10px 12px; border-bottom: 1px solid rgba(120, 168, 220, .075); vertical-align: middle; color: var(--txt-2); }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: rgba(51, 226, 206, .045); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .name-link { color: var(--txt); font-weight: 500; cursor: pointer; }
.tbl .name-link:hover { color: var(--cyan); }
.tbl .cell-sub { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.tbl .actions { display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.tbl .op { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); border: 0; background: transparent; }
.tbl .op:hover { color: var(--cyan); background: rgba(51, 226, 206, .1); }
.tbl .op.danger:hover { color: var(--red); background: rgba(255, 95, 126, .1); }
.tbl .num { font-family: var(--num); }
.tbl tr.row-danger td:first-child { box-shadow: inset 2px 0 0 var(--red); }
.tbl tr.row-warn td:first-child { box-shadow: inset 2px 0 0 var(--amber); }
.tbl tr.row-ok td:first-child { box-shadow: inset 2px 0 0 var(--green); }
.tbl-compact tbody td { padding: 8px 10px; }

/* ---------- 标签 / 状态 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 10.5px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.tag::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .9; }
.tag.plain::before { display: none; }
.tag-cyan { color: #6ff2e3; background: rgba(51, 226, 206, .1); border-color: rgba(51, 226, 206, .24); }
.tag-blue { color: #9ab8ff; background: rgba(91, 140, 255, .1); border-color: rgba(91, 140, 255, .24); }
.tag-amber { color: #ffd18a; background: rgba(247, 185, 85, .1); border-color: rgba(247, 185, 85, .26); }
.tag-red { color: #ff9fb2; background: rgba(255, 95, 126, .1); border-color: rgba(255, 95, 126, .26); }
.tag-green { color: #86f0bd; background: rgba(61, 220, 151, .1); border-color: rgba(61, 220, 151, .24); }
.tag-purple { color: #c9b8ff; background: rgba(167, 139, 250, .1); border-color: rgba(167, 139, 250, .25); }
.tag-gray { color: var(--muted); background: rgba(130, 150, 175, .09); border-color: rgba(130, 150, 175, .18); }
[data-theme="light"] .tag-cyan { color: #0b7d73; }
[data-theme="light"] .tag-blue { color: #2f63d9; }
[data-theme="light"] .tag-amber { color: #976000; }
[data-theme="light"] .tag-red { color: #c92c49; }
[data-theme="light"] .tag-green { color: #0c7b56; }
[data-theme="light"] .tag-purple { color: #6746c5; }

.sev-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; }
.sev-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.sev-dot.fatal::before { background: var(--red); box-shadow: 0 0 8px var(--red); }
.sev-dot.serious::before { background: var(--amber); box-shadow: 0 0 8px rgba(247, 185, 85, .6); }
.sev-dot.normal::before { background: var(--blue); }
.sev-dot.minor::before { background: var(--muted); }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 6px; }
.pager .pg {
  min-width: 28px; height: 28px; padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--num);
}
.pager .pg:hover:not(:disabled) { border-color: var(--line-strong); color: var(--txt); }
.pager .pg.active { background: linear-gradient(135deg, rgba(51, 226, 206, .2), rgba(91, 140, 255, .18)); color: var(--cyan); border-color: rgba(51, 226, 206, .4); }
.pager .pg:disabled { opacity: .35; cursor: not-allowed; }
.page-info { font-size: 11px; color: var(--muted); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px 30px;
  background: rgba(2, 6, 14, .66);
  backdrop-filter: blur(5px);
  overflow-y: auto;
  animation: fade .18s ease both;
}
.modal-mask.confirm-mask { z-index: 200; align-items: center; padding: 20px; background: rgba(2, 6, 14, .72); }
.modal-mask.drawer-mask { z-index: 120; padding: 0; justify-content: flex-end; align-items: stretch; background: rgba(2, 6, 14, .5); }
.modal {
  width: 620px;
  max-width: 100%;
  background: linear-gradient(180deg, #101c30, #0b1424);
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6), 0 0 0 1px rgba(51, 226, 206, .04);
  animation: modal-in .26s var(--ease) both;
  position: relative;
  overflow: hidden;
}
[data-theme="light"] .modal { background: linear-gradient(180deg, #fff, #f8fbff); }
.modal::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--blue), transparent);
  opacity: .8;
}
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; }
.modal-head .m-ico {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(51, 226, 206, .1);
  border: 1px solid rgba(51, 226, 206, .24);
  color: var(--cyan); font-size: 15px; flex: 0 0 auto;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.modal-close {
  margin-left: auto; width: 28px; height: 28px; border-radius: 7px;
  border: 0; background: transparent; color: var(--muted); display: grid; place-items: center;
}
.modal-close:hover { background: rgba(255, 255, 255, .06); color: var(--txt); }
.modal-body { padding: 4px 20px 18px; max-height: 68vh; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, .12);
}
.modal-foot .left { margin-right: auto; }
.modal-lg { width: 820px; }
.modal-xl { width: 1040px; }
.modal-sm { width: 420px; }
.confirm-box { width: 390px; }
.confirm-box .modal-body { padding: 0 20px 6px; }
.confirm-text { font-size: 12.5px; color: var(--txt-2); line-height: 1.7; }
.confirm-note { margin-top: 8px; padding: 8px 10px; border-radius: 7px; background: rgba(247, 185, 85, .08); border: 1px solid rgba(247, 185, 85, .18); color: #ffd18a; font-size: 11px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(-14px) scale(.985); } to { opacity: 1; transform: none; } }

/* 抽屉 */
.drawer {
  width: 560px;
  max-width: 92vw;
  height: 100%;
  background: linear-gradient(160deg, #0e1a2c, #0a1220);
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 80px rgba(0, 0, 0, .5);
  animation: drawer-in .28s var(--ease) both;
  display: flex; flex-direction: column;
}
[data-theme="light"] .drawer { background: linear-gradient(160deg, #fff, #f7fbff); }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.drawer-lg { width: 760px; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 详情块 */
.detail-hero {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(51, 226, 206, .07), rgba(91, 140, 255, .05));
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.detail-hero .big { font-size: 19px; font-weight: 700; font-family: var(--num); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.detail-item { padding: 10px 12px; background: var(--panel-solid); }
.detail-item label { display: block; font-size: 10.5px; color: var(--muted-2); margin-bottom: 3px; }
.detail-item div { font-size: 12.5px; color: var(--txt-2); }
.section-title { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--txt); font-weight: 600; margin: 16px 0 9px; }
.section-title::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: linear-gradient(180deg, var(--cyan), var(--blue)); }

/* Tabs */
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab {
  position: relative;
  padding: 9px 13px;
  font-size: 12px;
  color: var(--muted);
  border: 0;
  background: transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--txt-2); }
.tab.active { color: var(--cyan); }
.tab.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 0 10px rgba(51, 226, 206, .6);
}
.tab .count {
  margin-left: 5px; font-size: 10px; padding: 0 5px; border-radius: 8px;
  background: rgba(91, 140, 255, .15); color: var(--blue); font-family: var(--num);
}
.seg { display: inline-flex; padding: 3px; background: rgba(6, 13, 24, .5); border: 1px solid var(--line); border-radius: 8px; }
.seg button { height: 26px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 11px; border-radius: 6px; }
.seg button.active { background: rgba(51, 226, 206, .14); color: var(--cyan); }

/* ---------- 进度 / 时间线 ---------- */
.progress { height: 6px; border-radius: 6px; background: rgba(120, 150, 180, .15); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--cyan), var(--blue)); transition: width .4s var(--ease); }
.progress.thin { height: 4px; }
.progress.amber > i { background: linear-gradient(90deg, var(--amber), #ff8a65); }
.progress.red > i { background: linear-gradient(90deg, var(--red), #b23a55); }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: linear-gradient(180deg, var(--cyan), transparent); opacity: .4; }
.tl-item { position: relative; padding: 0 0 15px 0; }
.tl-item::before {
  content: ""; position: absolute; left: -19px; top: 5px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--panel-solid); border: 2px solid var(--cyan);
}
.tl-item.dim::before { border-color: var(--muted-2); }
.tl-time { font-size: 10.5px; color: var(--muted-2); font-family: var(--num); }
.tl-title { font-size: 12px; color: var(--txt-2); margin: 2px 0; }
.tl-desc { font-size: 11px; color: var(--muted); }

/* ---------- 空状态 / 加载 ---------- */
.empty { padding: 38px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 32px; opacity: .35; display: block; margin-bottom: 8px; }
.empty p { font-size: 12px; }
.spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(51, 226, 206, .2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
}
.skeleton {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(120, 168, 220, .08), rgba(120, 168, 220, .16), rgba(120, 168, 220, .08));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 76px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  min-width: 240px; max-width: 380px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(14, 24, 41, .96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
  animation: toast-in .28s var(--ease) both;
  backdrop-filter: blur(12px);
}
[data-theme="light"] .toast { background: #fff; }
.toast i { font-size: 14px; margin-top: 1px; }
.toast.success i { color: var(--green); }
.toast.error i { color: var(--red); }
.toast.warn i { color: var(--amber); }
.toast.info i { color: var(--blue); }
.toast .t-title { font-size: 12px; font-weight: 600; }
.toast .t-msg { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- 搜索面板 ---------- */
.cmd-mask { position: fixed; inset: 0; z-index: 210; background: rgba(2, 6, 14, .7); backdrop-filter: blur(6px); padding: 90px 20px; display: flex; justify-content: center; align-items: flex-start; }
.cmd { width: 620px; max-width: 100%; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); }
.cmd input { width: 100%; height: 50px; border: 0; background: transparent; color: var(--txt); padding: 0 18px; font-size: 14px; outline: none; border-bottom: 1px solid var(--line); }
.cmd-results { max-height: 380px; overflow-y: auto; padding: 8px; }
.cmd-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 12.5px; color: var(--txt-2); }
.cmd-item:hover, .cmd-item.hover { background: rgba(51, 226, 206, .09); color: var(--txt); }
.cmd-item i { color: var(--cyan); }
.cmd-item .g { margin-left: auto; font-size: 10px; color: var(--muted-2); }
.cmd-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- 工具 ---------- */
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.dot-sep { color: var(--muted-2); margin: 0 5px; }
.bar { height: 6px; border-radius: 5px; background: rgba(130, 160, 190, .14); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--cyan), var(--blue)); }
.ring {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--num); font-size: 11px;
  border: 2px solid rgba(51, 226, 206, .3);
  color: var(--cyan);
}
.info-line { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed rgba(120, 168, 220, .1); font-size: 12px; }
.info-line:last-child { border-bottom: 0; }
.info-line .k { color: var(--muted); }
.info-line .v { color: var(--txt-2); }
.code-block { font-family: Consolas, Monaco, monospace; font-size: 11.5px; background: rgba(3, 9, 18, .6); border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; color: #9fe8de; word-break: break-all; line-height: 1.65; }
[data-theme="light"] .code-block { background: #f4f8fc; color: #0b6b62; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-actions { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .modal-mask { padding: 30px 12px; }
}
