/* 浮层、图表、时间线和页面专用块 */

/* 悬停提示 */
#tip {
  position: fixed; z-index: 300; max-width: 300px; padding: 7px 10px; border-radius: 8px; pointer-events: none;
  background: var(--pop); color: var(--fg); box-shadow: var(--shadow-pop); font-size: var(--fs-micro); line-height: 1.5;
  animation: fade 120ms var(--ease);
}
#tip .tv { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
#tip .tr { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
#tip .tr .key { width: 10px; height: 2px; border-radius: 2px; flex: none; }
#tip .tr span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; }
#tip .th { color: var(--muted-fg); margin-bottom: 3px; }

/* 菜单 */
.pop { position: fixed; z-index: 200; min-width: 200px; max-width: 320px; padding: 5px; border-radius: 12px; background: var(--pop); box-shadow: var(--shadow-pop); animation: rise var(--snap) var(--ease); font-size: var(--fs-meta); }
.pop .mi { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 0 9px; border-radius: 7px; text-align: left; }
.pop .mi:hover { background: var(--hover); }
.pop .mi .ic { color: var(--muted-fg); }
.pop .mi.danger, .pop .mi.danger .ic { color: var(--err); }
.pop .mi[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.pop .mi .hint { margin-left: auto; font-size: 11px; color: var(--faint); }
.pop .mg { padding: 7px 9px 3px; font-size: 11.5px; color: var(--faint); }
.pop hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 2px; }

/* 对话框与侧滑面板 */
.backdrop { position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, black 28%, transparent); animation: fade var(--snap) var(--ease); }
:root[data-theme="dark"] .backdrop { background: color-mix(in srgb, black 50%, transparent); }
.dlg {
  position: fixed; z-index: 101; left: 50%; top: 12vh; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); max-height: 78vh;
  display: flex; flex-direction: column; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow-pop); animation: rise var(--glide) var(--ease);
}
.dlg.wide { width: min(680px, calc(100vw - 32px)); }
.dlg.small { width: min(400px, calc(100vw - 32px)); }
.dlg-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 4px; }
.dlg-h h2 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.dlg-h p { margin-top: 3px; font-size: var(--fs-meta); color: var(--muted-fg); }
.dlg-h .x { margin-left: auto; margin-top: -4px; margin-right: -6px; }
.dlg-b { padding: 14px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-f { display: flex; align-items: center; gap: 8px; padding: 12px 20px 16px; }
.dlg-f .grow { font-size: var(--fs-micro); color: var(--faint); }

.drw {
  position: fixed; z-index: 101; top: 8px; right: 8px; bottom: 8px; width: min(560px, calc(100vw - 16px));
  display: flex; flex-direction: column; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow-pop); animation: slide-in var(--glide) var(--ease);
}
.drw.wide { width: min(720px, calc(100vw - 16px)); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drw .dlg-h { padding: 18px 20px 12px; border-bottom: 1px solid var(--line-soft); }
.drw .dlg-b { flex: 1; padding: 18px 20px; gap: 18px; }
.drw .dlg-f { border-top: 1px solid var(--line-soft); padding: 12px 20px; }

.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > label, .fld > .lbl { font-size: var(--fs-meta); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.fld > label .opt, .fld > .lbl .opt { font-weight: 400; color: var(--faint); font-size: var(--fs-micro); }
.fld .help { font-size: var(--fs-micro); color: var(--muted-fg); line-height: 1.5; }
.fld .help.err { color: var(--err); }
.fld .inline-field { align-self: flex-start; }
.fld-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.effects { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-meta); }
.effects li { display: flex; gap: 8px; align-items: flex-start; }
.effects li .ic { margin-top: 2px; color: var(--muted-fg); }
.calc { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--tint); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; }
.calc b { font-weight: 600; }

