/* ===== 全局样式 ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(99,102,241,0.08);
  --shadow-lg: 0 12px 48px rgba(99,102,241,0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }

/* ===== Header ===== */
.header { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%); color: white; padding: 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-lg); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.logo span { opacity: 0.8; font-weight: 400; font-size: 14px; margin-left: 8px; }
.header-nav { display: flex; gap: 8px; }
.header-nav button { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2); color: white; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.header-nav button:hover, .header-nav button.active { background: rgba(255,255,255,0.25); }

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* ===== Cards ===== */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.card-header h2 { font-size: 18px; font-weight: 600; }
.card-header .icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.card-body { padding: 24px; }

/* ===== Steps ===== */
.steps { display: flex; gap: 0; margin-bottom: 32px; counter-reset: step; }
.step { flex: 1; text-align: center; position: relative; padding: 16px 8px; }
.step::before { counter-increment: step; content: counter(step); width: 32px; height: 32px; border-radius: 50%; background: var(--border); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin-bottom: 8px; transition: all 0.3s; }
.step.active::before { background: var(--primary); color: white; }
.step.done::before { background: var(--success); color: white; }
.step-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.step.active .step-label { color: var(--primary); font-weight: 600; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.form-hint { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
textarea, input[type="text"], input[type="email"], input[type="tel"] { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; transition: border-color 0.2s; background: white; }
textarea:focus, input:focus { outline: none; border-color: var(--primary); }
textarea { min-height: 160px; resize: vertical; }

/* ===== Upload Zone ===== */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 48px 24px; text-align: center; cursor: pointer; transition: all 0.2s; background: var(--bg); }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: #f0f0ff; }
.upload-zone .icon { font-size: 48px; margin-bottom: 16px; }
.upload-zone p { color: var(--text-muted); margin-top: 8px; }

/* ===== Badge ===== */
.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ===== Progress Bar ===== */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.progress-fill.high { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-fill.medium { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-fill.low { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ===== Grid ===== */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ===== Resume Display ===== */
.resume-section { margin-bottom: 24px; }
.resume-section h3 { font-size: 15px; font-weight: 600; color: var(--primary); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.exp-item { background: var(--bg); border-radius: 8px; padding: 16px; margin-bottom: 12px; border-left: 3px solid var(--primary); }
.exp-item .company { font-weight: 700; font-size: 16px; }
.exp-item .title { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.exp-item ul { margin: 0; padding-left: 20px; }
.exp-item li { font-size: 14px; color: var(--text); margin-bottom: 4px; }
.skill-tag { display: inline-block; background: #ede9fe; color: #7c3aed; padding: 4px 12px; border-radius: 20px; font-size: 13px; margin: 2px 4px 2px 0; }

/* ===== Match Results ===== */
.match-score { text-align: center; padding: 32px; }
.match-score .score { font-size: 72px; font-weight: 800; background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.match-score .label { font-size: 16px; color: var(--text-muted); margin-top: 8px; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.keyword-match { background: #d1fae5; color: #065f46; padding: 6px 14px; border-radius: 20px; font-size: 14px; }
.keyword-gap { background: #fee2e2; color: #991b1b; padding: 6px 14px; border-radius: 20px; font-size: 14px; }

/* ===== CV Preview ===== */
.cv-preview { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; max-width: 800px; margin: 0 auto; }
.cv-preview h1 { font-size: 28px; color: var(--text); border-bottom: 3px solid var(--primary); padding-bottom: 12px; margin-bottom: 24px; }
.cv-preview h2 { font-size: 18px; color: var(--primary); border-bottom: 2px solid var(--border); padding-bottom: 8px; margin: 24px 0 16px; }
.cv-preview h3 { font-size: 16px; font-weight: 700; margin: 16px 0 4px; }
.cv-preview .contact { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.cv-preview .exp-block { margin-bottom: 20px; }
.cv-preview .exp-block .company { font-weight: 700; font-size: 15px; }
.cv-preview .exp-block .title { color: var(--text-muted); font-size: 14px; }
.cv-preview .exp-block ul { margin: 8px 0; padding-left: 20px; }
.cv-preview .exp-block li { font-size: 14px; margin-bottom: 4px; }
.cv-preview blockquote { background: #fef3c7; border-left: 4px solid var(--warning); padding: 12px 16px; margin: 16px 0; border-radius: 0 8px 8px 0; font-size: 14px; color: #92400e; }
.cv-preview .skill-item { padding: 4px 0; font-size: 14px; }

/* ===== Loading ===== */
.loading { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); }
.loading::before { content: ""; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1e293b; color: white; padding: 16px 24px; border-radius: 12px; font-size: 14px; z-index: 9999; animation: slideIn 0.3s ease; box-shadow: var(--shadow-lg); }
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== Footer ===== */
.footer { text-align: center; padding: 32px; color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 48px; }

/* ===== Animations ===== */
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; gap: 12px; }
  .container { padding: 16px; }
  .card-body { padding: 16px; }
  .cv-preview { padding: 20px; }
}