/* ===== Variables ===== */
:root {
  --bg: #faf7f2;
  --surface: #f5f0e8;
  --card: #ffffff;
  --card-hover: #faf7f2;
  --border: rgba(0, 0, 0, 0.07);
  --text: #1c1917;
  --text-secondary: #78716c;
  --text-muted: #a8a29e;
  --accent: #d97706;
  --accent-dim: rgba(217, 119, 6, 0.08);
  --accent-border: rgba(217, 119, 6, 0.18);
  --font: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== Scroll Progress ===== */
#scrollProgress {
  position: fixed; top: 0; left: 0; height: 1.5px;
  background: var(--accent); width: 0%; z-index: 1001;
  transition: width 0.1s linear;
}

/* ===== Layout ===== */
.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100dvh;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== Sidebar ===== */
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  padding: 48px 32px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar-top { display: flex; flex-direction: column; gap: 24px; }

.avatar-frame {
  width: 140px; height: 140px; border-radius: 50%;
  overflow: hidden; border: 2px solid var(--accent-border);
  flex-shrink: 0;
}
.avatar-frame img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-name {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
}
.sidebar-role {
  font-size: 0.85rem; color: var(--accent); font-weight: 500;
  font-family: var(--mono);
}
.sidebar-tagline {
  font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6;
}

.sidebar-contact { display: flex; flex-direction: column; gap: 10px; }
.sidebar-contact a, .sidebar-contact span {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem; color: var(--text-secondary);
  transition: color var(--ease); padding: 6px 0;
}
.sidebar-contact a:hover { color: var(--accent); }
.sidebar-contact svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.6; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
  font-size: 0.82rem; color: var(--text-muted); font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius-sm);
  transition: all var(--ease);
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: var(--text); background: var(--accent-dim);
}

/* ===== Main Content ===== */
.main {
  padding: 64px 56px 48px;
  max-width: 780px;
}

/* ===== Hero Area ===== */
.hero-area {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.hero-greeting {
  font-size: 0.8rem; color: var(--accent);
  font-family: var(--mono); letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.hero-title {
  font-size: 2.4rem; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: 12px;
}
.hero-desc {
  font-size: 0.92rem; color: var(--text-secondary);
  max-width: 600px; line-height: 1.8;
}

/* ===== Sections ===== */
.section {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.section-header {
  margin-bottom: 28px;
}
.section-label {
  font-size: 0.72rem; color: var(--accent);
  font-family: var(--mono); letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 4px;
}
.section-title {
  font-size: 1.4rem; font-weight: 600;
  letter-spacing: -0.02em;
}

/* ===== About ===== */
.about-text p {
  font-size: 0.92rem; color: var(--text-secondary);
  line-height: 1.9; margin-bottom: 16px;
}
.about-text p:last-child { margin-bottom: 0; }

/* ===== Timeline ===== */
.timeline { display: flex; flex-direction: column; gap: 32px; }

.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
}

.timeline-date {
  font-size: 0.78rem; color: var(--text-muted);
  font-family: var(--mono); padding-top: 2px;
  text-align: right;
}

.timeline-content {
  position: relative;
  padding-left: 20px;
}
.timeline-content::before {
  content: '';
  position: absolute; left: 0; top: 8px;
  width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
}

.timeline-header {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 10px; margin-bottom: 2px;
}
.timeline-title {
  font-size: 1rem; font-weight: 600;
}
.timeline-company {
  font-size: 0.85rem; color: var(--accent);
}

.timeline-desc {
  font-size: 0.88rem; color: var(--text-secondary);
  line-height: 1.8; margin-top: 8px;
}
.timeline-desc li {
  margin-bottom: 4px; padding-left: 16px;
  position: relative;
}
.timeline-desc li::before {
  content: '';
  position: absolute; left: 0; top: 10px;
  width: 4px; height: 4px;
  background: var(--text-muted); border-radius: 50%;
}

.timeline-tags {
  display: flex; flex-wrap: wrap;
  gap: 5px; margin-top: 10px;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.75rem; font-weight: 500;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 100px;
}

/* ===== Education ===== */
.edu-row {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 24px;
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border);
  max-width: 520px;
}
.edu-icon {
  width: 46px; height: 46px; display: flex;
  align-items: center; justify-content: center;
  background: var(--accent-dim); border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.edu-icon svg { width: 22px; height: 22px; color: var(--accent); }
.edu-info h3 { font-size: 1rem; font-weight: 600; }
.edu-meta { font-size: 0.82rem; color: var(--text-secondary); }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--card);
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.skill-card-title {
  font-size: 0.82rem; font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
  font-family: var(--mono);
}

.skill-items { display: flex; flex-direction: column; gap: 10px; }

.skill-row {
  display: flex; justify-content: space-between; align-items: center;
}
.skill-name { font-size: 0.85rem; color: var(--text); }
.skill-level {
  font-size: 0.72rem; color: var(--text-muted);
  font-family: var(--mono);
  padding: 1px 8px;
  background: var(--bg);
  border-radius: 100px;
}

.skill-tags-card {
  grid-column: 1 / -1;
  background: var(--card);
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.tag-cloud {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tag-cloud .tag {
  padding: 5px 13px; font-size: 0.82rem;
  transition: all var(--ease);
}
.tag-cloud .tag:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--ease);
}
.project-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-3px);
}

.project-img {
  height: 160px; overflow: hidden;
  background: var(--surface);
}
.project-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s ease;
}
.project-card:hover .project-img img {
  transform: scale(1.04);
}

.project-body { padding: 18px 20px 20px; }

.project-name {
  font-size: 0.95rem; font-weight: 600;
  margin-bottom: 6px;
}

.project-desc {
  font-size: 0.82rem; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

.project-tech { display: flex; flex-wrap: wrap; gap: 4px; }
.project-tech .tag { font-size: 0.7rem; }

/* ===== Evaluation ===== */
.eval-card {
  padding: 32px 36px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
}
.eval-card::before {
  content: '"';
  position: absolute; top: 20px; left: 18px;
  font-size: 3.5rem; line-height: 1;
  color: var(--accent-dim);
  opacity: 0.6;
}
.eval-text {
  font-size: 0.9rem; color: var(--text-secondary);
  line-height: 1.9; margin-bottom: 14px;
}
.eval-text strong { color: var(--accent); font-weight: 600; }
.eval-text:last-of-type { margin-bottom: 0; }
.eval-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--border);
}

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

/* ===== Animations ===== */
.fade-in {
  opacity: 0; transform: translateY(16px);
}
.fade-in.visible {
  opacity: 1; transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto;
    padding: 32px 24px 24px;
    flex-direction: row; flex-wrap: wrap;
    gap: 16px; align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-top { flex-direction: row; align-items: center; gap: 18px; flex: 1; }
  .avatar-frame { width: 64px; height: 64px; }
  .sidebar-name { font-size: 1.15rem; }
  .sidebar-role { font-size: 0.78rem; }
  .sidebar-contact { display: none; }
  .sidebar-nav { display: none; }
  .main { padding: 36px 24px 32px; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .timeline-date { text-align: left; }
  .timeline-content { padding-left: 0; }
  .timeline-content::before { display: none; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .section { margin-bottom: 40px; padding-bottom: 28px; }
}

@media (max-width: 480px) {
  .main { padding: 24px 16px 32px; }
  .hero-title { font-size: 1.8rem; }
  .eval-card { padding: 24px 20px; }
  .sidebar { padding: 20px 16px; }
  .project-body { padding: 14px 16px 18px; }
}
