/* =========================================================
   组件库：按钮 / 输入 / 卡片 / 徽章 / 弹层 / 抽屉 / 面板 / 表格
   ========================================================= */

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-md); padding: 8px 14px;
  font-size: 12.5px; font-weight: 650; letter-spacing: .01em;
  border: 1px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn.primary {
  background:
    linear-gradient(118deg, rgba(255,255,255,.18), transparent 34%, rgba(109,168,255,.14) 72%, transparent),
    linear-gradient(135deg, rgba(4, 8, 16, .96), rgba(22, 29, 42, .92) 64%, rgba(42, 86, 154, .72));
  color: #fff;
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .26), inset 0 -1px 0 rgba(0, 0, 0, .26);
  backdrop-filter: blur(20px) saturate(1.14);
  -webkit-backdrop-filter: blur(20px) saturate(1.14);
}
.btn.primary:hover { transform: translateY(-1px); border-color: rgba(180, 210, 255, .32); box-shadow: 0 12px 30px rgba(15, 23, 42, .22), 0 0 22px rgba(80, 144, 220, .12), inset 0 1px 0 rgba(255,255,255,.30); }
.btn.primary:active { transform: translateY(0); }
.btn.ghost {
  background: rgba(255,255,255,.62);
  border-color: rgba(15,23,42,.09);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}
.btn.ghost:hover { border-color: rgba(47,128,255,.28); box-shadow: 0 10px 24px rgba(15,23,42,.06); background: rgba(255,255,255,.78); }
.btn.ghost.dark { background: rgba(255, 255, 255, .07); border-color: rgba(255,255,255,.12); color: var(--d-text); }
.btn.ghost.dark:hover { background: rgba(255, 255, 255, .13); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger.ghost { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn.gen {
  background:
    linear-gradient(118deg, rgba(255,255,255,.20), transparent 34%, rgba(109,168,255,.13) 72%, transparent),
    linear-gradient(135deg, rgba(5, 8, 14, .98), rgba(18, 24, 35, .94) 66%, rgba(47, 91, 158, .70));
  color: #fff; border-radius: 99px; padding: 9px 18px;
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 12px 28px rgba(11, 18, 32, .22), inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 -1px 0 rgba(0, 0, 0, .28);
  position: relative; overflow: hidden;
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
}
.btn.gen::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.20) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: sheen 3.2s var(--ease) infinite;
}
@keyframes sheen { 60%, 100% { transform: translateX(100%); } }
.btn.gen:hover { transform: translateY(-1px); border-color: rgba(180, 210, 255, .32); box-shadow: 0 14px 32px rgba(11, 18, 32, .28), 0 0 22px rgba(80, 144, 220, .12), inset 0 1px 0 rgba(255,255,255,.30); }
.btn.is-loading { opacity: .75; pointer-events: none; }
.btn:disabled, .chip:disabled { opacity: .5; pointer-events: none; }

.icon-btn {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); border: 1px solid transparent;
  transition: all var(--t-fast); flex: none;
}
.icon-btn:hover { background: var(--tint); color: var(--text); }
.icon-btn.sm { width: 24px; height: 24px; }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.icon-btn.ghost { border-color: var(--line); background: var(--surface); }

.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--brand); font-size: 12px; font-weight: 650;
  transition: opacity var(--t-fast);
}
.link-btn:hover { opacity: .75; }

.spin-dot {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  border: 2px solid rgba(120, 140, 255, .3); border-top-color: var(--brand);
  animation: spin .7s linear infinite; display: inline-block;
}
.spin-ring {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid rgba(160, 180, 255, .25); border-top-color: #9BB0FF;
  animation: spin .8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #36CFA0; box-shadow: 0 0 0 0 rgba(54, 207, 160, .5);
  animation: pulse 1.6s ease-out infinite; font-style: normal;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(54, 207, 160, 0); } 100% { box-shadow: 0 0 0 0 rgba(54, 207, 160, 0); } }

/* ---------- 输入 ---------- */
.input {
  width: 100%; background: rgba(255,255,255,.68);
  border: 1px solid rgba(15,23,42,.09); border-radius: var(--r-md);
  padding: 9px 12px; font-size: 13px; outline: 0; color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}
