/**
 * 求职看板 — Notion 风格（对齐 getdesign: npx getdesign add notion → DESIGN.md）
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* DESIGN.md — Primary & surfaces */
  --text-primary: rgba(0, 0, 0, 0.95);
  --text-secondary: #615d59;
  --text-tertiary: #a39e98;
  --text-accent: #0075de;

  --bg-base: #ffffff;
  --bg-warm: #f6f5f4;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-elevated: rgba(0, 0, 0, 0.03);
  --bg-input: #ffffff;
  --bg-code: #f6f5f4;

  --notion-blue: #0075de;
  --notion-blue-active: #005bab;
  --focus-blue: #097fe8;
  --badge-blue-bg: #f2f9ff;
  --badge-blue-text: #097fe8;

  --accent-primary: #0075de;
  --accent-secondary: #dd5b00;

  --success: #1aae39;
  --warning: #dd5b00;
  --danger: #e03e3e;
  --info: #0075de;

  --border-whisper: rgba(0, 0, 0, 0.1);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-default: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.15);
  --border-accent: rgba(0, 117, 222, 0.35);
  --border-input: #dddddd;

  --font-body: 'Inter', -apple-system, system-ui, 'Segoe UI', Helvetica, sans-serif;
  --font-display: 'Inter', -apple-system, system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Consolas', monospace;

  --text-h1: 1.75rem;
  --text-h2: 1.375rem;
  --text-h3: 1.125rem;
  --text-body: 1rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Card shadow — DESIGN.md §2 */
  --shadow-card:
    rgba(0, 0, 0, 0.04) 0px 4px 18px,
    rgba(0, 0, 0, 0.027) 0px 2.025px 7.84688px,
    rgba(0, 0, 0, 0.02) 0px 0.8px 2.925px,
    rgba(0, 0, 0, 0.01) 0px 0.175px 1.04062px;
  --shadow-card-hover:
    rgba(0, 0, 0, 0.06) 0px 8px 24px,
    rgba(0, 0, 0, 0.04) 0px 2px 8px;
  --shadow-panel:
    -4px 0 24px rgba(0, 0, 0, 0.06),
    0 0 0 1px var(--border-whisper);
  --shadow-focus: 0 0 0 2px rgba(9, 127, 232, 0.25);

  --sidebar-width: 220px;
  --detail-panel-width: 440px;
  --topbar-height: 56px;

  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-panel: 300ms;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text-primary);
  background: var(--bg-warm);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

.app {
  display: grid;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Topbar */
.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-logo {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.topbar-logo span { color: var(--notion-blue); }

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 380px;
  margin: 0 auto;
}
.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 14px;
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-8) 0 var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-input:focus {
  border-color: var(--focus-blue);
  box-shadow: var(--shadow-focus);
}
.search-shortcut {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  background: var(--bg-warm);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 34px;
  padding: 0 var(--space-4);
  background: var(--notion-blue);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--duration-fast), transform 80ms;
}
.btn-primary:hover { background: var(--notion-blue-active); }
.btn-primary:active { transform: scale(0.97); }
.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.btn-icon:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Sidebar — warm rail */
.sidebar {
  grid-row: 2;
  grid-column: 1;
  background: var(--bg-warm);
  border-right: 1px solid var(--border-default);
  padding: var(--space-5) var(--space-3);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-4) var(--space-3) var(--space-1);
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--duration-fast);
  user-select: none;
}
.sidebar-nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}
.sidebar-nav-item.active {
  border-left-color: var(--notion-blue);
  background: rgba(0, 117, 222, 0.06);
  color: var(--text-primary);
  font-weight: 600;
}
.sidebar-badge {
  margin-left: auto;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}
