/* app.css — 极简AI 应用样式 */

/* ==============================
   HEADER
   ============================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
}
.header-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
}
.logo svg { flex-shrink: 0; }
.logo-text {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.logo-accent { color: var(--color-primary); }

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.nav-link:hover { color: var(--color-text); }

.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
}
.theme-toggle:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}
/* Show/hide sun/moon based on theme */
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
/* fallback before JS sets theme */
.icon-sun { display: none; }
.icon-moon { display: block; }

.header-cta {
  text-decoration: none;
}

/* ==============================
   HERO
   ============================== */
.hero {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-6) clamp(var(--space-10), 6vw, var(--space-20));
  text-align: center;
}
.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 500;
  margin-bottom: var(--space-6);
}
.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}
.hero-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.8;
  max-width: 540px;
  margin: 0 auto var(--space-8);
}
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.hero-cta { text-decoration: none; }
.hero-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ==============================
   FEATURES
   ============================== */
.features {
  padding: clamp(var(--space-10), 6vw, var(--space-20)) var(--space-6);
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.features-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}
.feature-card {
  padding: var(--space-6);
}
.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}
.feature-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.feature-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ==============================
   SOCIAL PROOF
   ============================== */
.social-proof {
  padding: clamp(var(--space-10), 6vw, var(--space-16)) var(--space-6);
  text-align: center;
}
.social-proof-inner {
  max-width: var(--content-default);
  margin: 0 auto;
}
.social-stat {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.social-stat strong { color: var(--color-text); }
.social-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.company-tag {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.company-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}
.company-sep {
  color: var(--color-text-faint);
}

/* ==============================
   HOW IT WORKS
   ============================== */
.how-it-works {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-6);
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
}
.how-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}
.section-title {
  font-size: var(--text-xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: clamp(var(--space-8), 5vw, var(--space-16));
  letter-spacing: -0.02em;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}
.step-num {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.3;
  margin-bottom: var(--space-3);
  font-variant-numeric: tabular-nums;
}
.step-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.step-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ==============================
   PRICING
   ============================== */
.pricing-teaser {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-6);
  border-top: 1px solid var(--color-divider);
}
.pricing-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.pricing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: clamp(var(--space-8), 5vw, var(--space-12));
}
.pricing-lead {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-8);
  letter-spacing: -0.01em;
}
.pricing-tiers {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
}
.tier {
  flex: 1;
  max-width: 200px;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  position: relative;
}
.tier-pro {
  border: 2px solid var(--color-primary);
  background: var(--color-primary-subtle);
}
.tier-badge {
  position: absolute;
  top: -10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}
.tier-name {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}
.tier-price {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}
.tier-period {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-muted);
}
.tier-detail {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ==============================
   ABOUT SECTION
   ============================== */
.about-section {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-6);
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
}
.about-inner {
  max-width: 640px;
  margin: 0 auto;
}
.about-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.founder-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.founder-avatar {
  flex-shrink: 0;
}
.founder-avatar svg {
  display: block;
}
.founder-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.founder-name {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.founder-role {
  font-size: var(--text-sm);
  color: var(--color-primary);
  font-weight: 500;
}
.about-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.8;
}
.about-mission {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.8;
  padding: var(--space-4);
  background: var(--color-primary-subtle);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ==============================
   FOOTER
   ============================== */
.footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-6);
}
.footer-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.footer-brand {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.footer-pplx {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
.footer-pplx:hover {
  color: var(--color-text-muted);
}

/* ==============================
   BUILDER LAYOUT
   ============================== */
.builder-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: calc(100dvh - 53px);
  overflow: hidden;
}
.builder-sidebar {
  border-right: 1px solid var(--color-divider);
  background: var(--color-surface);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sidebar-content {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.sidebar-header {
  margin-bottom: var(--space-1);
}
.sidebar-title {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}
.sidebar-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.optional {
  font-weight: 400;
  color: var(--color-text-faint);
  letter-spacing: 0;
}

.generate-btn {
  width: 100%;
}
.load-sample-btn {
  width: 100%;
}

.builder-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
}

/* Preview Toolbar */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface);
  flex-shrink: 0;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.toolbar-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}
