/* ── Serif-Professional 设计系统 ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=Source+Sans+3:wght@300;400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg:         #FAFAF8;
  --fg:         #1A1A1A;
  --muted:      #F5F3F0;
  --muted-fg:   #6B6B6B;
  --accent:     #B8860B;
  --accent-sec: #D4A84B;
  --border:     #E8E4DF;
  --card:       #FFFFFF;
  --shadow-sm:  0 1px 2px rgba(26,26,26,.04);
  --shadow-md:  0 4px 12px rgba(26,26,26,.06);
  --shadow-lg:  0 8px 24px rgba(26,26,26,.08);
  --radius:     6px;
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans:  "Source Sans 3", system-ui, sans-serif;
  --font-mono:  "IBM Plex Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  letter-spacing: .01em;
}

/* ── 标题系统 ── */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; border-bottom: 1px solid var(--border); padding-bottom: .6rem; margin-bottom: 1.4rem; }
h2 { font-size: 1.2rem; margin-bottom: .8rem; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }

/* ── Section Label ── */
.label {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.label::before, .label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── 导航栏 ── */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: .02em;
}
.navbar-brand span { color: var(--accent); }
.navbar-nav { display: flex; align-items: center; gap: 1.5rem; }
.navbar-nav a {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-fg);
  text-decoration: none;
  transition: color 200ms ease-out;
}
.navbar-nav a:hover { color: var(--fg); }
.navbar-user {
  font-size: .8rem;
  color: var(--muted-fg);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.role-badge {
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--muted);
  color: var(--accent);
  border: 1px solid var(--border);
}

/* ── 主容器 ── */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 2rem;
}
.container-sm { max-width: 680px; margin: 0 auto; padding: 3rem 1.5rem; }

/* ── 卡片 ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}
.card-accent { border-top: 2px solid var(--accent); }
.card:hover { box-shadow: var(--shadow-md); }

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  border: none;
  transition: all 200ms ease-out;
  text-decoration: none;
  min-height: 38px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-sec); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-fg);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--fg); }
.btn-ghost {
  background: transparent;
  color: var(--muted-fg);
  border: none;
}
.btn-ghost:hover { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.btn-danger {
  background: transparent;
  border: 1px solid #e5a0a0;
  color: #b85050;
}
.btn-danger:hover { background: #fff5f5; }
.btn-sm { padding: .28rem .7rem; font-size: .8rem; min-height: 30px; }
.btn-lg { padding: .6rem 1.4rem; font-size: 1rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── 表单元素 ── */
.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted-fg);
  margin-bottom: .35rem;
  letter-spacing: .02em;
}
.form-control {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  font-family: var(--font-sans);
  font-size: .9rem;
  color: var(--fg);
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
  min-height: 42px;
}
.form-control:hover { border-color: #ccc7c0; }
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,134,11,.12);
}
textarea.form-control { min-height: 120px; resize: vertical; line-height: 1.6; }

/* ── 拖拽上传区 ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 200ms ease-out;
  background: var(--bg);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(184,134,11,.03);
}
.upload-zone .upload-icon {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  color: var(--muted-fg);
}
.upload-zone .upload-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--fg);
  margin-bottom: .3rem;
}
.upload-zone .upload-hint {
  font-size: .8rem;
  color: var(--muted-fg);
}
.upload-zone .upload-success {
  color: #2d7a3e;
  font-weight: 500;
  font-size: .9rem;
  margin-top: .5rem;
}

/* ── 步骤指示器 ── */
.step-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.2rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  color: var(--muted-fg);
  flex-shrink: 0;
}
.step-num.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.step-num.done {
  background: #e8f4ec;
  border-color: #8dc49a;
  color: #2d7a3e;
}
.step-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--fg);
}

/* ── 状态徽章 ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge-pending  { background: var(--muted); color: var(--muted-fg); }
.badge-working  { background: #fef6e0; color: #8a6200; border: 1px solid #f0d87a; }
.badge-done     { background: #e8f4ec; color: #2d7a3e; border: 1px solid #8dc49a; }
.badge-error    { background: #fdf0f0; color: #b85050; border: 1px solid #e5a0a0; }

/* ── 表格 ── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-fg);
  font-weight: 500;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table td {
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  color: var(--fg);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--muted); }

/* ── 分割线 ── */
.rule { height: 1px; background: var(--border); border: none; margin: 2rem 0; }

/* ── Alert ── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.alert-error { background: #fdf0f0; color: #b85050; border-color: #e5a0a0; }
.alert-success { background: #e8f4ec; color: #2d7a3e; border-color: #8dc49a; }
.alert-info { background: #fef6e0; color: #8a6200; border-color: #f0d87a; }

/* ── 工具类 ── */
.text-muted { color: var(--muted-fg); }
.text-accent { color: var(--accent); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .78rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.w-full { width: 100%; }

/* ── 响应式 ── */
@media (max-width: 768px) {
  .container { padding: 1rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; }
}