.sidebar-nav-item.active .sidebar-badge { color: var(--badge-blue-text); }
.sidebar-divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-3) var(--space-3);
}
.btn-ghost {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

/* Main */
.main {
  grid-row: 2;
  grid-column: 2;
  overflow-y: auto;
  padding: var(--space-6);
  background: var(--bg-base);
  transition: padding-right var(--duration-panel) var(--ease-spring);
}
.app.panel-open .main {
  padding-right: calc(var(--detail-panel-width) + var(--space-6));
}

/* 时间线总览：隐藏与看板共用的 Hero（统计+AI）、公司 Tab */
.main.view-timeline #tabs-bar {
  display: none !important;
}
.main.view-timeline .hero-board-only {
  display: none !important;
}
.hero-timeline-only {
  display: none;
}
.main.view-timeline .hero-timeline-only {
  display: block;
}
.main.view-timeline .hero {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
}
.hero-timeline-title {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
}
.hero-timeline-sub {
  margin: 0;
  max-width: 42rem;
  line-height: 1.55;
}

.hero {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-default);
}
.hero-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}
.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: var(--space-5);
}
.stats-row {
  display: flex;
  gap: var(--space-8);
}
.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--notion-blue);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-divider {
  width: 1px;
  background: var(--border-default);
  align-self: stretch;
}

/* Hero：首页显眼 AI 入口 */
.hero-ai {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(135deg, rgba(46, 115, 252, 0.07) 0%, rgba(46, 115, 252, 0.02) 50%, var(--bg-warm) 100%);
  border: 1px solid rgba(46, 115, 252, 0.18);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.hero-ai-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.hero-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--notion-blue);
  border-radius: var(--radius-sm);
}
.hero-ai-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}
.hero-ai-sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  flex: 1 1 100%;
}
@media (min-width: 640px) {
  .hero-ai-sub {
    flex: 1 1 auto;
    margin-left: var(--space-2);
  }
}
.hero-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.hero-ai-btn {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 10px 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  background: var(--notion-blue);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(46, 115, 252, 0.25);
  transition: background var(--duration-fast), transform var(--duration-fast);
}
.hero-ai-btn:hover {
  filter: brightness(1.06);
}
.hero-ai-btn:active {
  transform: scale(0.98);
}
.hero-ai-hint {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.5;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.hero-ai-hint:focus {
  outline: none;
}
.hero-ai-hint code {
  font-size: 11px;
  padding: 1px 4px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.ai-pick-list {
  max-height: min(52vh, 360px);
  overflow-y: auto;
  margin-top: var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-base);
}
.ai-pick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-3);
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.ai-pick-row:last-child {
  border-bottom: none;
}
.ai-pick-row:hover {
  background: var(--bg-warm);
}
.ai-pick-sector {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  flex: 0 0 100%;
}
@media (min-width: 480px) {
  .ai-pick-sector {
    flex: 0 0 56px;
  }
}
.ai-pick-main {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--text-sm);
}
.ai-pick-co {
  font-weight: 600;
}
.ai-pick-sep {
  color: var(--text-tertiary);
  margin: 0 4px;
}
.ai-pick-job {
  color: var(--text-secondary);
}
.ai-pick-date {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  flex: 0 0 auto;
}

.tabs-bar {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  margin-bottom: var(--space-5);
  scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 30px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--bg-base);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.tab-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.tab-chip.active {
  background: var(--badge-blue-bg);
  border-color: rgba(9, 127, 232, 0.35);
  color: var(--badge-blue-text);
  font-weight: 600;
}
.tab-chip .count {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.75;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
.app.panel-open .card-grid {
  grid-template-columns: repeat(2, 1fr);
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-smooth),
    box-shadow var(--duration-normal) var(--ease-smooth),
    border-color var(--duration-fast),
    background var(--duration-fast);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  border-left: 3px solid transparent;
  opacity: 0;
  animation: card-appear 400ms var(--ease-smooth) forwards;
}
@keyframes card-appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.app-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.app-card.active {
  border-left-color: var(--notion-blue);
  border-color: rgba(0, 117, 222, 0.25);
}
.app-card:active { transform: scale(0.985); }

