:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #11203b;
  --muted: #5b6c86;
  --line: #d8e2ef;
  --primary: #1a73e8;
  --primary-soft: #e8f1ff;
  --accent: #ff7a1a;
  --accent-soft: #fff1e6;
  --success: #1f9d63;
  --success-soft: #ecfdf3;
  --warning: #c57b08;
  --warning-soft: #fff8e6;
  --slate-soft: #f2f5f8;
  --shadow: 0 20px 50px rgba(17, 32, 59, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(26, 115, 232, 0.14), transparent 28%),
    radial-gradient(circle at right 20%, rgba(255, 122, 26, 0.14), transparent 24%),
    linear-gradient(180deg, #f9fbfe 0%, #eef3f8 100%);
}

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

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid rgba(17, 32, 59, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 252, 0.88));
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #ffb072);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  box-shadow: var(--shadow);
}

.brand h1,
.topbar h2,
.hero h3,
.section-head h3,
.detail-card h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--primary);
  text-transform: uppercase;
}

.sidebar-note,
.status-copy,
.hero-copy,
.preview-head p,
.timeline li span,
.detail-empty p {
  color: var(--muted);
  line-height: 1.7;
}

.nav {
  display: grid;
  gap: 10px;
  margin: 28px 0;
}

.nav-btn,
.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.nav-btn {
  text-align: left;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}

.nav-btn:hover,
.ghost-btn:hover,
.primary-btn:hover {
  transform: translateY(-1px);
}

.nav-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.18);
}

.status-panel,
.card {
  background: var(--panel);
  border: 1px solid rgba(17, 32, 59, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.status-panel {
  padding: 18px;
}

.status-label {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.mode-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 12px;
}

.main {
  padding: 26px 28px 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), #3e8df2);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 16px 32px rgba(26, 115, 232, 0.22);
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.ghost-btn {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  border: 1px solid rgba(17, 32, 59, 0.1);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.hero-chip {
  min-width: 220px;
  padding: 18px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, #15223f, #2d4e88);
  color: #fff;
}

.hero-chip span {
  display: block;
  font-size: 12px;
  opacity: 0.82;
  margin-bottom: 8px;
}

.hero-chip strong {
  font-size: 20px;
}

.upload-layout,
.overview-grid,
.split-layout {
  display: grid;
  gap: 18px;
}

.upload-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

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

.split-layout {
  grid-template-columns: 360px minmax(0, 1fr);
}

.card {
  padding: 22px;
}

.field {
  display: grid;
  gap: 10px;
}

.field span {
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 15px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field.compact span {
  font-size: 13px;
}

.drop-grid,
.preview-grid,
.metrics {
  display: grid;
  gap: 14px;
}

.drop-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.dropzone {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1.5px dashed rgba(26, 115, 232, 0.22);
  border-radius: 20px;
  background: linear-gradient(180deg, #fcfdff, #f4f8fd);
  cursor: pointer;
}

.dropzone input {
  display: none;
}

.drop-title {
  font-size: 18px;
  font-weight: 700;
}

.drop-sub,
.drop-meta {
  color: var(--muted);
}

.cta-row {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.preview-head {
  margin-bottom: 16px;
}

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

.preview-frame {
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  background: var(--slate-soft);
}

.preview-frame figcaption {
  font-weight: 700;
  margin-bottom: 10px;
}

.preview-frame img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  background: linear-gradient(135deg, #d9e5f6, #f8fbff);
}

.metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
  border-radius: 22px;
  color: #fff;
}

.metric-card.blue { background: linear-gradient(135deg, #1c68d5, #519bf7); }
.metric-card.green { background: linear-gradient(135deg, #1e925d, #36b576); }
.metric-card.gold { background: linear-gradient(135deg, #c97806, #f1ab34); }
.metric-card.slate { background: linear-gradient(135deg, #53667f, #7f93ab); }
.metric-card.orange { background: linear-gradient(135deg, #e56418, #ff9a58); }

.metric-label {
  margin: 0;
  opacity: 0.85;
}

.metric-value {
  margin: 10px 0 0;
  font-size: 34px;
  font-weight: 800;
}

.timeline,
.warning-list {
  margin: 0;
  padding-left: 18px;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline li strong {
  display: block;
  margin-bottom: 6px;
}

.warning-list {
  display: grid;
  gap: 10px;
}

.warning-list li {
  line-height: 1.6;
}

.review-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: 4px;
}

.review-item {
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(17, 32, 59, 0.08);
  background: #fff;
  cursor: pointer;
}

.review-item.active {
  border-color: rgba(26, 115, 232, 0.3);
  background: var(--primary-soft);
}

.review-item h4,
.candidate-title {
  margin: 0 0 8px;
  font-size: 16px;
}

.review-meta,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill.info {
  background: var(--primary-soft);
  color: var(--primary);
}

.pill.slate {
  background: var(--slate-soft);
  color: #55657f;
}

.detail-empty {
  display: grid;
  place-items: center;
  min-height: 420px;
  text-align: center;
}

.detail-section {
  display: grid;
  gap: 18px;
}

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

.info-box {
  padding: 16px;
  border-radius: 18px;
  background: var(--slate-soft);
}

.info-box span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.filters-card {
  margin-bottom: 16px;
}

.toolbar {
  display: flex;
  gap: 14px;
  align-items: end;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1200px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  background: #f8fbff;
  z-index: 1;
}

tbody tr.status-enriched {
  background: var(--success-soft);
}

tbody tr.status-review {
  background: var(--warning-soft);
}

tbody tr.status-slate {
  background: #f8fafc;
}

.table-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 1200px) {
  .shell,
  .upload-layout,
  .overview-grid,
  .split-layout,
  .metrics {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .preview-grid,
  .drop-grid,
  .detail-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }
}
