/* 说明：定义七米豆丁作战台前端的整体布局、组件样式和响应式规则。 */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fafc;
  --text: #1f2937;
  --muted: #6b7280;
  --subtle: #94a3b8;
  --border: #d9e1ec;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --green: #15803d;
  --green-bg: #e9f8ef;
  --red: #b42318;
  --red-bg: #fff0ed;
  --amber: #a15c07;
  --amber-bg: #fff7e6;
  --blue-bg: #eef5ff;
  --orange: #e8873a;
  --orange-bg: #fff8f2;
  --orange-light: #fde8d4;
  --shadow: 0 18px 40px rgba(30, 41, 59, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  transition: grid-template-columns 200ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  background: #101827;
  color: #e5eefc;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow: hidden;
  transition: padding 200ms ease;
}

.sidebar.collapsed {
  padding: 20px 8px;
}

.sidebar.collapsed .sidebar-brand > :last-child,
.sidebar.collapsed .nav-item > span,
.sidebar.collapsed .sidebar-foot {
  display: none;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.sidebar-collapse-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.07);
  color: #9fb0c8;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-size: 13px;
  transition: background 150ms;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sidebar-collapse-btn .icon {
  transition: transform 200ms ease;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-collapse-btn .icon {
  transform: rotate(180deg);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.sidebar-brand {
  padding: 0 8px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 16px;
}

.sidebar-brand span,
.sidebar-foot span,
.topbar-title span,
.panel-title p,
.page-head p,
.metric-panel p,
.goal-main p,
.tree-parent p,
.tree-child p,
.compact-row p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sidebar-brand span,
.sidebar-foot span {
  color: #9fb0c8;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  border: 0;
  color: #b9c7dc;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.sidebar-foot strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.main-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-title {
  display: grid;
  gap: 2px;
}

.topbar-title strong {
  font-size: 16px;
}

.topbar-actions,
.head-actions,
.row-actions,
.inline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.view {
  padding: 28px;
}

.view-stack {
  display: grid;
  gap: 18px;
}

.page-head,
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.page-head h1,
.panel-title h2,
.summary-panel h2 {
  margin: 0;
  line-height: 1.2;
}

.page-head h1 {
  font-size: 28px;
  letter-spacing: 0;
}

.page-head p,
.panel-title p,
.metric-panel p,
.goal-main p,
.tree-parent p,
.tree-child p,
.compact-row p {
  margin: 6px 0 0;
}

.panel,
.metric-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 14px;
}

.metric-panel {
  padding: 18px;
  min-height: 128px;
}

.metric-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
}

.mission-panel strong {
  font-size: 20px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid,
.two-column,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel-wide {
  min-width: 0;
}

.narrow-panel {
  max-width: 720px;
}

.goal-list,
.compact-list,
.risk-list,
.tree-list,
.timeline,
.editable-list,
.prompt-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.goal-row,
.tree-parent,
.tree-child,
.compact-row,
.editable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.goal-main strong,
.tree-parent strong,
.tree-child strong,
.compact-row strong,
.risk-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
}

.dept-mark {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.goal-meta {
  min-width: 108px;
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.risk-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: var(--red-bg);
  border: 1px solid #ffd2cc;
}

.risk-item span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.tree-month {
  display: grid;
  gap: 8px;
}

.tree-children {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  border-left: 2px solid var(--border);
}

.tree-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0;
}