.card-company {
  font-family: var(--font-body);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 2px;
  letter-spacing: -0.25px;
}
.card-job {
  font-size: var(--text-body);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: var(--space-4);
}
.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-3);
  margin-top: var(--space-1);
}
.card-resume {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.card-time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.125px;
  font-family: var(--font-body);
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-neutral {
  background: var(--bg-warm);
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.badge-info {
  background: var(--badge-blue-bg);
  color: var(--badge-blue-text);
  border: 1px solid rgba(9, 127, 232, 0.2);
}
.badge-accent {
  background: var(--badge-blue-bg);
  color: var(--badge-blue-text);
  border: 1px solid rgba(9, 127, 232, 0.2);
}
.badge-success {
  background: rgba(26, 174, 57, 0.1);
  color: var(--success);
  border: 1px solid rgba(26, 174, 57, 0.25);
}
.badge-warning {
  background: rgba(221, 91, 0, 0.1);
  color: var(--warning);
  border: 1px solid rgba(221, 91, 0, 0.25);
}
.badge-danger {
  background: rgba(224, 62, 62, 0.08);
  color: var(--danger);
  border: 1px solid rgba(224, 62, 62, 0.2);
}
.card-date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px var(--space-8);
  text-align: center;
  gap: var(--space-3);
}
.empty-icon {
  width: 44px;
  height: 44px;
  opacity: 0.25;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2);
}
.empty-title {
  font-size: var(--text-h3);
  color: var(--text-secondary);
  font-weight: 600;
}
.empty-desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  max-width: 260px;
  line-height: 1.7;
}

.detail-panel {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: var(--detail-panel-width);
  max-width: min(var(--detail-panel-width), calc(100vw - var(--sidebar-width) - 24px));
  z-index: 40;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-panel);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--duration-panel) var(--ease-spring);
  will-change: transform;
}
.app.panel-open .detail-panel {
  transform: translateX(0);
}
.panel-topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 10;
}
.panel-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.panel-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--duration-fast);
}
.panel-close:hover {
  background: var(--bg-warm);
  color: var(--text-primary);
}
.panel-title-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}
.panel-link {
  font-size: var(--text-sm);
  color: var(--notion-blue);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity var(--duration-fast);
}
.panel-link:hover { opacity: 0.75; }

