/* ═════════════ KOL-CRM · 深蓝 + 浅灰 + 白 ═════════════ */
:root {
  --primary: #1e3a8a;
  --primary-dark: #172554;
  --primary-light: #3b82f6;
  --primary-tint: #eff6ff;

  --bg: #f3f4f6;
  --bg-card: #ffffff;
  --bg-alt: #f9fafb;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-dark: #d1d5db;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --muted-light: #f3f4f6;

  --star: #3b82f6;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(17,24,39,.05);
  --shadow-md: 0 4px 12px rgba(17,24,39,.08);
  --shadow-lg: 0 8px 24px rgba(17,24,39,.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
[x-cloak] { display: none !important; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* ═════ 顶栏 ═════ */
.topbar {
  height: 52px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: var(--shadow-md);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-logo { font-size: 22px; color: #93c5fd; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 12px; color: #c7d2fe; opacity: .9; }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.whoami { display: inline-flex; gap: 6px; align-items: center; }
.role-tag {
  background: rgba(255,255,255,.15);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
}
.whoami-name { opacity: .9; }
.version { font-size: 11px; opacity: .65; }

/* ═════ 布局 ═════ */
.layout { display: flex; min-height: calc(100vh - 52px); }

.sidebar {
  width: 200px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  flex-shrink: 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 14px;
}
.nav-item:hover { background: var(--primary-tint); }
.nav-item.active {
  background: var(--primary-tint);
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-divider { height: 1px; background: var(--border); margin: 16px 12px; }
.nav-hint { padding: 0 20px; color: var(--text-light); font-size: 12px; line-height: 1.6; }

.content { flex: 1; padding: 24px 32px; min-width: 0; }

/* ═════ 页面头 ═════ */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-dark);
}
.page-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ═════ 表单控件通用 ═════ */
input[type=text], input[type=email], input[type=number], input[type=search],
input[type=password], input[type=date], input[type=month],
select, textarea {
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input[type=search] { min-width: 220px; width: auto; }
input[type=text]:focus, input[type=email]:focus, input[type=number]:focus,
input[type=search]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
textarea { resize: vertical; min-height: 60px; }

.btn-primary, .btn-secondary, .btn-small {
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, transform .06s;
  font-weight: 500;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border-dark); }
.btn-secondary:hover { background: var(--bg-alt); }
.btn-small {
  background: var(--primary-tint);
  color: var(--primary);
  font-size: 12px;
  padding: 4px 10px;
}
.btn-small:hover { background: #dbeafe; }

.btn-link {
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 13px;
  font-family: inherit;
}
.btn-link:hover { text-decoration: underline; }
.btn-link:disabled { color: var(--text-light); cursor: not-allowed; text-decoration: none; }
.btn-link.danger { color: var(--danger); }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.switch input[type=checkbox] { cursor: pointer; }

.required { color: var(--danger); margin-left: 2px; }

/* ═════ 图例 ═════ */
.legend {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.lg-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* ═════ 列表表格 ═════ */
.kol-table {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kol-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.kol-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.kol-table tbody tr:last-child td { border-bottom: none; }
.kol-table tbody tr:hover { background: var(--primary-tint); }
.kol-table.compact td { padding: 7px 12px; }

.kol-table tr.row-star td:first-child { border-left: 4px solid #3b82f6; }
.kol-table tr.row-red td:first-child { border-left: 4px solid #ef4444; }
.kol-table tr.row-gray td:first-child { border-left: 4px solid #9ca3af; }
.kol-table tr.row-gray { color: #6b7280; }

.col-actions { text-align: right; white-space: nowrap; }

.cell-name { display: flex; gap: 10px; align-items: center; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.avatar.big { width: 96px; height: 96px; font-size: 32px; }
.avatar.small { width: 22px; height: 22px; font-size: 11px; }
.bulk-kol-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 10px 16px 10px 20px !important;
}
.bulk-kol-row > * { flex-shrink: 0; }
.bulk-kol-name-col {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}
.bulk-kol-row-no-addr {
  background: #fef2f2 !important;
}
.bulk-kol-row-no-addr:hover {
  background: #fee2e2 !important;
}
.name-row { display: flex; gap: 6px; align-items: center; }
.name { font-weight: 600; }
.star { color: var(--star); font-size: 15px; }
.muted { color: var(--text-muted); }
.muted.small, .small.muted { font-size: 12px; }

.tag {
  display: inline-block;
  background: var(--primary-tint);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin-right: 4px;
  margin-bottom: 2px;
}
.tag-light {
  background: var(--bg-alt);
  color: var(--text-muted);
}

/* ── 智能家居生态标签配色（2026-05-20）──
   规则：浅色背景 + 深色文字，保持 .tag 基础胶囊形状。
   覆盖 .tag 的默认蓝，按生态 code 各家一色。 */
.eco-home_assistant {  /* HA - 蓝 (用户指定) */
  background: #dbeafe;
  color: #1e40af;
}
.eco-homekit {         /* Apple - 黄 (用户指定) */
  background: #fef3c7;
  color: #92400e;
}
.eco-matter {          /* Matter - 红 (用户指定) */
  background: #fee2e2;
  color: #b91c1c;
}
.eco-google_home {     /* Google - 绿 (Google 品牌色) */
  background: #d1fae5;
  color: #065f46;
}
.eco-smartthings {     /* SmartThings - 青 (三星 SmartThings 品牌色) */
  background: #cffafe;
  color: #0e7490;
}
.eco-alexa {           /* Alexa - 紫 (Alexa 品牌色) */
  background: #ede9fe;
  color: #5b21b6;
}
.eco-zigbee {          /* Zigbee - 橙 (协议类) */
  background: #ffedd5;
  color: #9a3412;
}
.eco-zwave {           /* Z-Wave - 灰 (停用，淡化) */
  background: #f3f4f6;
  color: #6b7280;
}

.state-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.st-none { background: var(--bg-alt); color: var(--text-muted); }
.st-blue { background: var(--primary-tint); color: var(--primary); }
.st-red  { background: var(--danger-light); color: var(--danger); }
.st-gray { background: var(--muted-light); color: var(--text-muted); }

/* ═════ 空/加载态 ═════ */
.empty, .loading {
  background: var(--bg-card);
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub { font-size: 13px; }

.placeholder-box {
  background: var(--bg-alt);
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
}

.pager {
  margin-top: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}
.pager b { color: var(--text); }

/* ═════ 详情 ═════ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.detail-grid .card:nth-child(6) { grid-column: 1 / -1; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.card-head {
  font-weight: 600;
  font-size: 13px;
  color: var(--primary-dark);
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kv {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}
.kv label { color: var(--text-muted); }
.pre { white-space: pre-wrap; }

/* ═════ 抽屉 (新建/编辑 KOL) ═════ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.35);
  z-index: 100;
}
.drawer {
  position: fixed;
  top: 0; right: 0;
  width: 600px;
  max-width: 95vw;
  height: 100vh;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  z-index: 101;
  transform: translateX(100%);
  transition: transform .25s ease-out;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-head h2 { margin: 0; font-size: 16px; color: var(--primary-dark); }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.drawer-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.btn-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
}
.btn-close:hover { color: var(--text); }

.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.two-col > div > label { margin-bottom: 4px; }
.form-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin: 20px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  user-select: none;
}
.chip input { margin: 0; }
.chip:has(input:checked) {
  background: var(--primary-tint);
  border-color: var(--primary-light);
  color: var(--primary);
}

/* ═════ 平台管理 ═════ */
.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) {
  .platform-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
.plat-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.plat-table th {
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: .3px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.plat-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--bg);
}
.plat-table tr.row-inactive { color: var(--text-muted); }
.plat-table tr.row-inactive code { opacity: .6; }

.state-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.state-dot.on { background: var(--success); }
.state-dot.off { background: var(--text-light); }

/* ═════ 小弹窗 (平台新增/编辑) ═════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.4);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 420px;
  max-width: 95vw;
  overflow: hidden;
}
.modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h2 { margin: 0; font-size: 16px; color: var(--primary-dark); }
.modal-body { padding: 18px; }
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ═════ 吐司 ═════ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease-out;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
/* ══════ PHASE 4 additions ══════ */

/* 详情页细长卡跨两列 */
.card-wide { grid-column: 1 / -1; }

/* 标题里的 link (账号名) */
.link { color: var(--primary); text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }
.truncate { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

/* 主力徽章 (社媒/联系) */
.primary-badge {
  display: inline-block;
  color: var(--star);
  font-size: 13px;
  margin-right: 2px;
}

/* 子资源小表格 */
.sub-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.sub-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: .3px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.sub-table td {
  padding: 8px;
  border-bottom: 1px solid var(--bg);
  vertical-align: top;
}
.sub-table .col-follower { text-align: right; width: 80px; }
.sub-table .col-actions { text-align: right; white-space: nowrap; width: 150px; }

/* 时间轴 */
.timeline {
  position: relative;
  margin-top: 10px;
  padding-left: 0;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;       /* 与圆点中心对齐 (14px 列中心) */
  top: 8px;
  bottom: 8px;
  width: 0;
  border-left: 1px dashed #d1d5db;
  z-index: 0;
}
.timeline-row {
  display: grid;
  grid-template-columns: 14px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-left: 0;
  border-left: none;
  position: relative;
  z-index: 1;
}
.timeline-dot {
  position: relative;
  left: auto;
  top: auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--primary);
  justify-self: center;
  z-index: 2;
}
.timeline-row.dir-theirs .timeline-dot { background: var(--success); box-shadow: 0 0 0 1px var(--success); }
.timeline-row.dir-mine .timeline-dot   { background: #9ca3af; box-shadow: 0 0 0 1px #9ca3af; }
/* fallback: 任何未知 direction 一律按"我方"浅灰渲染，避免历史脏数据出现奇异颜色 (v0.7.6) */
.timeline-row:not(.dir-theirs):not(.dir-mine) .timeline-dot {
  background: #9ca3af; box-shadow: 0 0 0 1px #9ca3af;
}
.timeline-bubble {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  align-items: center;
}
.timeline-date-inner {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  text-align: center;
}
.timeline-date-col {
  border-right: 1px solid var(--border);
  padding-right: 12px;
  text-align: center;
}
.timeline-time-inner {
  font-size: 11px;
  margin-top: 2px;
}
.timeline-row.dir-theirs .timeline-date-col { border-right-color: #a7f3d0; }
.timeline-row.dir-mine .timeline-date-col,
.timeline-row:not(.dir-theirs):not(.dir-mine) .timeline-date-col { border-right-color: #d1d5db; }
.timeline-content { min-width: 0; }
.timeline-row.dir-theirs .timeline-bubble {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.timeline-row.dir-mine .timeline-bubble,
.timeline-row:not(.dir-theirs):not(.dir-mine) .timeline-bubble {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.timeline-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12px;
}
.timeline-dir  { color: var(--text-muted); }
.timeline-actions { margin-left: auto; }
.timeline-actions .btn-link { font-size: 12px; }
.timeline-note { font-size: 13px; white-space: pre-wrap; }

/* 视频反馈 */
.video-group { margin-top: 14px; }
.video-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg-alt);
  border-radius: 6px;
  margin-bottom: 8px;
}
.video-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.video-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.video-url { flex: 1; min-width: 200px; }
.video-url a { font-size: 13px; }
.video-meta { display: flex; gap: 8px; align-items: center; }
.video-actions { margin-left: auto; }
.video-body .pre { margin-top: 4px; }

/* v0.7.7 视频反馈表格样式 */
.video-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 13px;
}
.video-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 12px;
  background: #f9fafb;
}
.video-table tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.video-table tbody tr:hover {
  background: #f9fafb;
}
.video-table .video-link {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-size: 12px;
}
.paid-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.paid-badge.paid {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

/* modal 宽度可变 */
.modal textarea { width: 100%; }

/* ══════ PHASE 5: login / user mgmt ══════ */
.login-backdrop {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  width: 380px;
  max-width: 92vw;
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-brand {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 22px; color: var(--primary);
  margin-bottom: 4px;
}
.login-brand .brand-logo { font-size: 26px; color: var(--primary-light); }
.login-brand .brand-name { font-weight: 700; letter-spacing: .5px; }
.login-sub {
  color: var(--text-muted);
  margin-bottom: 22px;
  font-size: 13px;
}
.login-hint {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  text-align: center;
}
.login-hint code {
  padding: 1px 5px;
  background: var(--bg-alt);
  border-radius: 3px;
}

/* whoami dropdown */
.me-menu {
  position: absolute;
  right: 12px;
  top: 48px;
  background: #fff;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  min-width: 140px;
  padding: 6px 0;
  z-index: 60;
  color: var(--text);
  border: 1px solid var(--border);
}
.me-menu a {
  display: block;
  padding: 8px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}
.me-menu a:hover { background: var(--bg-alt); }

/* 用户管理页 role-tag 内嵌版 */
.role-tag-inline {
  background: var(--primary-tint);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
}

/* PHASE 6: auto-synced sample tag */
.tag-auto {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

/* 密码框 + 显示/隐藏切换 */
.pwd-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pwd-wrap input {
  padding-right: 40px;  /* 给按钮留位 */
}
.pwd-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  color: var(--text-muted);
  user-select: none;
}
.pwd-toggle:hover { color: var(--text); }

/* PHASE 7: 详情页头像上传块 */
.avatar-block {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.avatar-block .avatar.big {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  font-size: 32px;
  background-size: cover;
  background-position: center;
}
.avatar-actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding-top: 8px;
}
.avatar-actions .btn-small {
  background: var(--primary-tint);
  color: var(--primary);
  padding: 6px 12px;
}


/* 视频反馈表格：固定列宽，跨年份各 table 列宽一致对齐 */
.video-table {
  table-layout: fixed;
  width: 100%;
}
.video-table th, .video-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}