.adhoc-block {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.adhoc-block h3 {
  margin: 0;
  font-size: 15px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.summary-panel {
  box-shadow: none;
}

.summary-panel ul {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.tone-green {
  background: var(--green-bg);
}

.tone-red {
  background: var(--red-bg);
}

.tone-amber {
  background: var(--amber-bg);
}

.tone-blue {
  background: var(--blue-bg);
}

.timeline {
  position: relative;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.timeline-head,
.compact-row.stacked > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.timeline-item p {
  margin: 8px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.team-work-panel {
  overflow: hidden;
}

.work-matrix-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.work-matrix {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.work-matrix th,
.work-matrix td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.work-matrix th:last-child,
.work-matrix td:last-child {
  border-right: 0;
}

.work-matrix tr:last-child th,
.work-matrix tr:last-child td {
  border-bottom: 0;
}

.work-matrix thead th {
  height: 44px;
  padding: 9px 12px;
  background: #f4f7fa;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.work-matrix thead th:first-child {
  width: 132px;
}

.work-matrix thead span,
.work-matrix thead small {
  display: block;
}

.work-matrix thead small {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
}

.work-matrix tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 12px;
  background: #fff;
}

.work-matrix tbody td {
  height: 112px;
  padding: 10px;
  background: #fff;
}

.member-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.member-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-bg);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.member-cell strong,
.member-cell small {
  display: block;
}

.member-cell strong {
  font-size: 13px;
  line-height: 1.35;
}

.member-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.work-cell-list {
  display: grid;
  gap: 8px;
}

.work-entry {
  display: grid;
  gap: 5px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.work-entry-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.work-entry-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.work-entry p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-entry-hidden { display: none; }
.work-cell-list.expanded .work-entry-hidden { display: grid; }

.more-badge {
  display: inline-flex;
  align-items: center;
  align-self: start;
  margin-top: 4px;
  padding: 2px 8px;
  border: none;
  border-radius: 10px;
  background: var(--blue-bg);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms;
}

.more-badge:hover { background: rgba(37, 99, 235, 0.18); }

.work-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--subtle);
}

.work-status-dot.status-progress {
  background: var(--accent);
}

.work-status-dot.status-done {
  background: var(--green);
}

.work-status-dot.status-blocked {
  background: var(--red);
}

.empty-cell {
  display: inline-flex;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.5;
}

.compact-row.stacked {
  display: grid;
  grid-template-columns: 1fr auto;
}

.compact-row.stacked p {
  grid-column: 1 / -1;
  color: var(--text);
}

.form {
  display: grid;
  gap: 12px;
}

.form label {
  display: grid;
  gap: 6px;
}

.form label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form input,
.form select,
.form textarea,
.date-control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
  min-height: 40px;
}

.form textarea {
  resize: vertical;
  line-height: 1.55;
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.date-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.horizontal-form {
  grid-template-columns: 1.2fr 160px 160px minmax(220px, 1fr) auto;
  align-items: end;
}

.wide-field {
  min-width: 0;
}

.checkline {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  color: var(--muted);
  font-size: 13px;
}

.checkline input {
  width: 16px;
  min-height: 16px;
}

.primary-button,
.ghost-button,
.icon-button,
.tab-button,
.mobile-menu {
  border: 0;
  min-height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.primary-button {
  padding: 0 14px;
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  padding: 0 12px;
  color: var(--text);
  background: #eef2f7;
}

.icon-button,
.mobile-menu {
  width: 38px;
  color: var(--text);
  background: #eef2f7;
}

.icon-button.danger {
  color: var(--red);
  background: var(--red-bg);
}

.full-button {
  width: 100%;
}

.badge,
.date-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-gray,
.date-pill {
  color: #475569;
  background: #eef2f7;
}

.badge-blue {
  color: #1d4ed8;
  background: var(--blue-bg);
}

.badge-green {
  color: var(--green);
  background: var(--green-bg);
}

.badge-red {
  color: var(--red);
  background: var(--red-bg);
}

.badge-amber {
  color: var(--amber);
  background: var(--amber-bg);
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  width: fit-content;
  background: #e9eef6;
  border-radius: 8px;
}

.tab-button {
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
}

.tab-button.active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 2px 10px rgba(30, 41, 59, 0.08);
}

.editable-row {
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.4fr) minmax(90px, 0.5fr) auto auto;
  background: #fff;
}

.editable-row input,
.editable-row select {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px;
}

.prompt-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.empty-state,
.loading-state,
.error-panel {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(21, 128, 61, 0.06)),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
}

.login-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  margin-top: 24px;
}