.detail-section {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.detail-section:last-child { border-bottom: none; }
.detail-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.detail-company {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.25px;
  margin-bottom: var(--space-1);
}
.detail-job {
  font-size: var(--text-h3);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: var(--space-4);
}
.detail-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.detail-meta-label {
  font-size: 10px;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.detail-meta-value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.version-field {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.version-input {
  flex: 1;
  height: 34px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.version-input::placeholder { color: var(--text-tertiary); }
.version-input:focus {
  border-color: var(--focus-blue);
  box-shadow: var(--shadow-focus);
}

.timeline { display: flex; flex-direction: column; gap: var(--space-3); }
.timeline-item {
  display: flex;
  gap: var(--space-3);
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: -12px;
  width: 1px;
  background: var(--border-default);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--notion-blue);
  background: var(--bg-base);
  flex-shrink: 0;
  margin-top: 3px;
}
/* 时间线圆点：与节点类型一致（详情表单外若展示时间轴时用） */
.timeline-dot.delivery,
.timeline-dot.apply {
  border-color: var(--text-tertiary);
  background: var(--bg-base);
}
.timeline-dot.assessment {
  border-color: var(--warning);
  background: rgba(221, 91, 0, 0.12);
}
.timeline-dot.interview {
  background: var(--notion-blue);
  border-color: var(--notion-blue);
}
.timeline-dot.final {
  border-color: var(--success);
  background: rgba(26, 174, 57, 0.14);
}
.timeline-content { flex: 1; }
.timeline-event {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 2px;
}
.timeline-detail {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* 主区：卡片容器与时间线总览切换 */
.card-grid-wrap {
  display: block;
}
.card-grid-wrap.is-hidden {
  display: none !important;
}
.main-timeline {
  padding-bottom: var(--space-6);
}
.main-timeline.is-hidden {
  display: none !important;
}
.timeline-overview-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-default);
}
.timeline-overview-h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 var(--space-2);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.timeline-overview-lead {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}
.timeline-overview-intro .form-hint {
  margin: 0;
  max-width: 52rem;
  line-height: 1.55;
}
.timeline-overview-root {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.tl-overview-sector {
  scroll-margin-top: var(--space-5);
}
.tl-overview-sector + .tl-overview-sector {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-default);
}
.tl-overview-sector-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 var(--space-3);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.tl-overview-sector-count {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}
.tl-overview-sector-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.tl-overview-sector-empty {
  margin: 0;
}
.timeline-overview-empty {
  margin: var(--space-4) 0;
}
.tl-overview-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: var(--space-4);
  cursor: pointer;
  transition:
    border-color var(--duration-fast),
    box-shadow var(--duration-fast);
}
.tl-overview-card:hover {
  border-color: rgba(46, 115, 252, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.tl-overview-card:focus {
  outline: 2px solid var(--focus-blue);
  outline-offset: 2px;
}
.tl-overview-card.active {
  border-color: rgba(0, 117, 222, 0.4);
  box-shadow: 0 0 0 1px rgba(0, 117, 222, 0.12);
}
.tl-overview-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.tl-overview-title-block {
  min-width: 0;
  flex: 1 1 auto;
}
.tl-overview-co {
  font-weight: 700;
  font-size: var(--text-body);
  color: var(--text-primary);
}
.tl-overview-job {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}
.tl-mini-track {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 2px 4px;
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-warm);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.tl-mini-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 44px;
  max-width: 76px;
  text-align: center;
}
.tl-mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  flex-shrink: 0;
}
.tl-mini-step.delivery .tl-mini-dot {
  border-color: var(--text-tertiary);
  background: var(--bg-base);
}
.tl-mini-step.assessment .tl-mini-dot {
  border-color: var(--warning);
  background: rgba(221, 91, 0, 0.15);
}
.tl-mini-step.interview .tl-mini-dot {
  border-color: var(--notion-blue);
  background: var(--notion-blue);
}
.tl-mini-step.final .tl-mini-dot {
  border-color: var(--success);
  background: rgba(26, 174, 57, 0.2);
}
.tl-mini-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.tl-mini-cap {
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-secondary);
  word-break: break-word;
}
.tl-mini-join {
  align-self: center;
  padding: 0 2px 10px;
  color: var(--text-tertiary);
  font-size: 14px;
  user-select: none;
}
.tl-mini-empty {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}
.tl-overview-foot {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.5;
}
.tl-overview-foot-label {
  font-weight: 600;
  color: var(--text-secondary);
}
.tl-overview-foot-sep {
  margin: 0 6px;
  opacity: 0.55;
}

/* 投递详情：时间线编辑 */
.timeline-edit-section {
  padding-top: var(--space-2);
}
.timeline-edit-section .timeline-edit-row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.timeline-edit-section .timeline-edit-row:last-child {
  border-bottom: none;
}
.timeline-edit-grid {
  display: grid;
  grid-template-columns: minmax(112px, 1.1fr) minmax(100px, 1.2fr) minmax(0, 2fr) auto;
  gap: var(--space-2) var(--space-3);
  align-items: end;
}
.timeline-edit-field {
  min-width: 0;
}
@media (max-width: 520px) {
  .timeline-edit-grid {
    grid-template-columns: 1fr;
  }
  .timeline-edit-actions-cell {
    justify-self: start;
  }
}
.timeline-edit-field .form-label {
  margin-bottom: 4px;
}
.timeline-edit-field-wide {
  min-width: 0;
}
.timeline-edit-actions-cell .btn-ghost {
  color: var(--danger);
  font-size: var(--text-sm);
  padding: 6px 8px;
}
.timeline-edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.link-list { display: flex; flex-direction: column; gap: var(--space-2); }
.link-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-warm);
  border: 1px solid var(--border-default);
  transition: border-color var(--duration-fast);
  cursor: pointer;
}
.link-item:hover { border-color: var(--border-strong); }
.link-item-title { font-size: var(--text-sm); color: var(--text-primary); flex: 1; }
.link-item-url {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-icon { color: var(--text-tertiary); font-size: 13px; }

/* 公司信息与链接：可编辑链接行 */
.profile-link-row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.profile-link-row:last-of-type {
  border-bottom: none;
}
.profile-link-url-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.profile-link-url-row .pf-link-url {
  flex: 1;
  min-width: 140px;
}
.pf-link-visit {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--notion-blue);
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 4px;
}
.pf-link-visit:hover:not(.pf-link-visit-disabled) {
  text-decoration: underline;
}
.pf-link-visit-disabled {
  color: var(--text-tertiary);
  pointer-events: none;
  cursor: default;
  opacity: 0.55;
}
.profile-save-row {
  padding-top: var(--space-2);
}