.template-pills {
  display: flex;
  gap: var(--space-1);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: 2px;
}
.pill {
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
}
.pill:hover { color: var(--color-text); }
.pill.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

/* Preview Container */
.preview-container {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--color-surface-2);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  gap: var(--space-3);
}
.empty-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}
.empty-desc {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  max-width: 320px;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  gap: var(--space-4);
}
.loader {
  width: 200px;
  height: 4px;
  background: var(--color-surface-offset-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.loader-bar {
  width: 40%;
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  animation: loading 1.5s ease-in-out infinite;
}
@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.loading-text {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.loading-sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* Resume Wrapper */
.resume-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}
.resume-page {
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  border-radius: 2px;
  overflow: hidden;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  transform-origin: top center;
}

/* ==============================
   RESUME TEMPLATE: 经典
   ============================== */
.resume-classic {
  padding: 44px 48px;
}
.resume-classic .resume-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid #2563eb;
}
.resume-classic .resume-header-top {
  display: flex;
  align-items: center;
  gap: 18px;
}
.resume-classic .resume-header-text {
  flex: 1;
}
.resume-classic .resume-photo-placeholder {
  flex-shrink: 0;
}
.resume-classic .resume-name {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #111827;
  margin-bottom: 4px;
}
.resume-classic .resume-title-line {
  font-size: 13px;
  color: #2563eb;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.resume-classic .resume-contact-line,
.resume-classic .resume-target-line {
  font-size: 11.5px;
  color: #6b7280;
  line-height: 1.6;
}
.resume-classic .resume-section {
  margin-bottom: 18px;
}
.resume-classic .resume-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #111827;
  border-bottom: 1px solid #d1d5db;
  padding-bottom: 4px;
  margin-bottom: 10px;
}
.resume-classic .resume-summary {
  font-size: 12px;
  line-height: 1.7;
  color: #374151;
}
.resume-classic .resume-job {
  margin-bottom: 14px;
}
.resume-classic .resume-job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}
.resume-classic .resume-company {
  font-size: 12.5px;
  font-weight: 600;
  color: #111827;
}
.resume-classic .resume-dates {
  font-size: 11.5px;
  color: #6b7280;
}
.resume-classic .resume-role {
  font-size: 12px;
  color: #2563eb;
  font-weight: 500;
  margin-bottom: 5px;
}
.resume-classic .resume-bullets {
  list-style: none;
  padding: 0;
}
.resume-classic .resume-bullets li {
  font-size: 12px;
  line-height: 1.65;
  color: #374151;
  padding-left: 14px;
  position: relative;
  margin-bottom: 2px;
}
.resume-classic .resume-bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #2563eb;
}
.resume-classic .resume-skills-list {
  font-size: 12px;
  color: #374151;
  line-height: 1.7;
}
.resume-classic .resume-edu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.resume-classic .resume-edu-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #111827;
}
.resume-classic .resume-edu-detail {
  font-size: 12px;
  color: #4b5563;
}

/* ==============================
   RESUME TEMPLATE: 现代
   ============================== */