.input:focus { border-color: rgba(47,128,255,.42); box-shadow: 0 0 0 3px rgba(47,128,255,.13); background: rgba(255,255,255,.82); }
.input[readonly] { background: var(--soft); color: var(--muted); }
.input.dark { background: rgba(255, 255, 255, .06); border-color: var(--d-line); color: var(--d-text); }
.input.num { width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.input.grow { flex: 1; }
textarea.input { resize: vertical; line-height: 1.6; }
select.input { appearance: none; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 12px; }
.field.grow { flex: 1; }
.field .muted { font-weight: 500; }
.input-dice { display: flex; gap: 6px; align-items: center; }
.dice {
  width: 36px; height: 36px; flex: none; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--muted);
  transition: all var(--t-fast);
}
.dice:hover { color: var(--brand); border-color: var(--brand); transform: rotate(12deg); }
.dice.locked { color: var(--warning); border-color: var(--warning); background: var(--warning-bg); }
.count-field { min-width: 200px; }
.count-field em { font-style: normal; color: var(--brand); font-weight: 700; }
.count-slider { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--faint); }
.count-slider input[type="range"] { flex: 1; accent-color: var(--brand); }
input[type="range"] { accent-color: var(--brand); }

/* ---------- chips / 标签 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 99px; padding: 4px 11px;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  transition: all var(--t-fast);
}
.chip:hover { border-color: var(--brand-2); color: var(--brand); }
.chip.on { background: var(--tint); border-color: var(--brand); color: var(--brand-deep); }
.chip.add { border-style: dashed; }
.chip i { font-style: normal; opacity: .6; cursor: pointer; }
.chip i:hover { opacity: 1; color: var(--danger); }
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--soft); border: 1px solid var(--line);
  border-radius: 6px; padding: 1.5px 7px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
}
.tag.warn { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.tag.muted-tag { opacity: .6; }
.plat-chip {
  display: inline-flex; align-items: center;
  border-radius: 6px; padding: 2px 7px;
  font-size: 10.5px; font-weight: 700; flex: none;
}
.plat-chip.sm { padding: 1px 6px; font-size: 10px; }
.plat-chip.xhs { background: #FDEBEF; color: #D6336C; }
.plat-chip.sph { background: #E7F5EC; color: #2B8A3E; }
.plat-chip.dy { background: #ECECF4; color: #3B3B5C; }
.plat-chip.gzh { background: #E3F2E9; color: #14866D; }

/* 状态徽章 */
.status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 99px; padding: 2.5px 9px;
  font-size: 10.5px; font-weight: 700; flex: 0 0 auto !important; white-space: nowrap;
  width: max-content !important; min-width: 0 !important; max-width: max-content;
  align-self: center;
}
.status-pill.pending { background: var(--soft); color: var(--faint); border: 1px solid var(--line); }
.status-pill.running { background: var(--run-bg); color: var(--run); }
.status-pill.need-input { background: var(--warning-bg); color: var(--warning); }
.status-pill.failed { background: var(--danger-bg); color: var(--danger); }
.status-pill.review { background: #E7F1FB; color: var(--info); }
.status-pill.approved { background: var(--success-bg); color: var(--success); }
.status-pill.delivered { background: var(--success-bg); color: var(--success); }

.month-progress { display: inline-flex; align-items: center; gap: 6px; }
.month-progress .mp-track { width: 64px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.month-progress .mp-track i { display: block; height: 100%; border-radius: 4px; background: var(--grad-brand); }
.month-progress em { font-style: normal; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.t-tag { display: inline-flex; border-radius: 6px; padding: 2px 8px; font-size: 10.5px; font-weight: 700; flex: none; }
.t-tag.front { background: var(--tint); color: var(--brand-deep); }
.t-tag.back { background: #F2ECFE; color: var(--violet); }
.src-note { font-size: 11px; color: var(--success); font-weight: 600; }
.src-mock { font-style: normal; color: var(--warning); }
.fail-text { color: var(--danger); font-style: normal; }

/* ---------- 卡片 ---------- */
.card {
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82), 0 16px 42px rgba(15, 23, 42, .06);
  backdrop-filter: blur(22px) saturate(1.22);
  -webkit-backdrop-filter: blur(22px) saturate(1.22);
}
.card.dark {
  background: rgba(9, 13, 22, .62);
  border-color: rgba(255, 255, 255, .10);
  color: var(--d-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 22px 52px rgba(0, 0, 0, .28);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 12px;
}
.card-head b { font-size: 13.5px; }
.card-head em { font-style: normal; font-size: 11.5px; color: var(--faint); }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.head-count { font-size: 13px; color: var(--brand); font-variant-numeric: tabular-nums; }

/* ---------- 弹层 / 抽屉 ---------- */
.modal-ov, .drawer-ov {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 12, 24, .42);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  opacity: 0; transition: opacity var(--t-med);
}
.modal-ov.open, .drawer-ov.open { opacity: 1; }
.modal-panel {
  width: min(440px, calc(100vw - 40px));
  max-height: calc(100vh - 80px); overflow-y: auto;
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.98);
  transition: transform var(--t-med);
  padding: 20px;
}
.modal-panel.wide { width: min(680px, calc(100vw - 40px)); }
.modal-ov.open .modal-panel { transform: none; }
.mp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mp-head b { font-size: 15px; }
.mp-body { font-size: 13px; color: var(--muted); line-height: 1.65; }
.mp-sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }
.mp-body .field { margin-bottom: 10px; }
.mp-body .field span { font-weight: 600; color: var(--text); }
.mp-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.drawer-ov { place-items: stretch end; display: flex; justify-content: flex-end; }
.drawer {
  height: 100%; max-width: calc(100vw - 50px);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(40px); opacity: 0;
  transition: transform var(--t-med), opacity var(--t-med);
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer-ov.open .drawer { transform: none; opacity: 1; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 400; }
.lightbox .lb-bg { position: absolute; inset: 0; background: rgba(5, 8, 18, .82); opacity: 0; transition: opacity .42s var(--ease); }
.lightbox.open .lb-bg { opacity: 1; }
.lightbox .lb-img {
  position: absolute; border-radius: 10px; object-fit: cover;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .55);
  transition: all .46s var(--ease);
  cursor: zoom-out;
}
.lightbox .lb-name {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, .85); font-size: 12.5px;
  background: rgba(0, 0, 0, .4); padding: 6px 14px; border-radius: 99px;
  opacity: 0; transition: opacity .3s .15s;
}
.lightbox.open .lb-name { opacity: 1; }
.lightbox.closing .lb-name { opacity: 0; }
.lightbox.media-preview .lb-video-wrap { position: absolute; inset: 5vh 8vw; display: grid; place-items: center; pointer-events: none; }
.lightbox .lb-video { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 10px; background: #050816; box-shadow: 0 40px 120px rgba(0,0,0,.55); pointer-events: auto; }
.lightbox .lb-close { position: absolute; top: -2px; right: -2px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: rgba(5,8,18,.72); color: #fff; cursor: pointer; pointer-events: auto; }
.lightbox .lb-back { position: absolute; left: 24px; top: 22px; z-index: 3; display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; color: #fff; background: rgba(5,8,18,.68); backdrop-filter: blur(14px); cursor: pointer; }
@media (max-width: 720px) { .lightbox.media-preview .lb-video-wrap { inset: 12vh 4vw; } }

/* ---------- 空态 ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 48px 20px; text-align: center; color: var(--muted);
}
.empty-state.slim { padding: 34px 16px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); background: var(--soft); }
.empty-state .es-ico {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--tint); color: var(--brand);
}
.empty-state b { font-size: 13.5px; color: var(--text); }
.empty-state p { font-size: 12px; color: var(--faint); max-width: 380px; line-height: 1.7; }

/* ---------- 通知中心 ---------- */
.notify-panel {
  position: fixed; z-index: 250; width: min(360px, calc(100vw - 24px)); max-height: 60vh;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(-6px); transition: all var(--t-med);
}
.notify-panel.open { opacity: 1; transform: none; }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px 10px; border-bottom: 1px solid var(--hairline); }
.np-list { overflow-y: auto; }
.np-item { display: flex; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--hairline); align-items: flex-start; }
.np-item.unread { background: var(--tint); }
.np-item.priority {
  border-left: 3px solid var(--danger);
  background: #fff5f5;
}
.np-item.priority .np-ico {
  background: #ffe4e4;
  color: var(--danger);
}
.np-item.priority .np-main b { color: #b42318; }
.np-ico { width: 26px; height: 26px; border-radius: 8px; background: var(--soft); display: grid; place-items: center; color: var(--brand); flex: none; }
.np-main { flex: 1; min-width: 0; }
.np-main b { display: block; font-size: 12.5px; }
.np-main em { font-style: normal; font-size: 11.5px; color: var(--faint); display: block; margin-top: 2px; line-height: 1.5; }
.np-item time { font-size: 10.5px; color: var(--faint); flex: none; }
.np-empty { padding: 30px; text-align: center; color: var(--faint); font-size: 12px; }
@media (max-width: 720px) {
  .notify-panel {
    left: 12px !important; right: 12px !important; width: auto;
    max-height: calc(100dvh - 96px) !important;
  }
}

/* ---------- ⌘K ---------- */
.palette-ov {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(8, 12, 24, .38); backdrop-filter: blur(6px);
  display: flex; justify-content: center; padding-top: 14vh;
  opacity: 0; transition: opacity 180ms ease;
}
.palette-ov.open { opacity: 1; }
.pal-goo-defs { position: absolute; pointer-events: none; }
.palette {
  position: relative; isolation: isolate;
  width: min(560px, calc(100vw - 40px)); min-height: 56px; height: fit-content;
  border-radius: 22px; overflow: visible;
  transform: translateY(-10px) scale(.97);
  transition: transform 360ms cubic-bezier(.2,.82,.2,1);
}
.palette-ov.open .palette { transform: translateY(0) scale(1); }
.pal-goo-layer {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  contain: layout paint;
}
.pal-goo-input-bg,
.pal-goo-result-bg {
  position: absolute; display: block; left: 0; width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.pal-goo-input-bg {
  top: 0; height: 56px; border-radius: 20px;
  animation: palGooInputIn 420ms cubic-bezier(.2,.84,.2,1) both;
}
.pal-goo-results-clip {
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  height: var(--pal-list-height, 0px);
  overflow: hidden;
}
.pal-goo-result-bg {
  top: calc(var(--pal-i) * 49px - var(--pal-scroll, 0px)); height: 44px; border-radius: 15px;
  opacity: .98;
  animation: palGooResultIn 480ms cubic-bezier(.18,.82,.2,1) both;
  animation-delay: calc(var(--pal-i) * 22ms);
}
.pal-goo-result-bg.is-active {
  background: var(--tint);
  background: color-mix(in srgb, var(--tint) 90%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
}
.palette-ov.is-flat .palette {
  overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.palette-ov.is-flat .pal-goo-layer { display: none; }
.palette-ov.is-flat .pal-list { background: var(--surface); }
.palette-ov.is-flat .pal-foot { background: var(--surface); }
.pal-input-row {
  height: 56px; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px;
  color: var(--faint);
}
.pal-search-orb {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  color: var(--brand); background: var(--tint);
  transform: translateX(-24px) scale(.7); opacity: 0;
  animation: palSearchOrbIn 420ms 70ms cubic-bezier(.2,.84,.2,1) forwards;
}
.pal-input-row input { flex: 1; border: 0; outline: 0; font-size: 14px; background: none; color: var(--text); }
.pal-input-row input::placeholder { color: var(--faint); }
.pal-list {
  position: relative; max-height: min(46vh, 588px); overflow-y: auto;
  margin-top: 8px; padding: 0;
  scrollbar-width: thin;
}
.pal-item {
  position: relative;
  display: flex; align-items: center; gap: 10px; height: 44px;
  box-sizing: border-box; padding: 6px 12px;
  margin-bottom: 5px; border-radius: 15px; cursor: pointer;
  outline: none;
  opacity: 0; filter: blur(8px);
  transform: translateY(-26px) scale(.92);
  animation: palContentIn 420ms cubic-bezier(.18,.82,.2,1) forwards;
  animation-delay: calc(45ms + var(--pal-i) * 24ms);
}
.pal-item.is-active {
  background: rgba(255, 255, 255, .4);
  background: color-mix(in srgb, var(--surface) 40%, transparent);
}
.pi-ico { width: 26px; height: 26px; border-radius: 8px; background: var(--soft); display: grid; place-items: center; color: var(--muted); flex: none; }
.pal-item.is-active .pi-ico { color: var(--brand); }
.pi-main { flex: 1; min-width: 0; }
.pi-main b { font-size: 13px; display: block; }
.pi-main em { font-style: normal; font-size: 11px; color: var(--faint); }
.pi-group { font-size: 10px; color: var(--faint); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }
.pal-more {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.pal-more:hover,
.pal-more:focus-visible {
  color: var(--text);
  background: var(--soft);
  outline: 0;
}
.pal-foot {
  margin-top: 3px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, .94);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-xs); font-size: 10.5px; color: var(--faint);
}
@keyframes palGooInputIn {
  from { width: 100px; transform: translateX(calc(100% - 100px)); }
  to { width: 100%; transform: translateX(0); }
}
@keyframes palSearchOrbIn {
  to { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes palGooResultIn {
  from { opacity: 0; filter: blur(9px); transform: translateY(-46px) scale(.28); }
  to { opacity: .98; filter: blur(0); transform: translateY(0) scale(1); }
}
@keyframes palContentIn {
  to { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .palette,
  .pal-search-orb,
  .pal-goo-input-bg,
  .pal-goo-result-bg,
  .pal-item {
    animation: none !important; transition: none !important;
    opacity: 1; filter: none; transform: none;
  }
}

/* ---------- 表格 ---------- */
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th { text-align: left; padding: 7px 9px; color: var(--faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.mini-table td { padding: 8px 9px; border-bottom: 1px solid var(--hairline); vertical-align: top; line-height: 1.55; }
.mini-table td[contenteditable]:hover { background: var(--tint); }
.mini-table td[contenteditable]:focus { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 4px; background: #fff; }
.mini-table .c-idx { color: var(--faint); width: 28px; font-variant-numeric: tabular-nums; }

.script-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-xs); }
.script-table th { text-align: left; padding: 10px 12px; background: var(--soft); color: var(--muted); font-size: 11px; letter-spacing: .04em; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.script-table td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; line-height: 1.6; }
.script-table tr:hover td { background: var(--soft); }
.script-table .c-idx { width: 30px; color: var(--faint); font-variant-numeric: tabular-nums; }
.script-table .c-act { width: 34px; }
.script-table .c-edit:focus { outline: 2px solid var(--brand); outline-offset: -2px; background: #fff; border-radius: 4px; }
.row-del { color: var(--faint); width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; }
.row-del:hover { color: var(--danger); background: var(--danger-bg); }

/* ---------- 分段选择 ---------- */
.seg-group { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-group button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 8px 13px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--surface); transition: all var(--t-fast);
}
.seg-group button:hover { border-color: var(--line-2); }
.seg-group button.is-active { border-color: var(--brand); background: var(--tint); color: var(--brand-deep); box-shadow: var(--ring); }
.seg-group .seg-sub { font-size: 10px; color: var(--faint); font-weight: 500; }
.seg-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.seg-dot.xhs { background: #D6336C; }
.seg-dot.sph { background: #2B8A3E; }

/* ---------- 通用过滤条 ---------- */
.filter-bar { padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.fb-search { display: flex; align-items: center; gap: 8px; color: var(--faint); border: 1px solid var(--line); border-radius: var(--r-md); padding: 7px 11px; max-width: 320px; background: var(--soft); }
.fb-search input { border: 0; outline: 0; background: none; width: 100%; font-size: 12.5px; color: var(--text); }
.fb-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- 账号编辑：可辨识的选择反馈 + 分屏自适应 ---------- */
html body .modal-panel.account-dialog-panel {
  width: min(900px, calc(100vw - 32px));
  max-height: min(900px, calc(100dvh - 32px));
  padding: clamp(16px, 2vw, 24px);
  overflow: hidden;
}
html body .modal-panel.account-dialog-panel #adRoot {
  display: flex;
  min-height: 0;
  max-height: calc(100dvh - 80px);
  flex-direction: column;
}
html body .modal-panel.account-dialog-panel #adRoot > .mp-head,
html body .modal-panel.account-dialog-panel #adRoot > .mp-foot {
  flex: none;
}
html body .modal-panel.account-dialog-panel #adRoot > .ad-body {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}
html body .modal-panel.account-dialog-panel .ad-choice-field {
  position: relative;
  isolation: isolate;
}
html body .modal-panel.account-dialog-panel .ad-choice-field:hover,
html body .modal-panel.account-dialog-panel .ad-choice-field:focus-within {
  z-index: 7;
}
html body .modal-panel.account-dialog-panel .ad-choice-guidance {
  display: block;
  min-height: 17px;
  margin-top: 3px;
  color: #858a94;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 450;
  line-height: 1.45;
}
html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 7px;
  padding: 0;
  overflow: visible;
  border: 0;
}
html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group .ad-choice-button {
  position: relative;
  min-width: 0;
  min-height: 42px;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #d8dce3;
  border-radius: 12px;
  color: #545b68;
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9), 0 4px 14px rgba(25, 35, 52, .035);
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group .ad-choice-button:hover,
html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group .ad-choice-button:focus-visible {
  z-index: 8;
  outline: 0;
  border-color: #aeb6c2;
  color: #222833;
  background: #f8f9fb;
  box-shadow: 0 0 0 3px rgba(61, 91, 138, .08), 0 8px 20px rgba(25, 35, 52, .07);
  transform: translateY(-1px);
}
html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group .ad-choice-button.is-active {
  border-color: #7da8e7;
  color: #174f9a;
  background: #edf5ff;
  box-shadow: 0 0 0 3px rgba(61, 126, 224, .11), inset 0 0 0 1px rgba(255, 255, 255, .72);
}
html body .modal-panel.account-dialog-panel #adRoot #adPlat .ad-choice-button[data-v="小红书"].is-active {
  border-color: #e792af;
  color: #a82758;
  background: #fff1f6;
  box-shadow: 0 0 0 3px rgba(214, 51, 108, .10);
}
html body .modal-panel.account-dialog-panel #adRoot #adPlat .ad-choice-button[data-v="视频号"].is-active {
  border-color: #89c596;
  color: #256c36;
  background: #effaf1;
  box-shadow: 0 0 0 3px rgba(43, 138, 62, .09);
}
html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group .ad-choice-button::after {
  content: attr(data-choice-help);
  position: absolute;
  z-index: 12;
  top: calc(100% + 7px);
  left: 50%;
  width: max-content;
  max-width: min(260px, 72vw);
  padding: 7px 9px;
  border: 1px solid rgba(27, 35, 48, .12);
  border-radius: 9px;
  color: #fff;
  background: rgba(27, 31, 39, .94);
  box-shadow: 0 10px 28px rgba(18, 25, 38, .16);
  font-size: 10.5px;
  font-weight: 450;
  line-height: 1.45;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity 120ms ease, transform 120ms ease;
}
html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group .ad-choice-button:hover::after,
html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group .ad-choice-button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
html body .modal-panel.account-dialog-panel .mp-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e1e3e7;
}
html body .modal-panel.account-dialog-panel .mp-foot .account-dialog-cancel {
  border-color: #bfc4cc;
  color: #2f3540;
  background: #fff;
  box-shadow: 0 4px 12px rgba(24, 32, 45, .05);
}
html body .modal-panel.account-dialog-panel .mp-foot .account-dialog-cancel:hover,
html body .modal-panel.account-dialog-panel .mp-foot .account-dialog-cancel:focus-visible {
  outline: 0;
  border-color: #8e96a2;
  color: #11151c;
  background: #f2f3f5;
}

html body .modal-panel.account-dialog-panel #adAvatarDrop {
  position: relative;
  isolation: isolate;
  min-height: 88px;
  overflow: hidden;
  border-color: #d3dbe7;
  background: linear-gradient(145deg, #fbfdff, #f5f9ff);
  transition: border-color 170ms ease, background 170ms ease, box-shadow 210ms ease, transform 210ms cubic-bezier(.2, .78, .2, 1);
}
html body .modal-panel.account-dialog-panel #adAvatarDrop:hover,
html body .modal-panel.account-dialog-panel #adAvatarDrop:focus-within {
  border-color: #8eb4e7;
  background: #f2f8ff;
  box-shadow: 0 0 0 3px rgba(88, 143, 216, .10), 0 10px 24px rgba(42, 83, 138, .08);
  transform: translateY(-1px);
}
html body .modal-panel.account-dialog-panel #adAvatarDrop.drag-over {
  border-color: #5e97dd;
  background: #eaf4ff;
  box-shadow: 0 0 0 4px rgba(79, 143, 220, .14), 0 14px 30px rgba(42, 83, 138, .12);
  transform: translateY(-2px);
}
html body .modal-panel.account-dialog-panel #adAvatarDrop.drag-over::after {
  content: "松开即可更换头像";
  position: absolute;
  z-index: 3;
  inset: 6px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(53, 107, 177, .42);
  border-radius: 13px;
  color: #245b9f;
  background: rgba(238, 247, 255, .94);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
  pointer-events: none;
}
html body .modal-panel.account-dialog-panel .ad-avatar-preview {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
}
html body .modal-panel.account-dialog-panel .ad-avatar-preview > img,
html body .modal-panel.account-dialog-panel .ad-avatar-preview > .account-avatar-fallback {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 17px;
  object-fit: cover;
  color: #fff;
  background: linear-gradient(145deg, #7fb8ef, #4c83d3);
  font-size: 18px;
  font-style: normal;
}
html body .modal-panel.account-dialog-panel .ad-avatar-ready {
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #5e91d8, #72b7e8);
  box-shadow: 0 4px 10px rgba(48, 100, 164, .22);
}
html body .modal-panel.account-dialog-panel .ad-avatar-ready svg { width: 10px; height: 10px; }
html body .modal-panel.account-dialog-panel .ad-avatar-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
html body .modal-panel.account-dialog-panel .ad-avatar-copy b {
  overflow: hidden;
  color: #263244;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .modal-panel.account-dialog-panel .ad-avatar-copy em {
  color: #7c8796;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 450;
}
html body .modal-panel.account-dialog-panel #adAvatarDrop.has-image .ad-avatar-preview > img {
  border: 1px solid rgba(82, 128, 190, .24);
  box-shadow: 0 7px 17px rgba(54, 91, 142, .14);
}
html body .modal-panel.account-dialog-panel #adAvatarDrop.has-selection-feedback {
  animation: accountAvatarSelected 520ms cubic-bezier(.2, .82, .2, 1) both;
}
@keyframes accountAvatarSelected {
  0% { transform: scale(.985); box-shadow: 0 0 0 0 rgba(83, 145, 218, 0); }
  52% { transform: scale(1.008); box-shadow: 0 0 0 5px rgba(83, 145, 218, .14); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(83, 145, 218, 0); }
}

/* 登录左侧的 WebGL 画布以青、蓝、紫为主；WebGL 不可用时保留静态渐变降级。 */
html body .login-gate .lg-visual {
  background: #07132c;
}
html body .login-gate .lg-visual-shade {
  background:
    linear-gradient(180deg, rgba(4, 15, 42, .04), rgba(4, 11, 31, .08) 45%, rgba(3, 8, 24, .74)),
    radial-gradient(ellipse at 72% 18%, rgba(73, 189, 255, .13) 0 16%, transparent 43%, rgba(25, 11, 70, .24) 100%);
}
html body .login-gate.beams-fallback .lg-visual {
  background:
    radial-gradient(ellipse at 12% 18%, rgba(21, 218, 229, .74), transparent 45%),
    radial-gradient(ellipse at 74% 34%, rgba(34, 94, 251, .88), transparent 48%),
    radial-gradient(ellipse at 88% 84%, rgba(126, 43, 226, .72), transparent 46%),
    linear-gradient(140deg, #06142f, #123b9e 54%, #371477);
}

@media (max-width: 720px) {
  html body .modal-panel.account-dialog-panel {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 14px;
    border-radius: 18px;
  }
  html body .modal-panel.account-dialog-panel #adRoot {
    max-height: calc(100dvh - 44px);
  }
  html body .modal-panel.account-dialog-panel .ad-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  html body .modal-panel.account-dialog-panel .ad-grid > .field,
  html body .modal-panel.account-dialog-panel .ad-grid > .full {
    grid-column: 1;
    min-width: 0;
  }
  html body .modal-panel.account-dialog-panel .ad-voice-row,
  html body .modal-panel.account-dialog-panel .ad-reference-audio-row {
    grid-template-columns: minmax(0, 1fr);
  }
  html body .modal-panel.account-dialog-panel .ad-homepage-row {
    grid-template-columns: minmax(0, 1fr);
  }
  html body .modal-panel.account-dialog-panel .ad-homepage-row .btn {
    justify-content: center;
  }
  html body .modal-panel.account-dialog-panel .mp-foot > .btn {
    min-width: 0;
    flex: 1 1 0;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group {
    grid-template-columns: minmax(0, 1fr);
  }
  html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group .ad-choice-button::after {
    display: none;
  }
  html body .modal-panel.account-dialog-panel .mp-head b {
    display: block;
    max-width: 72vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group .ad-choice-button,
  html body .modal-panel.account-dialog-panel #adRoot .ad-choice-group .ad-choice-button::after,
  html body .modal-panel.account-dialog-panel #adAvatarDrop,
  html body .modal-panel.account-dialog-panel #adAvatarDrop.has-selection-feedback {
    transition: none;
    animation: none;
  }
}