/* 投递详情：简历附件（IndexedDB） */
.resume-attach-section .resume-file-card {
  margin-top: var(--space-2);
  padding: var(--space-4);
  background: var(--bg-warm);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}
.resume-file-row-top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.resume-file-emoji {
  font-size: 1.5rem;
  line-height: 1;
}
.resume-file-text {
  flex: 1;
  min-width: 0;
}
.resume-file-name-line {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}
.resume-file-sub {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 4px;
}
.resume-file-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.resume-pick-label,
.resume-reupload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  margin: 0;
  font-weight: 600;
}
.resume-reupload-label {
  min-height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
}
.visually-hidden-resume-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ai-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.ai-quick-actions .btn-secondary-modal {
  flex: 1 1 auto;
  min-width: 140px;
}

#toast-host {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  max-width: min(420px, calc(100vw - 32px));
}
.app-toast {
  padding: 10px 16px;
  background: rgba(32, 32, 32, 0.92);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  text-align: center;
  animation: toast-in 0.22s var(--ease-smooth);
}
.app-toast-out {
  opacity: 0;
  transition: opacity 0.28s ease;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* AI 结果弹窗：主体区域可滚动，避免双滚动条别扭 */
.modal-ai-result .modal {
  max-width: min(800px, 96vw);
}
.modal-ai-result .modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  max-height: calc(100vh - 140px);
  padding-top: var(--space-3);
}