.choice { display: flex; flex-direction: column; gap: 8px; }
.choice label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow var(--snap), background-color var(--snap); }
.choice label:hover { background: var(--hover); }
.choice label:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--primary); background: var(--primary-soft); }
.choice label input { margin-top: 3px; }
.choice label b { display: block; font-weight: 500; font-size: var(--fs-meta); }
.choice label span { display: block; font-size: var(--fs-micro); color: var(--muted-fg); }
.choice.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 开通进度 */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; font-size: var(--fs-meta); position: relative; }
.steps li .mk { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--faint); background: var(--panel); z-index: 1; }
.steps li:not(:last-child)::before { content: ''; position: absolute; left: 9.5px; top: 28px; bottom: -8px; width: 1px; background: var(--line-soft); }
.steps li.done .mk { background: var(--fg); box-shadow: none; color: var(--panel); }
.steps li.doing .mk { box-shadow: inset 0 0 0 1.5px var(--primary); }
.steps li.fail .mk { background: var(--err); box-shadow: none; color: #fff; }
.steps li .st { flex: 1; min-width: 0; padding-top: 1px; }
.steps li .st small { display: block; color: var(--muted-fg); font-size: var(--fs-micro); }
.steps li.wait { color: var(--faint); }
.invite { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.invite code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }

/* 全局搜索 */
.pal { position: fixed; z-index: 101; left: 50%; top: 14vh; transform: translateX(-50%); width: min(600px, calc(100vw - 32px)); border-radius: 14px; background: var(--pop); box-shadow: var(--shadow-pop); overflow: hidden; animation: rise var(--glide) var(--ease); }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--line-soft); }
.pal-in input { flex: 1; border: 0; outline: none; background: none; font-size: 15px; }
.pal-in input::placeholder { color: var(--faint); }
.pal-in .ic { color: var(--faint); }
.pal-list { max-height: 52vh; overflow: auto; padding: 6px; }
.pal-g { padding: 8px 10px 4px; font-size: 11.5px; color: var(--faint); }
.pal-r { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border-radius: 8px; text-align: left; }
.pal-r[aria-selected="true"] { background: var(--hover); }
.pal-r .ic { color: var(--muted-fg); }
.pal-r b { font-weight: 500; font-size: var(--fs-meta); }
.pal-r small { display: block; font-size: var(--fs-micro); color: var(--muted-fg); }
.pal-r mark { background: none; color: var(--primary); }
.pal-r .end { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.pal-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--faint); }

/* 通知 */
#toasts { position: fixed; z-index: 250; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px; border-radius: 10px; background: var(--fg); color: var(--bg); font-size: var(--fs-meta); box-shadow: 0 8px 24px -8px #0006; pointer-events: auto; animation: rise var(--glide) var(--ease); }
.toast .ic { color: color-mix(in srgb, var(--bg) 70%, var(--fg)); }
.toast a { color: inherit; text-decoration: underline; text-underline-offset: 3px; opacity: .8; }

/* 预览工具条（不是产品界面） */
.pv { position: fixed; z-index: 90; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--pop); box-shadow: var(--shadow-pop); font-size: var(--fs-micro); color: var(--muted-fg); }
.pv b { font-weight: 600; color: var(--fg); letter-spacing: .02em; }

/* 图表 */
.chart { position: relative; }
.chart svg { display: block; max-width: 100%; overflow: visible; }
.chart .gl { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .bl { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart text { fill: var(--faint); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; outline: none; }
.chart .col-hl { fill: var(--hover); opacity: 0; transition: opacity 120ms; }
.chart .col-hl.on { opacity: 1; }
.chart.dim { opacity: .5; transition: opacity var(--glide); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-micro); color: var(--muted-fg); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend i.line { height: 2px; border-radius: 2px; width: 12px; }
.chart-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 6px; flex-wrap: wrap; }
.chart-head h3 { font-size: var(--fs-meta); font-weight: 600; }
.chart-head .acts { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.chart-body { padding: 4px 16px 14px; }
.segbar { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; }
.segbar i { display: block; height: 100%; min-width: 2px; }
.segbar i:first-child { border-radius: 99px 0 0 99px; } .segbar i:last-child { border-radius: 0 99px 99px 0; }

/* 时间线 */
.tl { position: relative; padding: 4px 0; }
.tl-day { padding: 14px 16px 6px; font-size: var(--fs-micro); color: var(--faint); font-weight: 500; }
.tl-it { display: flex; gap: 12px; padding: 8px 16px; position: relative; }
.tl-it .tl-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--tint); color: var(--muted-fg); z-index: 1; }
.tl-it .tl-ic.err { background: var(--err-soft); color: var(--err); }
.tl-it .tl-ic.op { background: var(--primary-soft); color: var(--primary); }
.tl-it::before { content: ''; position: absolute; left: 28.5px; top: 34px; bottom: -8px; width: 1px; background: var(--line-soft); }
.tl-it:last-child::before { display: none; }
.tl-it .tl-b { flex: 1; min-width: 0; font-size: var(--fs-meta); padding-top: 3px; }
.tl-it .tl-b small { display: block; color: var(--muted-fg); font-size: var(--fs-micro); margin-top: 1px; }
.tl-it .tl-t { flex: none; font-size: var(--fs-micro); color: var(--faint); padding-top: 4px; font-variant-numeric: tabular-nums; }