.resume-modern {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 297mm;
}
.resume-modern .resume-sidebar {
  background: #1e293b;
  color: #e5e7eb;
  padding: 36px 20px;
}
.resume-modern .resume-photo-placeholder-modern {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}
.resume-modern .resume-name {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  line-height: 1.3;
  text-align: center;
}
.resume-modern .resume-title-line {
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  text-align: center;
}
.resume-modern .sidebar-section {
  margin-bottom: 20px;
}
.resume-modern .sidebar-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #60a5fa;
  margin-bottom: 8px;
}
.resume-modern .sidebar-contact {
  font-size: 11px;
  color: #d1d5db;
  line-height: 1.7;
}
.resume-modern .sidebar-skills {
  list-style: none;
  padding: 0;
}
.resume-modern .sidebar-skills li {
  font-size: 11px;
  color: #d1d5db;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.resume-modern .sidebar-edu {
  font-size: 11px;
  color: #d1d5db;
  line-height: 1.5;
}
.resume-modern .sidebar-edu-school {
  font-weight: 600;
  color: #e5e7eb;
}
.resume-modern .resume-main {
  padding: 36px 32px;
}
.resume-modern .resume-section {
  margin-bottom: 20px;
}
.resume-modern .resume-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #2563eb;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid #2563eb;
}
.resume-modern .resume-summary {
  font-size: 12px;
  line-height: 1.7;
  color: #374151;
}
.resume-modern .resume-job {
  margin-bottom: 14px;
}
.resume-modern .resume-job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}
.resume-modern .resume-company {
  font-size: 12.5px;
  font-weight: 600;
  color: #111827;
}
.resume-modern .resume-dates {
  font-size: 11px;
  color: #6b7280;
}
.resume-modern .resume-role {
  font-size: 11.5px;
  color: #6b7280;
  margin-bottom: 5px;
}
.resume-modern .resume-bullets {
  list-style: none;
  padding: 0;
}
.resume-modern .resume-bullets li {
  font-size: 11.5px;
  line-height: 1.65;
  color: #374151;
  padding-left: 14px;
  position: relative;
  margin-bottom: 2px;
}
.resume-modern .resume-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #2563eb;
  font-size: 11px;
}

/* ==============================
   RESUME TEMPLATE: 极简
   ============================== */
.resume-minimal {
  padding: 48px 52px;
}
.resume-minimal .resume-header {
  margin-bottom: 28px;
}
.resume-minimal .resume-header-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.resume-minimal .resume-photo-placeholder-minimal {
  flex-shrink: 0;
}
.resume-minimal .resume-name {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: #111827;
  margin-bottom: 3px;
}
.resume-minimal .resume-title-line {
  font-size: 11.5px;
  color: #9ca3af;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.resume-minimal .resume-contact-line-minimal {
  font-size: 11px;
  color: #9ca3af;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
}
.resume-minimal .resume-section {
  margin-bottom: 20px;
}
.resume-minimal .resume-section-title {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #9ca3af;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e5e7eb;
}
.resume-minimal .resume-summary {
  font-size: 12px;
  line-height: 1.75;
  color: #4b5563;
}
.resume-minimal .resume-job {
  margin-bottom: 16px;
}
.resume-minimal .resume-job-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}
.resume-minimal .resume-company {
  font-size: 12.5px;
  font-weight: 500;
  color: #111827;
}
.resume-minimal .resume-dates {
  font-size: 11px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}
.resume-minimal .resume-role {
  font-size: 11.5px;
  color: #6b7280;
  margin-bottom: 5px;
}
.resume-minimal .resume-bullets {
  list-style: none;
  padding: 0;
}
.resume-minimal .resume-bullets li {
  font-size: 11.5px;
  line-height: 1.7;
  color: #4b5563;
  padding-left: 16px;
  position: relative;
  margin-bottom: 2px;
}
.resume-minimal .resume-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: #d1d5db;
  font-size: 11px;
}
.resume-minimal .resume-skills-list {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.8;
}
.resume-minimal .resume-skill-tag {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  font-size: 11px;
  color: #4b5563;
  margin: 2px 4px 2px 0;
}
.resume-minimal .resume-edu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.resume-minimal .resume-edu-name {
  font-size: 12.5px;
  font-weight: 500;
  color: #111827;
}
.resume-minimal .resume-edu-detail {
  font-size: 12px;
  color: #6b7280;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 1024px) {
  .builder-layout {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 768px) {
  .header-cta { display: none; }
  
  .features-inner { grid-template-columns: 1fr; gap: var(--space-4); }
  .steps-grid { grid-template-columns: 1fr; gap: var(--space-6); }
  
  .pricing-tiers { flex-direction: column; align-items: center; }
  .tier { max-width: 280px; width: 100%; }
  
  .footer-inner { flex-direction: column; gap: var(--space-2); text-align: center; }
  
  .builder-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: calc(100dvh - 53px);
  }
  .builder-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--color-divider);
    max-height: 50vh;
    overflow-y: auto;
  }
  .builder-main {
    min-height: 60vh;
  }
  .preview-container {
    padding: var(--space-4);
  }
  .resume-page {
    width: 100%;
    min-height: auto;
    font-size: 11px;
  }
  .template-pills { display: none; }
  .toolbar-left { gap: var(--space-2); }
  
  .hero-title { letter-spacing: -0.02em; }
  .social-logos { gap: var(--space-2); }

  .founder-info {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .resume-classic { padding: 24px 20px; }
  .resume-modern { grid-template-columns: 1fr; }
  .resume-modern .resume-sidebar { padding: 20px; }
  .resume-modern .resume-main { padding: 20px; }
  .resume-minimal { padding: 24px 20px; }
}