.form-error {
  padding: 10px 12px;
  color: var(--red);
  background: var(--red-bg);
  border-radius: 8px;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
  transition: 160ms ease;
  font-size: 14px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.warn {
  background: var(--red);
}

.mobile-menu {
  display: none;
}

@media (max-width: 1120px) {
  .metric-grid,
  .review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .split-grid,
  .two-column,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .horizontal-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    width: 248px;
    transform: translateX(-100%);
    transition: 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar {
    padding: 0 14px;
  }

  .view {
    padding: 18px 14px;
  }

  .page-head,
  .panel-title {
    display: grid;
  }

  .metric-grid,
  .review-grid,
  .form-grid,
  .prompt-list,
  .horizontal-form {
    grid-template-columns: 1fr;
  }

  .goal-row,
  .tree-parent,
  .tree-child,
  .compact-row,
  .editable-row {
    grid-template-columns: 1fr;
  }

  .goal-meta,
  .row-actions {
    justify-items: start;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  width: min(480px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.modal-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Department filter select in board */
.dept-select {
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* ── 看板底部双列布局（风险 + 月目标） ── */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* ── 目标双栏（官方 vs 临时） ── */
.goal-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.goal-column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.col-dot.official { background: var(--accent); }
.col-dot.adhoc    { background: var(--orange); }

/* ── 目标行区分样式 ── */
.goal-row.goal-official {
  border-left: 3px solid var(--accent);
}

.goal-row.goal-adhoc {
  background: var(--orange-bg);
  border-color: var(--orange-light);
  border-left: 3px solid var(--orange);
}

.goal-row.goal-done {
  opacity: 0.55;
}

.goal-row.goal-done .goal-main strong {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

/* ── 拆分进度条（指标卡） ── */
.progress-split {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.progress-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.progress-label .label-name { color: var(--muted); }
.progress-label .label-val  { font-weight: 700; }
.progress-label .official-pct { color: var(--accent); }
.progress-label .adhoc-pct    { color: var(--orange); }

.progress-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-fill.official { background: var(--accent); }
.progress-fill.adhoc    { background: var(--orange); }

/* ── 录入表：节假日 / 周末 / 调休列 ── */
.work-matrix thead th.col-workday { color: var(--text); }
.work-matrix thead th.col-weekend { color: var(--subtle); }
.work-matrix thead th.col-holiday { color: var(--red); }
.work-matrix thead th.col-workend { color: #8a6400; }

.work-matrix thead th.col-holiday { background: #fff5f5; }

.work-matrix td.day-weekend,
.work-matrix thead th.col-weekend { background: #f5f7fa; }

.work-matrix td.day-workend,
.work-matrix thead th.col-workend { background: #fffbee; }

.work-matrix thead th.col-sep-left {
  border-left: 2px solid var(--border);
}

.day-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 3px;
  vertical-align: middle;
}

.day-tag.rest { background: #fdecea; color: var(--red); }
.day-tag.work { background: #fff3cd; color: #8a6400; }

/* ── 录入表图例 ── */
.matrix-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.matrix-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.matrix-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid;
  flex-shrink: 0;
}

/* ── 工作条目 popover ── */
.work-entry {
  cursor: pointer;
  border-radius: 6px;
  background: transparent;
  transition: background 120ms;
}

.work-entry:hover  { background: rgba(37, 99, 235, 0.07); }
.work-entry.active { background: rgba(37, 99, 235, 0.12); }

.work-popover {
  position: fixed;
  z-index: 500;
  width: 270px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14), 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  padding: 14px 16px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.97);
  transition: opacity 150ms ease, transform 150ms ease;
}

.work-popover.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.popover-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.popover-header strong { font-size: 13px; font-weight: 700; }

.popover-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.popover-body {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.popover-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.popover-support {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--red-bg);
  border-radius: 6px;
  font-size: 12px;
  color: var(--red);
}