/* 用户详情页头 */
.uhead { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.uhead h1 { font-size: 20px; font-weight: 600; line-height: 1.35; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.uhead .meta { margin-top: 3px; display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: var(--fs-meta); color: var(--muted-fg); }
.uhead .meta button { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.uhead .meta button:hover { color: var(--fg); }
.uhead .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.summary { display: grid; grid-template-columns: 1.25fr 1fr 1fr; margin-bottom: 22px; }
.summary .stat .val { font-size: 18px; }

/* 批次 */
.batches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.batch { padding: 14px 16px; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-panel); text-align: left; display: flex; flex-direction: column; gap: 10px; transition: box-shadow var(--snap); }
.batch[aria-pressed="true"] { box-shadow: 0 0 0 1.5px var(--fg); }
.batch .bh { display: flex; align-items: center; gap: 8px; }
.batch .bh b { font-weight: 600; }
.batch .bn { font-size: var(--fs-micro); color: var(--muted-fg); display: flex; gap: 10px; flex-wrap: wrap; }
.cmp { width: 100%; border-collapse: collapse; font-size: var(--fs-micro); }
.cmp td { padding: 3px 0; color: var(--muted-fg); }
.cmp td.r { text-align: right; font-variant-numeric: tabular-nums; color: var(--fg); }
.cmp td.r.worse { color: var(--err); font-weight: 500; }

/* 套餐卡片 */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.plan { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow-panel); transition: box-shadow var(--snap); }
.plan:hover { box-shadow: 0 0 0 1px var(--line), 0 4px 14px -8px #0003; }
.plan .ph2 { display: flex; align-items: baseline; gap: 8px; }
.plan .ph2 b { font-size: 15px; font-weight: 600; }
.plan .big { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.plan .big small { font-size: 12.5px; font-weight: 400; color: var(--muted-fg); margin-left: 4px; }
.plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-micro); color: var(--muted-fg); }
.savebar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--pop); box-shadow: var(--shadow-pop); font-size: var(--fs-meta); animation: rise var(--glide) var(--ease); }
.check-list { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-meta); }
.check-list .ci { display: flex; align-items: center; gap: 8px; }

/* 窄窗口：侧栏收为图标，表格横向滚动 */
@media (max-width: 1080px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary .stat:first-child { grid-column: 1 / -1; }
  .summary .stat:nth-child(2)::before { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 60px minmax(0, 1fr); }
  .brand b, .brand .env, .search-trigger span, .search-trigger .kbd, .nav-it span, .nav-it .badge:not(.dot), .nav-gt, .me .vstack { display: none; }
  .brand { justify-content: center; padding: 0; }
  .search-trigger, .nav-it, .me { justify-content: center; padding: 0; }
  .nav-it .badge.dot { position: absolute; top: 6px; right: 8px; }
  .page { padding: 20px 18px 96px; }
  .grid2, .grid3, .batches, .choice.cols { grid-template-columns: minmax(0, 1fr); }
  .uhead { flex-wrap: wrap; }
  .uhead .acts { margin-left: 0; justify-content: flex-start; width: 100%; }
}