/* AI 弹窗：Markdown 渲染区 */
.ai-result-md {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(68vh, calc(100vh - 200px));
  overflow: auto;
  margin: 0;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-warm);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--text-primary);
  word-break: break-word;
}
.ai-result-md h1,
.ai-result-md h2,
.ai-result-md h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1.1em 0 0.45em;
  line-height: 1.3;
  color: var(--text-primary);
}
.ai-result-md h1:first-child,
.ai-result-md h2:first-child,
.ai-result-md h3:first-child {
  margin-top: 0;
}
.ai-result-md h1 {
  font-size: 1.2rem;
}
.ai-result-md h2 {
  font-size: 1.05rem;
}
.ai-result-md h3 {
  font-size: 0.98rem;
}
.ai-result-md p {
  margin: 0.55em 0;
}
.ai-result-md ul,
.ai-result-md ol {
  margin: 0.55em 0 0.55em 1.35em;
  padding: 0;
}
.ai-result-md ol {
  list-style-position: outside;
}
.ai-result-md li {
  margin: 0.35em 0;
  padding-left: 0.15em;
}
.ai-result-md li > p {
  margin: 0.35em 0;
}
.ai-result-md li > p:first-child {
  margin-top: 0;
}
.ai-result-md li > p:last-child {
  margin-bottom: 0;
}
.ai-result-md li > ul,
.ai-result-md li > ol {
  margin-top: 0.35em;
  margin-bottom: 0.35em;
}
.ai-result-md strong {
  font-weight: 700;
  color: var(--text-primary);
}
.ai-result-md hr {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--space-4) 0;
}
.ai-result-md code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}
.ai-result-md pre {
  margin: 0.75em 0;
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
}
.ai-result-md pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.ai-result-md blockquote {
  margin: 0.6em 0;
  padding: 0.35em 0 0.35em var(--space-3);
  border-left: 3px solid var(--notion-blue);
  color: var(--text-secondary);
}
.ai-result-md a {
  color: var(--notion-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ai-result-md table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75em 0;
  font-size: 12px;
}
.ai-result-md th,
.ai-result-md td {
  border: 1px solid var(--border-default);
  padding: 6px 8px;
  text-align: left;
}
.ai-result-md th {
  background: rgba(0, 0, 0, 0.04);
  font-weight: 600;
}
.ai-result-md-fallback {
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-result-extra {
  margin-top: var(--space-3);
  padding: 0 var(--space-1) var(--space-2);
}

.ai-jd-paste {
  min-height: 200px;
  font-size: 13px;
  line-height: 1.5;
}

.ai-jd-check-wrap {
  padding: var(--space-4);
  background: var(--bg-warm);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}

.ai-jd-check-wrap > .detail-section-title,
.ai-jd-check-wrap > .form-hint:first-of-type {
  margin-top: 0;
}

.ai-jd-group {
  margin-top: var(--space-3);
}

.ai-jd-group:first-of-type {
  margin-top: 0;
}

.ai-jd-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.ai-jd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ai-jd-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.ai-jd-row input {
  margin-top: 3px;
  flex-shrink: 0;
}

.ai-jd-append-btn {
  width: 100%;
}

.notes-area {
  width: 100%;
  min-height: 80px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  line-height: 1.6;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.notes-area::placeholder { color: var(--text-tertiary); }
.notes-area:focus {
  border-color: var(--focus-blue);
  box-shadow: var(--shadow-focus);
}

.btn-danger-disabled {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  border: 1px solid var(--border-default);
  color: var(--text-tertiary);
  background: transparent;
  cursor: not-allowed;
  opacity: 0.55;
}

.app-card:nth-child(1) { animation-delay: 0ms; }
.app-card:nth-child(2) { animation-delay: 40ms; }
.app-card:nth-child(3) { animation-delay: 80ms; }
.app-card:nth-child(4) { animation-delay: 120ms; }
.app-card:nth-child(5) { animation-delay: 160ms; }
.app-card:nth-child(6) { animation-delay: 200ms; }
.app-card:nth-child(7) { animation-delay: 240ms; }
.app-card:nth-child(8) { animation-delay: 280ms; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }

@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ─── Modal (表单) ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-fast), visibility var(--duration-fast);
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.modal.modal-wide {
  max-width: min(720px, 94vw);
}
.ai-quick-stack {
  flex-direction: column;
}
.ai-quick-stack .btn-primary-modal {
  width: 100%;
  justify-content: center;
}
.modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow:
    rgba(0, 0, 0, 0.01) 0px 1px 3px,
    rgba(0, 0, 0, 0.02) 0px 3px 7px,
    rgba(0, 0, 0, 0.02) 0px 7px 15px,
    rgba(0, 0, 0, 0.04) 0px 14px 28px,
    rgba(0, 0, 0, 0.05) 0px 23px 52px;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.25px;
}
.modal-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.form-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--focus-blue);
  box-shadow: var(--shadow-focus);
}
.form-textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.5;
}
.form-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle);
}
.btn-secondary-modal {
  height: 36px;
  padding: 0 var(--space-4);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-secondary-modal:hover {
  background: rgba(0, 0, 0, 0.08);
}
.btn-primary-modal {
  height: 36px;
  padding: 0 var(--space-4);
  font-size: 0.94rem;
  font-weight: 600;
  color: #fff;
  background: var(--notion-blue);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-primary-modal:hover {
  background: var(--notion-blue-active);
}
.modal-close-x {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.modal-close-x:hover {
  background: var(--bg-warm);
  color: var(--text-primary);
}
