/* CareerAI 全局样式 v1.0 */

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --accent: #7C3AED;
  --accent-light: #EDE9FE;
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --max-width: 900px;
  --nav-height: 60px;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== 导航栏 ===== */
.nav {
  background: white;
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links {
  display: flex;
  gap: 4px;
}
.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--primary-light);
  color: var(--primary);
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-user .btn {
  padding: 6px 16px;
  font-size: 0.85rem;
}
.nav-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
  padding: 4px;
}
.nav-bell .badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-bell .badge:empty { display: none; }

/* 手机端导航 */
.nav-mobile-tabs {
  display: none;
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    height: 56px;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .nav-mobile-tabs a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    gap: 2px;
  }
  .nav-mobile-tabs a .icon { font-size: 1.3rem; }
  .nav-mobile-tabs a.active { color: var(--primary); }
  body { padding-bottom: 56px; }
}

/* ===== 容器 ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px;
}
.container-sm { max-width: 500px; }
.container-lg { max-width: 1100px; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover:not(:disabled) { background: #6D28D9; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg); }
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: white;
  transition: border-color 0.15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
}
.form-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* 复选框 */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.checkbox-group input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.checkbox-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.checkbox-group label a {
  color: var(--primary);
  text-decoration: none;
}

/* ===== 标签 ===== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: #D1FAE5; color: #065F46; }
.tag-yellow { background: #FEF3C7; color: #92400E; }
.tag-red { background: #FEE2E2; color: #991B1B; }
.tag-purple { background: var(--accent-light); color: var(--accent); }

/* ===== 弹窗/Toast ===== */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
}
.toast-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.toast-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.toast-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #BFDBFE; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== 加载 ===== */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}
.loading-state .spinner { margin-bottom: 12px; }

/* ===== 分数/进度 ===== */
.score-circle {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--score), var(--border) var(--score));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.score-circle::before {
  content: '';
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: white;
}
.score-circle .value {
  position: relative;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* ===== 雷达图容器 ===== */
.radar-container {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}

/* ===== 进度条 ===== */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.fill-primary { background: var(--primary); }
.fill-accent { background: var(--accent); }
.fill-success { background: var(--success); }

/* ===== 步骤指示器 ===== */
.steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.step {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--border);
  color: var(--text-muted);
  transition: all 0.3s;
}
.step.active {
  background: var(--primary);
  color: white;
}
.step.done {
  background: var(--success);
  color: white;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .container { padding: 16px 12px; }
  .card { padding: 16px; }
  .btn { padding: 8px 16px; font-size: 0.85rem; }
  .nav-inner { padding: 0 12px; }
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-bold { font-weight: 600; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }
