/**
 * ResumeCraft - 极简简历创作平台
 * 路径: /public/assets/css/styles.css
 * 功能: 全局样式系统、响应式布局、动画效果
 * 依赖: Font Awesome 6.4 CDN
 * 优先级: main
 * 设计范式: 工具/应用类 - 极简、高效、专业
 */

:root {
  /* ===== 系统配置 ===== */
  --sys-type: tool;
  --theme-mode: light;
  --motion-level: standard;

  /* ===== 品牌色 ===== */
  --brand-primary: #1e40af;
  --brand-secondary: #3b82f6;
  --brand-accent: #06b6d4;

  /* ===== 语义色彩 ===== */
  --bg-default: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-hover: #f1f5f9;
  --fg-default: #0f172a;
  --fg-muted: #64748b;
  --fg-inverse: #ffffff;
  --surface-default: #f8fafc;
  --surface-elevated: #ffffff;
  --surface-overlay: rgba(15, 23, 42, 0.5);
  --border-default: #e2e8f0;
  --border-hover: #94a3b8;
  --border-active: var(--brand-primary);
  --status-success: #10B981;
  --status-warning: #F59E0B;
  --status-error: #EF4444;
  --status-info: var(--brand-accent);

  /* ===== 组件色 ===== */
  --color-primary: var(--brand-primary);
  --color-primary-fg: var(--fg-inverse);
  --color-secondary: var(--surface-elevated);
  --color-secondary-fg: var(--fg-default);
  --color-accent: var(--brand-accent);
  --color-accent-fg: var(--fg-inverse);
  --color-muted: var(--surface-default);
  --color-muted-fg: var(--fg-muted);
  --color-card: var(--surface-elevated);
  --color-card-fg: var(--fg-default);
  --color-border: var(--border-default);
  --color-input: var(--border-default);
  --color-ring: var(--brand-accent);
  --color-destructive: var(--status-error);
  --color-destructive-fg: var(--fg-inverse);

  /* ===== 渐变 ===== */
  --gradient-primary: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  --gradient-surface: linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface-default) 100%);
  --gradient-mesh:
    radial-gradient(at 0% 0%, color-mix(in srgb, var(--brand-primary) 15%, transparent) 0%, transparent 50%),
    radial-gradient(at 100% 0%, color-mix(in srgb, var(--brand-accent) 10%, transparent) 0%, transparent 50%);

  /* ===== 排版 ===== */
  --font-sans: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  --text-hero: clamp(2rem, 6vw, 4rem);
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-black: 900;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

  /* ===== 空间 ===== */
  --density: 1;
  --space-0: 0;
  --space-1: calc(0.25rem * var(--density));
  --space-2: calc(0.5rem * var(--density));
  --space-3: calc(0.75rem * var(--density));
  --space-4: calc(1rem * var(--density));
  --space-5: calc(1.25rem * var(--density));
  --space-6: calc(1.5rem * var(--density));
  --space-8: calc(2rem * var(--density));
  --space-10: calc(2.5rem * var(--density));
  --space-12: calc(3rem * var(--density));
  --space-16: calc(4rem * var(--density));
  --space-20: calc(5rem * var(--density));
  --space-24: calc(6rem * var(--density));

  /* ===== 导航栏高度配置 ===== */
  --nav-height-mobile: 3.5rem;
  --nav-height-tablet: 4rem;
  --nav-height-desktop: 4.5rem;
  --nav-height: var(--nav-height-mobile);

  /* 安全顶部间距 */
  --safe-top: calc(var(--nav-height) + var(--space-4));
  --safe-top-tablet: calc(var(--nav-height-tablet) + var(--space-6));
  --safe-top-desktop: calc(var(--nav-height-desktop) + var(--space-8));

  /* ===== 形状 ===== */
  --radius-none: 0;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
  --radius-full: 9999px;

  /* ===== 动效 ===== */
  --duration-instant: 0ms;
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
  --duration-slower: 800ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);

  /* ===== 阴影 ===== */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --glow-sm: 0 0 20px color-mix(in srgb, var(--brand-primary) 20%, transparent);
  --glow-md: 0 0 40px color-mix(in srgb, var(--brand-primary) 30%, transparent);
  --glow-lg: 0 0 60px color-mix(in srgb, var(--brand-primary) 40%, transparent);

  /* ===== 层级 ===== */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-popover: 500;
  --z-tooltip: 600;

  /* ===== 动态导航配置 ===== */
  --nav-item-count: 4;
  --nav-stagger-delay: 50ms;
  --nav-link-max-width: 200px;
  --dropdown-max-height: 600px;
}

/* ===== 深色模式适配 ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-default: #0f172a;
    --bg-subtle: #1e293b;
    --bg-hover: #334155;
    --fg-default: #f8fafc;
    --fg-muted: #94a3b8;
    --surface-default: #1e293b;
    --surface-elevated: #334155;
    --border-default: #334155;
    --border-hover: #475569;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.4);
  }
}

/* ===== 减弱动画 ===== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0.01ms;
    --duration-normal: 0.01ms;
    --duration-slow: 0.01ms;
    --duration-slower: 0.01ms;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--safe-top);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-default);
  color: var(--fg-default);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* ===== 页面容器 ===== */
.page-wrapper {
  padding-top: var(--nav-height);
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* ===== 按钮系统 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-fast) var(--ease-default);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-primary-fg);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--glow-sm);
  filter: brightness(1.05);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-secondary-fg);
  border-color: var(--color-border);
}

.btn--secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-accent-fg);
}

.btn--accent:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: transparent;
  color: var(--fg-default);
  border-color: var(--color-border);
}

.btn--ghost:hover {
  background: var(--surface-default);
  border-color: var(--border-hover);
}

.btn--destructive {
  background: var(--color-destructive);
  color: var(--color-destructive-fg);
}

.btn--destructive:hover {
  filter: brightness(1.1);
}

.btn--sm {
  min-height: 36px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn--lg {
  min-height: 52px;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}

/* ===== 卡片系统 ===== */
.card {
  background: var(--color-card);
  color: var(--color-card-fg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--duration-normal) var(--ease-default);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.card--hoverable {
  cursor: pointer;
}

.card--hoverable:hover {
  transform: translateY(-2px);
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  height: var(--nav-height);
  background: color-mix(in srgb, var(--bg-default) 95%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
}

.navbar__container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__brand {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-primary);
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar__brand > i {
  color: var(--brand-accent);
}

/* 移动端菜单按钮 */
.navbar__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--fg-default);
  font-size: var(--text-xl);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-default);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.navbar__toggle:hover {
  background: var(--surface-default);
}

.navbar__toggle:active {
  transform: scale(0.95);
}

/* 导航菜单容器 - 移动端 */
.navbar__nav {
  display: flex;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  min-height: calc(100vh - var(--nav-height));
  max-height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  background: var(--bg-default);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4);
  flex-direction: column;
  gap: var(--space-2);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition:
    opacity var(--duration-normal) var(--ease-default),
    visibility var(--duration-normal) var(--ease-default),
    transform var(--duration-normal) var(--ease-out);
  pointer-events: none;
  z-index: var(--z-dropdown);
}

.navbar__nav--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: all;
}

/* 动态导航项 */
.navbar__item {
  width: 100%;
  opacity: 0;
  transform: translateX(-10px);
  transition:
    opacity var(--duration-fast) var(--ease-default) calc(var(--item-index, 0) * var(--nav-stagger-delay)),
    transform var(--duration-fast) var(--ease-default) calc(var(--item-index, 0) * var(--nav-stagger-delay));
}

.navbar__nav--open .navbar__item {
  opacity: 1;
  transform: translateX(0);
}

.navbar__item:nth-child(1) { --item-index: 0; }
.navbar__item:nth-child(2) { --item-index: 1; }
.navbar__item:nth-child(3) { --item-index: 2; }
.navbar__item:nth-child(4) { --item-index: 3; }
.navbar__item:nth-child(5) { --item-index: 4; }
.navbar__item:nth-child(6) { --item-index: 5; }
.navbar__item:nth-child(7) { --item-index: 6; }
.navbar__item:nth-child(8) { --item-index: 7; }

/* 导航链接 */
.navbar__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  color: var(--fg-default);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-default);
  min-height: 48px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar__link:hover, .navbar__link--active {
  color: var(--color-primary);
  background: var(--surface-default);
}

.navbar__icon {
  width: 20px;
  text-align: center;
  color: var(--fg-muted);
  transition: color var(--duration-fast) var(--ease-default);
  flex-shrink: 0;
}

.navbar__link:hover .navbar__icon,
.navbar__link--active .navbar__icon {
  color: var(--color-primary);
}

/* CTA按钮容器 */
.navbar__cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity var(--duration-fast) var(--ease-default) calc(var(--nav-item-count) * var(--nav-stagger-delay)),
    transform var(--duration-fast) var(--ease-default) calc(var(--nav-item-count) * var(--nav-stagger-delay));
}

.navbar__nav--open .navbar__cta {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 输入框系统 ===== */
.input, .textarea, .select {
  width: 100%;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-default);
  border: 1px solid var(--color-input);
  border-radius: var(--radius-lg);
  color: var(--fg-default);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  outline: none;
  transition: all var(--duration-fast) var(--ease-default);
  font-family: var(--font-sans);
}

.input::placeholder, .textarea::placeholder {
  color: var(--fg-muted);
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--color-ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-ring) 15%, transparent);
}

.input:disabled, .textarea:disabled, .select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface-default);
}

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

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* ===== 表单标签 ===== */
.label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--fg-default);
  margin-bottom: var(--space-2);
}

.label--required::after {
  content: ' *';
  color: var(--status-error);
}

/* ===== 表单组 ===== */
.form-group {
  margin-bottom: var(--space-4);
}

.form-section {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.form-section:last-child {
  border-bottom: none;
}

.form-section__title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--fg-default);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.form-section__title i {
  color: var(--brand-accent);
}

/* ===== 动态列表项（工作经历、教育背景等）===== */
.list-item {
  background: var(--surface-default);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  position: relative;
  transition: all var(--duration-fast) var(--ease-default);
}

.list-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.list-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.list-item__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--fg-muted);
}

.list-item__actions {
  display: flex;
  gap: var(--space-2);
}

.list-item__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.list-item__btn:hover {
  background: var(--bg-hover);
  color: var(--color-primary);
}

.list-item__btn--delete:hover {
  color: var(--status-error);
}

/* ===== 添加按钮 ===== */
.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.btn-add:hover {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
  background: color-mix(in srgb, var(--brand-accent) 5%, transparent);
}

/* ===== 简历预览区域 ===== */
.preview-container {
  background: var(--bg-subtle);
  min-height: calc(100vh - var(--nav-height));
  padding: var(--space-6) var(--space-4);
}

.preview-paper {
  background: var(--bg-default);
  max-width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 20mm;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-sm);
}

/* ===== 打印样式 ===== */
@media print {
  .navbar, .btn, .form-section__actions, .list-item__actions, .btn-add {
    display: none !important;
  }

  .page-wrapper {
    padding-top: 0;
  }

  .preview-container {
    background: white;
    padding: 0;
  }

  .preview-paper {
    box-shadow: none;
    max-width: 100%;
    padding: 0;
  }

  body {
    background: white;
  }
}

/* ===== 弹窗 ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-default);
}

.modal-backdrop--open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--color-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-6);
  max-width: 90%;
  width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-bounce);
}

.modal-backdrop--open .modal {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.modal__header {
  margin-bottom: var(--space-4);
}

.modal__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* ===== Toast 提示 ===== */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-popover);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  background: var(--surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 200px;
  animation: slide-in-right var(--duration-normal) var(--ease-out);
}

.toast--success {
  border-left: 4px solid var(--status-success);
}

.toast--error {
  border-left: 4px solid var(--status-error);
}

.toast--info {
  border-left: 4px solid var(--status-info);
}

.toast__icon {
  font-size: var(--text-lg);
}

.toast--success .toast__icon {
  color: var(--status-success);
}

.toast--error .toast__icon {
  color: var(--status-error);
}

.toast--info .toast__icon {
  color: var(--status-info);
}

/* ===== 页脚 ===== */
.footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) var(--space-4);
  margin-top: auto;
}

.footer__container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer__text {
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

/* ===== 动画关键帧 ===== */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.9); }
  70% { transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== 工具类 ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

/* ===== 响应式优化（平板及以上）===== */
@media (min-width: 768px) {
  :root {
    --nav-height: var(--nav-height-tablet);
    --safe-top: var(--safe-top-tablet);
    --nav-link-max-width: 250px;
  }

  .navbar {
    padding: 0 var(--space-6);
  }

  .navbar__toggle {
    display: none;
  }

  .navbar__nav {
    display: flex !important;
    position: static;
    flex-direction: row;
    background: transparent;
    backdrop-filter: none;
    border: none;
    padding: 0;
    gap: var(--space-6);
    margin-left: auto;
    margin-right: var(--space-6);
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: all;
    width: auto;
    min-height: auto;
    max-height: none;
    overflow-y: visible;
  }

  .navbar__item {
    width: auto;
    opacity: 1;
    transform: none;
    transition: none;
    --item-index: 0 !important;
  }

  .navbar__link {
    width: auto;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    min-height: auto;
  }

  .navbar__cta {
    display: flex;
    flex-direction: row;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    opacity: 1;
    transform: none;
    gap: var(--space-3);
  }

  .container {
    padding: 0 var(--space-6);
  }

  .btn {
    min-height: 40px;
  }

  .input, .textarea, .select {
    min-height: 40px;
  }
}

/* ===== 响应式优化（桌面端）===== */
@media (min-width: 1024px) {
  :root {
    --nav-height: var(--nav-height-desktop);
    --safe-top: var(--safe-top-desktop);
  }

  .navbar {
    padding: 0 var(--space-8);
  }

  .navbar__nav {
    gap: var(--space-8);
  }

  .container {
    padding: 0 var(--space-8);
  }

  .preview-container {
    padding: var(--space-8);
  }
}

/* ===== 小屏手机优化 ===== */
@media (max-width: 767px) {
  :root {
    --density: 0.95;
    --nav-link-max-width: 150px;
    --nav-stagger-delay: 30ms;
  }

  .navbar__item--has-dropdown .navbar__dropdown {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--duration-normal) var(--ease-default);
    margin-left: var(--space-4);
    margin-top: var(--space-2);
  }

  .navbar__item--has-dropdown.expanded .navbar__dropdown {
    grid-template-rows: 1fr;
  }

  .navbar__dropdown-inner {
    overflow: hidden;
    min-height: 0;
  }

  .navbar__dropdown-item {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    color: var(--fg-default);
    text-decoration: none;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast) var(--ease-default);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .navbar__dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--color-primary);
  }

  .hero__description {
    font-size: var(--text-base);
  }

  .modal {
    width: 95%;
    padding: var(--space-4);
  }

  .preview-paper {
    padding: 15mm;
  }
}

/* ===== 导航项文字过长处理 ===== */
.navbar__link[title] {
  position: relative;
}

/* ===== 二级菜单相关（PC端）===== */
.navbar__item--has-dropdown {
  position: relative;
}

@media (min-width: 768px) {
  .navbar__item--has-dropdown {
    padding-bottom: 20px;
    margin-bottom: -20px;
  }

  .navbar__item--has-dropdown .navbar__dropdown {
    display: grid;
    grid-template-rows: 0fr;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      grid-template-rows var(--duration-fast) var(--ease-out),
      opacity var(--duration-fast) var(--ease-out),
      visibility var(--duration-fast) var(--ease-out),
      transform var(--duration-fast) var(--ease-out),
      padding var(--duration-fast) var(--ease-out);
    z-index: var(--z-dropdown);
    pointer-events: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .navbar__item--has-dropdown .navbar__dropdown--right {
    left: auto;
    right: 0;
  }

  .navbar__dropdown-inner {
    overflow: hidden;
    min-height: 0;
  }

  .navbar__item--has-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
    z-index: var(--z-dropdown);
    pointer-events: auto;
  }

  .navbar__item--has-dropdown:hover .navbar__dropdown,
  .navbar__item--has-dropdown:focus-within .navbar__dropdown {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    padding: var(--space-2);
  }

  .navbar__dropdown-item {
    display: block;
    padding: var(--space-3) var(--space-4);
    color: var(--fg-default);
    text-decoration: none;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-default);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
  }

  .navbar__dropdown-item:hover,
  .navbar__dropdown-item:focus {
    background: var(--bg-hover);
    color: var(--color-primary);
  }
}

/* ===== 下拉菜单Max-Height备选方案 ===== */
.navbar__dropdown--maxheight {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-fast) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out),
              visibility var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              padding var(--duration-fast) var(--ease-out);
}

.navbar__item--has-dropdown:hover .navbar__dropdown--maxheight,
.navbar__item--has-dropdown:focus-within .navbar__dropdown--maxheight {
  max-height: var(--dropdown-max-height);
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  padding: var(--space-2);
}

/* ===== 内容区域底部间距 ===== */
.main-content {
  padding-bottom: 60px;
}

/* ===== 右上角操作栏 ===== */
.action-bar {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-sticky);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (min-width: 768px) {
  .action-bar {
    position: static;
    top: auto;
    right: auto;
    margin-left: auto;
  }
}

/* ===== 简历列表页 ===== */
.resume-list {
  padding: var(--space-6) var(--space-4);
}

.resume-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: all var(--duration-normal) var(--ease-default);
  cursor: pointer;
}

.resume-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.resume-card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--fg-default);
  margin-bottom: var(--space-2);
}

.resume-card__meta {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin-bottom: var(--space-4);
}

.resume-card__actions {
  display: flex;
  gap: var(--space-2);
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-4);
}

.empty-state__icon {
  font-size: 4rem;
  color: var(--fg-muted);
  margin-bottom: var(--space-4);
}

.empty-state__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--fg-default);
  margin-bottom: var(--space-2);
}

.empty-state__desc {
  font-size: var(--text-base);
  color: var(--fg-muted);
  margin-bottom: var(--space-6);
}

/* ===== 编辑页布局 ===== */
.editor-layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-height));
}

@media (min-width: 1024px) {
  .editor-layout {
    flex-direction: row;
  }

  .editor-form {
    flex: 1;
    max-width: 600px;
    padding: var(--space-6);
    overflow-y: auto;
    height: calc(100vh - var(--nav-height));
  }

  .editor-preview {
    flex: 1;
    background: var(--bg-subtle);
    padding: var(--space-6);
    overflow-y: auto;
    height: calc(100vh - var(--nav-height));
  }
}

/* ===== 网格布局 ===== */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}