/* ==============================
   VIEW TRANSITIONS
   ============================== */
.view {
  animation: fadeIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==============================
   SCROLLBAR STYLING
   ============================== */
.builder-sidebar::-webkit-scrollbar,
.preview-container::-webkit-scrollbar {
  width: 6px;
}
.builder-sidebar::-webkit-scrollbar-track,
.preview-container::-webkit-scrollbar-track {
  background: transparent;
}
.builder-sidebar::-webkit-scrollbar-thumb,
.preview-container::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}
.builder-sidebar::-webkit-scrollbar-thumb:hover,
.preview-container::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
}

/* ============ AI Thinking Panel ============ */
.ai-thinking-panel {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.ai-thinking-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.ai-thinking-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  flex-shrink: 0;
}

.ai-thinking-icon svg {
  stroke: #fff;
}

.ai-thinking-title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

.ai-thinking-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ai-thinking-dots span {
  width: 5px;
  height: 5px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: thinking-dot 1.4s infinite;
}

.ai-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

.ai-thinking-body {
  padding: 16px 18px;
  max-height: 320px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.ai-thinking-content {
  font-size: 13px;
  line-height: 1.75;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
}

.ai-thinking-content .cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: #667eea;
  margin-left: 2px;
  animation: blink-cursor 0.8s infinite;
  vertical-align: text-bottom;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.ai-thinking-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.ai-phase-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.ai-phase {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.35;
  transition: opacity 0.4s, transform 0.3s;
}

.ai-phase.active {
  opacity: 1;
}

.ai-phase.done {
  opacity: 0.7;
}

.ai-phase span {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.ai-phase.active span {
  color: #667eea;
  font-weight: 600;
}

.ai-phase.done span {
  color: #22c55e;
}

.phase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-faint);
  transition: all 0.4s;
  flex-shrink: 0;
}

.ai-phase.active .phase-dot {
  background: #667eea;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
  animation: pulse-dot 1.5s infinite;
}

.ai-phase.done .phase-dot {
  background: #22c55e;
  box-shadow: none;
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 4px rgba(102, 126, 234, 0.3); }
  50% { box-shadow: 0 0 12px rgba(102, 126, 234, 0.6); }
}

.ai-phase-line {
  width: 32px;
  height: 2px;
  background: var(--color-border);
  margin: 0 8px;
  transition: background 0.4s;
}

.ai-phase-line.done {
  background: #22c55e;
}

/* Scrollbar for thinking body */
.ai-thinking-body::-webkit-scrollbar {
  width: 4px;
}
.ai-thinking-body::-webkit-scrollbar-track {
  background: transparent;
}
.ai-thinking-body::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

/* Loading state layout override */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ============ AI Chat Panel (Fixed Right Side) ============ */
.preview-container.with-chat {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  padding: 0;
}

.preview-container.with-chat .resume-wrapper {
  padding: var(--space-6);
  overflow-y: auto;
}

.ai-chat-panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--color-divider);
  background: var(--color-surface);
  height: 100%;
  overflow: hidden;
}

.ai-chat-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-divider);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  flex-shrink: 0;
}

.ai-chat-panel-header > svg {
  color: #667eea;
  flex-shrink: 0;
}

.ai-chat-panel-header > span {
  flex-shrink: 0;
}

/* Mode tabs */
.ai-chat-mode-tabs {
  display: flex;
  gap: 2px;
  margin-left: auto;
  background: var(--color-surface-2);
  border-radius: 6px;
  padding: 2px;
}

.mode-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: none;
  background: transparent;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-faint);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mode-tab svg {
  flex-shrink: 0;
}

.mode-tab:hover {
  color: var(--color-text-muted);
}

.mode-tab.active {
  background: var(--color-surface);
  color: #667eea;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.mode-tab.active svg {
  stroke: #667eea;
}

.ai-chat-panel-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 11.5px;
  color: var(--color-text-faint);
  background: var(--color-surface-2);
  flex-shrink: 0;
}

.ai-chat-panel-tip svg {
  flex-shrink: 0;
  color: var(--color-text-faint);
}

/* Selected text display */
.ai-chat-selected {
  position: relative;
  margin: 8px 12px 0;
  padding: 8px 28px 8px 10px;
  background: #667eea10;
  border: 1px solid #667eea30;
  border-radius: 8px;
  flex-shrink: 0;
}

.ai-chat-selected-label {
  font-size: 10px;
  font-weight: 600;
  color: #667eea;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.ai-chat-selected-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  max-height: 60px;
  overflow-y: auto;
  word-break: break-word;
}

.ai-chat-selected-clear {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.ai-chat-selected-clear:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

/* Chat history */
.ai-chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.ai-chat-msg {
  font-size: 12px;
  line-height: 1.6;
  padding: 6px 10px;
  border-radius: 8px;
  max-width: 95%;
  word-break: break-word;
  white-space: pre-wrap;
}

.ai-chat-msg.user {
  background: #667eea;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.ai-chat-msg.ai {
  background: var(--color-bg);
  color: var(--color-text-secondary);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid var(--color-border);
}

.ai-chat-msg.ai.loading {
  color: var(--color-text-faint);
  font-style: italic;
}

/* Chat input */
.ai-chat-panel .ai-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--color-divider);
  flex-shrink: 0;
  background: var(--color-surface);
}

#ai-chat-input {
  flex: 1;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  font-size: 12.5px;
  color: var(--color-text);
  outline: none;
  padding: 7px 10px;
  font-family: inherit;
  border-radius: 8px;
  transition: border-color 0.2s;
}

#ai-chat-input:focus {
  border-color: #667eea;
}

#ai-chat-input::placeholder {
  color: var(--color-text-faint);
  font-size: 12px;
}

#ai-chat-send {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: #667eea;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}

#ai-chat-send:hover { background: #5a6fd6; }
#ai-chat-send:active { transform: scale(0.95); }
#ai-chat-send:disabled {
  background: var(--color-text-faint);
  cursor: not-allowed;
  transform: none;
}
#ai-chat-send svg { stroke: #fff; }

/* Resume text selection highlight */
.resume-page ::selection {
  background: rgba(102, 126, 234, 0.25);
}

.ai-chat-history::-webkit-scrollbar { width: 4px; }
.ai-chat-history::-webkit-scrollbar-track { background: transparent; }
.ai-chat-history::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

@media (max-width: 1100px) {
  .preview-container.with-chat {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .ai-chat-panel {
    border-left: none;
    border-top: 1px solid var(--color-divider);
    max-height: 280px;
  }
}

/* Download menu */
#download-menu {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
#download-menu button {
  color: var(--color-text);
  transition: background 0.15s;
}
#download-menu button:hover {
  background: var(--color-surface-hover) !important;
}
