/* ========================================
   Personal Blog — Saichan Zhang
   Design inspired by esther-design-system
   Warm · Crafted · Distinct
   ======================================== */

/* --- CSS Variables --- */
:root {
  /* === Color System (60/30/10 ratio) === */
  /* Primary — Sage Green 60% */
  --color-primary: #5B8C7A;
  --color-primary-light: #7AAA96;
  --color-primary-pale: #E5F0EA;
  --color-primary-deep: #2E4D40;

  /* Emphasis — Warm Gold 30% */
  --color-gold: #C8A45C;
  --color-gold-light: #DFC88E;
  --color-gold-pale: #F9F2E2;

  /* Accent — Rose 10% */
  --color-rose: #C97B84;
  --color-rose-light: #E4B0B5;
  --color-rose-pale: #F8ECEE;

  /* Backgrounds — warm, never pure white/black */
  --color-bg: #FCFAF6;
  --color-bg-deep: #F5F0E8;
  --color-card: #FFFEFB;
  --color-dark: #1E2D27;
  --color-dark-soft: #2A3D35;

  /* Text — never pure black */
  --color-text: #2D2A28;
  --color-text-light: #6B6660;
  --color-text-muted: #96918C;
  --color-text-on-dark: #E5E0D8;
  --color-text-on-dark-muted: #A09890;

  /* Borders */
  --color-border: #E8E3DA;
  --color-border-light: #F0ECE5;

  /* === Typography === */
  --font-serif-cn: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --font-serif-en: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  /* Fluid type scale */
  --text-hero-name: clamp(3.2rem, 7vw, 6rem);
  --text-hero-en: clamp(1.3rem, 2.5vw, 1.8rem);
  --text-section-title: clamp(1.8rem, 4vw, 2.8rem);
  --text-card-title: clamp(1.1rem, 2vw, 1.5rem);
  --text-body: 1.05rem;
  --text-small: clamp(0.85rem, 1.2vw, 0.95rem);
  --text-xs: 0.78rem;
  --text-decorative: clamp(3rem, 8vw, 7rem);

  /* === Spacing (fluid) === */
  --space-section: clamp(80px, 12vh, 160px);
  --space-block: clamp(40px, 6vw, 100px);
  --space-card-pad: clamp(24px, 3vw, 44px);
  --space-gap: clamp(20px, 2.5vw, 40px);
  --space-gap-sm: clamp(12px, 1.5vw, 20px);

  /* === Shadows === */
  --shadow-sm: 0 1px 2px rgba(45, 42, 40, 0.04);
  --shadow-md: 0 4px 24px rgba(45, 42, 40, 0.06);
  --shadow-lg: 0 8px 40px rgba(45, 42, 40, 0.08);

  /* === Radii === */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* === Transitions === */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* === Brand bar === */
  --brand-bar-width: 5px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--color-primary-pale);
  color: var(--color-primary-deep);
}

/* --- Utility --- */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 40px);
}

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

.section-title {
  font-family: var(--font-serif-cn);
  font-size: var(--text-section-title);
  font-weight: 900;
  color: var(--color-text);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.section-divider {
  width: 40px;
  height: 5px;
  background: var(--color-primary);
  border-radius: 3px;
}

.section-divider + * {
  margin-top: var(--space-gap);
}

.subsection-title {
  font-family: var(--font-serif-cn);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: var(--space-gap) 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.subsection-title::before {
  content: '';
  width: 24px;
  height: 3px;
  background: var(--color-gold);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ========================================
   Navigation — Solid, no glassmorphism
   ======================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border-light);
  transition: var(--transition);
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--color-border);
}

.nav.scrolled .nav-inner {
  height: 56px;
}

.nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 40px);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: height 0.3s ease;
}

.nav-logo {
  font-family: var(--font-serif-en);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: 0.01em;
  padding-left: 16px;
  border-left: 4px solid var(--color-primary);
  transition: var(--transition);
  line-height: 1.3;
}

.nav-logo:hover {
  border-left-color: var(--color-gold);
  color: var(--color-primary-deep);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-text-light);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--color-primary);
}

/* Admin pencil icon — quiet, top-left */
.nav-admin-link {
  padding: 6px 8px !important;
  opacity: 0.35;
  transition: opacity 0.2s;
}
.nav-admin-link:hover {
  opacity: 0.7;
  color: var(--color-text-light) !important;
  background: none !important;
}

.nav-links a.nav-active {
  color: var(--color-primary);
  font-weight: 500;
  position: relative;
}

.nav-links a.nav-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  opacity: 0.5;
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--color-primary);
  z-index: 200;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* Language Toggle */
.lang-toggle {
  background: none;
  border: 2px solid var(--color-border);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-text-light);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.lang-toggle:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-pale);
  color: var(--color-primary-deep);
}

.lang-toggle .lang-divider { opacity: 0.3; }

.lang-toggle .lang-zh,
.lang-toggle .lang-en {
  padding: 1px 3px;
  border-radius: 4px;
  transition: var(--transition);
}

.lang-toggle .lang-zh.active,
.lang-toggle .lang-en.active {
  color: var(--color-primary);
  font-weight: 600;
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: var(--transition);
}

/* ========================================
   Hero — Asymmetric Two-Column
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 100px clamp(20px, 4vw, 60px) var(--space-block);
  overflow: hidden;
}

/* Background decorative — subtle gradient glow instead of abstract circles */
.hero-bg-decor {
  position: absolute;
  top: -15%;
  right: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse at 60% 40%, var(--color-gold-pale) 0%, transparent 65%);
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1300px;
  width: 100%;
  text-align: left;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 0.55fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.hero-left {
  display: flex;
  flex-direction: column;
}

.hero-greeting {
  font-family: var(--font-serif-en);
  font-size: var(--text-hero-en);
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: clamp(4px, 1vw, 8px);
  letter-spacing: 0.02em;
}

.hero-name {
  font-family: var(--font-serif-cn);
  font-size: var(--text-hero-name);
  font-weight: 900;
  color: var(--color-text);
  line-height: 1.1;
  letter-spacing: 0.04em;
}

.hero-name-en {
  font-family: var(--font-serif-en);
  font-size: var(--text-hero-en);
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: 4px;
  letter-spacing: 0.03em;
}

.hero-statement {
  font-family: var(--font-serif-en);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 400;
  font-style: italic;
  color: var(--color-primary);
  margin: clamp(8px, 1.5vw, 16px) 0 4px;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.hero-keywords {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

.hero-keyword {
  color: var(--color-text-muted);
}

.hero-divider {
  width: 56px;
  height: 4px;
  background: var(--color-gold);
  margin: clamp(14px, 2vw, 22px) 0;
  border-radius: 2px;
}

.hero-focus {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.hero-title {
  font-size: var(--text-body);
  color: var(--color-text);
  font-weight: 500;
  margin-bottom: 4px;
}

.hero-subtitle {
  display: none; /* replaced by hero-statement */
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: clamp(24px, 3vw, 36px);
}

.hero-tag {
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-primary-deep);
  background: var(--color-primary-pale);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: var(--transition);
}

.hero-tag:hover {
  border-color: var(--color-primary-light);
  background: #D4EAE0;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 24px;
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.hero-btn--primary {
  background: var(--color-primary);
  color: #FFF;
}

.hero-btn--primary:hover {
  background: var(--color-primary-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(91, 140, 122, 0.25);
}

.hero-btn--solid {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.hero-btn--solid:hover {
  background: var(--color-primary-pale);
  transform: translateY(-1px);
}

.hero-btn--ghost {
  color: var(--color-text-light);
  border: 2px solid var(--color-border);
}

.hero-btn--ghost:hover {
  color: var(--color-primary);
  border-color: var(--color-primary-light);
  transform: translateY(-1px);
}

/* Avatar with decorative dashed ring */
.hero-avatar-wrap {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Dashed ring behind avatar */
.hero-avatar-wrap::before {
  content: '';
  position: absolute;
  width: calc(clamp(210px, 22vw, 300px) + 32px);
  height: calc(clamp(210px, 22vw, 300px) + 32px);
  border: 2px dashed var(--color-gold-light);
  border-radius: 50%;
  opacity: 0.6;
}

.hero-avatar {
  width: clamp(200px, 22vw, 280px);
  height: clamp(200px, 22vw, 280px);
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-card);
  box-shadow: 0 4px 32px rgba(45, 42, 40, 0.12);
  transition: var(--transition-slow);
  position: relative;
  z-index: 1;
}

.hero-avatar:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 40px rgba(45, 42, 40, 0.18);
}

/* Stats bar — editorial numbered style */
.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--color-border);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 clamp(28px, 3vw, 48px);
  position: relative;
}

.hero-stat + .hero-stat {
  border-left: 1px solid var(--color-border);
}

.hero-stat-num {
  font-family: var(--font-serif-en);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-gold);
  opacity: 0.6;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.hero-stat-value {
  font-family: var(--font-serif-en);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.15;
}

.hero-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hero-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: clamp(28px, 4vw, 48px);
  opacity: 0.6;
}

/* Remove old abstract circles — simplified decorative element */
.hero-visual { display: none; }

/* ========================================
   About — Sticky Sidebar + Content
   ======================================== */
.about {
  background: var(--color-bg-deep);
}

.about .container > .section-title {
  text-align: left;
  margin-left: 0;
}

.about .container > .section-divider {
  margin: 12px 0 var(--space-gap) 0;
}

/* Section number decoration */
.about .container {
  position: relative;
}

.about .container::before {
  content: '01';
  font-family: var(--font-serif-en);
  font-size: var(--text-decorative);
  font-weight: 900;
  color: var(--color-text);
  opacity: 0.03;
  position: absolute;
  top: -60px;
  right: 40px;
  line-height: 1;
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-gap-sm);
}

.about-card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: var(--space-card-pad);
  border: 1px solid var(--color-border);
  transition: var(--transition);
  position: relative;
}

.about-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

/* About intro */
.about-intro {
  font-family: var(--font-serif-cn);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: var(--space-gap);
}

.about-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

/* Skills grid */
.about-skills,
.about-toolkit {
  margin-bottom: var(--space-gap);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  column-gap: 28px;
  row-gap: 6px;
}

.skill-tag {
  font-size: var(--text-small);
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: 0.02em;
  position: relative;
  padding-left: 10px;
}

.skill-tag::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-gold);
  opacity: 0.5;
}

/* AI Toolkit — editorial list style */
.toolkit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 40px;
}

.tool-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.tool-name {
  font-family: var(--font-serif-en);
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-text);
  min-width: 100px;
}

.tool-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
}

@media (max-width: 600px) {
  .toolkit-grid { grid-template-columns: 1fr; }
}

.about-icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary-pale);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.about-card h3 {
  font-family: var(--font-serif-cn);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--color-text);
}

.about-item { margin-bottom: 16px; }
.about-item:last-child { margin-bottom: 0; }

.about-year {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary-deep);
  background: var(--color-primary-pale);
  padding: 3px 12px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.about-text {
  font-size: var(--text-small);
  color: var(--color-text-light);
  line-height: 1.8;
}

.about-text + .about-text { margin-top: 12px; }

/* About contact card */
.about-card--contact { border-color: var(--color-gold-light); }
.about-contact-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.contact-label-inline {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 40px;
}
.contact-value-inline {
  font-size: var(--text-small);
  color: var(--color-text);
  text-decoration: none;
}
a.contact-value-inline {
  color: var(--color-primary);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}
a.contact-value-inline:hover {
  border-bottom-color: var(--color-primary);
}

/* ========================================
   Portfolio — Fluid Grid + Brand Bars
   ======================================== */
.portfolio {
  background: var(--color-bg);
  position: relative;
}

/* Section number decoration */
.portfolio .container {
  position: relative;
}

.portfolio .container::before {
  content: '02';
  font-family: var(--font-serif-en);
  font-size: var(--text-decorative);
  font-weight: 900;
  color: var(--color-text);
  opacity: 0.03;
  position: absolute;
  top: -60px;
  right: 40px;
  line-height: 1;
  pointer-events: none;
}

.portfolio .section-title,
.portfolio .section-divider {
  text-align: left;
}

.portfolio .section-divider {
  margin: 12px 0 var(--space-gap-sm) 0;
}

.portfolio-intro {
  color: var(--color-text-muted);
  font-size: var(--text-small);
  max-width: 560px;
  margin: 0 0 var(--space-gap) 0;
  line-height: 1.6;
}

/* Project grid — vertical step timeline */
.case-grid,
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 64px;
}

.case-grid::before,
.project-grid::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 40px;
  bottom: 40px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--color-gold-light) 0px,
    var(--color-gold-light) 6px,
    transparent 6px,
    transparent 12px
  );
}

.case-grid { counter-reset: case-step; }
.case-card { counter-increment: case-step; }
.case-card::before {
  content: counter(case-step);
  position: absolute;
  left: -48px;
  top: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-card);
  border: 3px solid var(--color-primary-light);
  z-index: 1;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif-en);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
}

.project-grid { counter-reset: proj-step; }
.project-card { counter-increment: proj-step; }
.project-card::before {
  content: counter(proj-step);
  position: absolute;
  left: -48px;
  top: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-card);
  border: 3px solid var(--color-primary-light);
  z-index: 1;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif-en);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Shared card style */
.case-card,
.project-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: none;
  border-radius: var(--radius-md);
  padding: var(--space-card-pad);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  margin-bottom: var(--space-gap);
  overflow: visible;
}

.case-card:last-child,
.project-card:last-child {
  margin-bottom: 0;
}

.case-card:hover,
.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
  transform: none;
}

.case-card:hover::before,
.project-card:hover::before {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #FFF;
}

/* Color palette variants for border-left */
.case-palette-cd,
.project-palette-cd { border-left-color: #C97B84; }
.case-palette-siemens,
.project-palette-siemens { border-left-color: #5B8C7A; }
.case-palette-baidu,
.project-palette-baidu { border-left-color: #6B8CC4; }
.case-palette-plum,
.project-palette-plum { border-left-color: #8B7BA5; }
.case-palette-amber,
.project-palette-amber { border-left-color: #B98A4A; }

.case-palette-cd:hover,
.project-palette-cd:hover { border-left-color: #B5656E; }
.case-palette-siemens:hover,
.project-palette-siemens:hover { border-left-color: #3D6B55; }
.case-palette-baidu:hover,
.project-palette-baidu:hover { border-left-color: #4A6CA8; }

/* Case card header */
.case-head,
.project-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.case-tag,
.project-card-tag {
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-primary-deep);
  background: var(--color-primary-pale);
  padding: 4px 12px;
  border-radius: 10px;
}

.case-company,
.project-card-company {
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

.case-title,
.project-card-title {
  font-family: var(--font-serif-cn);
  font-size: var(--text-card-title);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.45;
  margin-bottom: 14px;
}

.case-label,
.project-card-label {
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-rose);
  margin-top: 14px;
  margin-bottom: 4px;
  display: inline-block;
}

.case-text,
.project-card-text {
  font-size: var(--text-body);
  color: var(--color-text-light);
  line-height: 1.75;
}

.case-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--color-border);
}

.case-result {
  display: flex;
  flex-direction: column;
}

.case-result-value {
  font-family: var(--font-serif-en);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.25;
}

.case-result-label {
  font-size: var(--text-small);
  color: var(--color-text-muted);
}

.case-link {
  margin-top: 16px;
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.case-link:hover {
  color: var(--color-gold);
  gap: 8px;
}

/* Hide old project-card-accent div since we use border-left now */
.project-card-accent {
  display: none;
}

/* ========================================
   Internship — Vertical Step Timeline
   ======================================== */
.internship {
  background: var(--color-bg-deep);
  position: relative;
}

.internship .container {
  position: relative;
}

.internship .container::before {
  content: '03';
  font-family: var(--font-serif-en);
  font-size: var(--text-decorative);
  font-weight: 900;
  color: var(--color-text);
  opacity: 0.03;
  position: absolute;
  top: -60px;
  right: 40px;
  line-height: 1;
  pointer-events: none;
}

.internship .section-title,
.internship .section-divider {
  text-align: left;
}

.internship .section-divider {
  margin: 12px 0 var(--space-gap) 0;
}

/* Internship — full-width rectangle cards */
.exp-grid,
.intern-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-gap-sm);
  max-width: 100%;
  margin: 0;
}

.exp-card,
.intern-card {
  position: relative;
  width: 100%;
  margin-bottom: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  overflow: visible;
  transition: var(--transition);
  padding: var(--space-card-pad);
}

.exp-card:hover,
.intern-card:hover {
  box-shadow: var(--shadow-md);
  border-left-color: var(--color-primary-deep);
  transform: translateX(2px);
}

/* Remove center-axis line and dots */
.exp-grid::before,
.intern-grid::before,
.exp-card::after,
.intern-card::after {
  display: none;
}

/* Hide old accent bars */
.exp-card-accent { display: none; }

/* Card internal layout */
.exp-card-body {
  display: flex;
  flex-direction: column;
}

.exp-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

/* Intern card header for static */
.intern-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.exp-card-logo,
.intern-card-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif-en);
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFF;
  flex-shrink: 0;
}

.exp-logo-cd,
.intern-logo-cd { background: linear-gradient(135deg, #C97B84, #D4A5A5); }
.exp-logo-siemens,
.intern-logo-siemens { background: linear-gradient(135deg, #5B8C7A, #7BA587); }
.exp-logo-baidu,
.intern-logo-baidu { background: linear-gradient(135deg, #6B8CC4, #8BA5D4); }
.exp-logo-plum,
.intern-logo-plum { background: linear-gradient(135deg, #8B7BA5, #B3A3CE); }
.exp-logo-amber,
.intern-logo-amber { background: linear-gradient(135deg, #B98A4A, #DCB87E); }

.exp-card-meta,
.intern-card-meta {
  flex: 1;
  min-width: 0;
}

.exp-card-company,
.intern-company {
  font-family: var(--font-serif-cn);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.3;
  display: inline-block;
  background: var(--color-primary-pale);
  padding: 4px 14px;
  border-radius: 6px;
  border-left: 4px solid var(--color-primary);
}

.exp-card-role,
.intern-role {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--color-primary-deep);
  font-weight: 700;
  margin-top: 6px;
  display: inline-block;
  background: var(--color-gold-pale);
  padding: 2px 12px;
  border-radius: 4px;
}

.exp-card-period,
.intern-period {
  font-size: var(--text-small);
  color: var(--color-text-muted);
  margin-top: 6px;
  display: inline-block;
  font-weight: 500;
}

.intern-card-body {
  padding: 0;
}

.exp-card-bullets,
.intern-card-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.exp-card-bullets li,
.intern-card-body li {
  position: relative;
  padding-left: 22px;
  font-size: var(--text-body);
  color: var(--color-text-light);
  line-height: 1.8;
}

.exp-card-bullets li::before,
.intern-card-body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-gold);
}

/* ========================================
   Awards / Experience — Center-Axis Timeline
   ======================================== */
.experience {
  background: var(--color-bg);
  position: relative;
}

.experience .container {
  position: relative;
}

.experience .container::before {
  content: '04';
  font-family: var(--font-serif-en);
  font-size: var(--text-decorative);
  font-weight: 900;
  color: var(--color-text);
  opacity: 0.03;
  position: absolute;
  top: -60px;
  right: 40px;
  line-height: 1;
  pointer-events: none;
}

.experience .section-title,
.experience .section-divider {
  text-align: left;
}

.experience .section-divider {
  margin: 12px 0 var(--space-gap) 0;
}

/* Badges — keep but refresh */
.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary-light);
  border-radius: 0 24px 24px 0;
  font-size: var(--text-small);
  color: var(--color-text);
  transition: var(--transition);
}

.badge:hover {
  border-left-color: var(--color-primary);
  border-left-width: 5px;
  box-shadow: var(--shadow-sm);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
}

.badge.accent { border-left-color: var(--color-rose-light); }
.badge.accent .badge-dot { background: var(--color-rose); }
.badge.accent:hover { border-left-color: var(--color-rose); }

.badge.honor { border-left-color: #B3A3CE; }
.badge.honor .badge-dot { background: #8B7BA5; }
.badge.honor:hover { border-left-color: #8B7BA5; }

/* Competitions — horizontal badge grid (like scholarships) */
.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary-light);
  border-radius: 0 24px 24px 0;
  font-size: var(--text-small);
  color: var(--color-text);
  transition: var(--transition);
  margin-bottom: 0;
  position: static;
}

.timeline-item:hover {
  border-left-color: var(--color-primary);
  border-left-width: 5px;
  box-shadow: var(--shadow-sm);
}

.timeline-item:last-child { margin-bottom: 0; }

/* Hide old timeline marker */
.timeline-marker {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
  box-shadow: none;
  border: none;
  margin: 0;
  position: static;
  grid-column: auto;
}

.timeline-content {
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.timeline-content:hover {
  box-shadow: none;
  border-color: transparent;
}

.timeline-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary-deep);
  background: var(--color-primary-pale);
  padding: 2px 10px;
  border-radius: 6px;
  margin-bottom: 0;
}

.timeline-content p {
  font-size: var(--text-small);
  color: var(--color-text);
  line-height: 1.5;
}

/* ========================================
   Dark Quote Panel — Values / Motto
   ======================================== */
.dark-quote {
  background: var(--color-dark);
  color: var(--color-text-on-dark);
  padding: var(--space-section) 0;
  position: relative;
  overflow: hidden;
}

/* Subtle decorative glow */
.dark-quote::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 60%;
  height: 180%;
  background: radial-gradient(ellipse at center, rgba(200, 164, 92, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.dark-quote .container {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
}

.dark-quote blockquote {
  font-family: var(--font-serif-cn);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.03em;
  color: var(--color-text-on-dark);
  margin: 0;
  padding: 0;
  position: relative;
}

/* Decorative quote mark */
.dark-quote blockquote::before {
  content: '"';
  font-family: var(--font-serif-en);
  font-size: clamp(4rem, 8vw, 8rem);
  font-weight: 900;
  color: var(--color-gold);
  opacity: 0.15;
  position: absolute;
  top: -60px;
  left: -20px;
  line-height: 1;
  pointer-events: none;
}

.dark-quote blockquote::after {
  content: '';
}

.dark-quote .quote-attribution {
  margin-top: clamp(20px, 3vw, 32px);
  font-size: var(--text-small);
  color: var(--color-text-on-dark-muted);
  font-style: italic;
}

.dark-quote .quote-attribution::before {
  content: '— ';
}

/* ========================================
   Blog — Cards with accent + auto-fill grid
   ======================================== */
.blog {
  background: var(--color-bg-deep);
  position: relative;
}

.blog .container {
  position: relative;
}

.blog .container::before {
  content: '05';
  font-family: var(--font-serif-en);
  font-size: var(--text-decorative);
  font-weight: 900;
  color: var(--color-text);
  opacity: 0.03;
  position: absolute;
  top: -60px;
  right: 40px;
  line-height: 1;
  pointer-events: none;
}

.blog .section-title,
.blog .section-divider {
  text-align: left;
}

.blog .section-divider {
  margin: 12px 0 var(--space-gap-sm) 0;
}

.blog-intro {
  color: var(--color-text-muted);
  font-size: var(--text-small);
  font-style: italic;
  margin: 0 0 var(--space-gap) 0;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-gap-sm);
}

.blog-card {
  background: var(--color-card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-left: var(--brand-bar-width) solid var(--color-gold-light);
  transition: var(--transition);
}

.blog-card:hover {
  border-left-color: var(--color-gold);
  box-shadow: var(--shadow-md);
}

.blog-card-image {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.03);
}

.blog-card-body {
  padding: clamp(18px, 2.5vw, 24px);
}

.blog-card-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.blog-card-body h3 {
  font-family: var(--font-serif-cn);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  font-weight: 700;
  margin: 8px 0;
  color: var(--color-text);
  line-height: 1.4;
}

.blog-card-body p {
  font-size: var(--text-small);
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: 14px;
}

.blog-card-link {
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.blog-card-link:hover {
  color: var(--color-gold);
  gap: 8px;
}

button.blog-card-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
  background: var(--color-bg-deep);
  padding: var(--space-section) 0;
  text-align: center;
}

.cta-heading {
  font-family: var(--font-serif-en);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.cta-sub {
  font-size: var(--text-body);
  color: var(--color-text-muted);
  margin-bottom: clamp(24px, 3vw, 36px);
}

.cta-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   Footer — Enhanced Brand Panel
   ======================================== */
.footer {
  background: var(--color-dark);
  color: var(--color-text-on-dark);
  padding: clamp(48px, 8vw, 72px) 0;
  text-align: center;
  border-top: none;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
}

.footer-brand {
  margin-bottom: 4px;
}

.footer-logo {
  font-family: var(--font-serif-en);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-text-on-dark);
  letter-spacing: 0.02em;
}

.footer-tagline {
  font-family: var(--font-serif-en);
  font-size: var(--text-xs);
  color: var(--color-gold-light);
  letter-spacing: 0.08em;
  margin-top: 6px;
  opacity: 0.7;
}

.footer-text {
  font-size: var(--text-small);
  color: var(--color-text-on-dark-muted);
}

.footer-heart {
  color: var(--color-rose-light);
}

/* Footer admin entry */
.admin-entry {
  margin-top: 0;
}

.admin-entry a {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text-on-dark-muted);
  font-size: var(--text-xs);
  padding: 5px 14px;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
  text-decoration: none;
}

.admin-entry a:hover {
  color: var(--color-text-on-dark);
  border-color: var(--color-gold-light);
  background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   Contact (legacy — embedded in about now)
   ======================================== */
.contact {
  background: var(--color-bg);
}

.contact-intro {
  text-align: left;
  color: var(--color-text-muted);
  font-size: var(--text-small);
  margin: 0 0 var(--space-gap) 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-gap-sm);
  max-width: 600px;
}

.contact-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.contact-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.contact-card svg {
  color: var(--color-primary);
  margin-bottom: 4px;
}

.contact-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-value {
  font-size: var(--text-small);
  color: var(--color-text-light);
  font-weight: 400;
}

.contact-value--link {
  color: var(--color-text-light);
  text-decoration: none;
  border-bottom: 1px dashed var(--color-border);
  transition: var(--transition);
}

.contact-value--link:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ========================================
   Animations — Scroll Reveal only
   ======================================== */
html.js .fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

html.js .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger reveal for cards */
html.js .project-card:nth-child(1),
html.js .case-card:nth-child(1),
html.js .blog-card:nth-child(1) { transition-delay: 0s; }

html.js .project-card:nth-child(2),
html.js .case-card:nth-child(2),
html.js .blog-card:nth-child(2) { transition-delay: 0.08s; }

html.js .project-card:nth-child(3),
html.js .case-card:nth-child(3),
html.js .blog-card:nth-child(3) { transition-delay: 0.16s; }

html.js .project-card:nth-child(4),
html.js .case-card:nth-child(4),
html.js .blog-card:nth-child(4) { transition-delay: 0.24s; }

/* ========================================
   Toast
   ======================================== */
#toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translate(-50%, 16px);
  background: var(--color-dark);
  color: var(--color-text-on-dark);
  font-size: var(--text-small);
  padding: 10px 20px;
  border-radius: 24px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  z-index: 300;
  max-width: 86vw;
  text-align: center;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ========================================
   Misc
   ======================================== */
.empty-hint {
  text-align: left;
  color: var(--color-text-muted);
  font-size: var(--text-small);
  padding: 24px 0;
}

/* Keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
  /* Nav */
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-card);
    padding: 20px 32px;
    gap: 4px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }
  .nav-links.open .lang-toggle { margin-left: 0; align-self: flex-start; }
  .mobile-menu-btn { display: flex; }

  /* Hero */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero-left {
    align-items: flex-start;
  }
  .hero-bg-decor {
    top: -10%;
    right: -30%;
    width: 80%;
  }
  .hero-avatar-wrap::before {
    width: calc(clamp(160px, 30vw, 220px) + 20px);
    height: calc(clamp(160px, 30vw, 220px) + 20px);
  }
  .hero-avatar {
    width: clamp(140px, 30vw, 200px);
    height: clamp(140px, 30vw, 200px);
  }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 0;
  }
  .hero-stat { padding: 0 12px; }
  .hero-stat + .hero-stat { border-left: none; }
  .hero-stat:nth-child(even) { border-left: 1px solid var(--color-border); }

  /* About */
  .about-grid { grid-template-columns: 1fr; }

  /* Portfolio — vertical step timeline: reduce padding */
  .case-grid,
  .project-grid {
    padding-left: 48px;
  }
  .case-card::before,
  .project-card::before {
    left: -38px;
    width: 36px;
    height: 36px;
    top: 24px;
    font-size: 0.9rem;
  }
  .case-grid::before,
  .project-grid::before {
    left: 20px;
  }

  /* Internship — full-width cards already responsive, just reduce padding */
  .exp-card,
  .intern-card {
    padding: clamp(20px, 3vw, 28px);
  }

  /* Competitions — badge grid: already flex-wrap, no changes needed */

  /* Blog */
  .blog-grid { grid-template-columns: 1fr; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr; }

  /* Section spacing */
  .section-padding { padding: clamp(60px, 8vh, 100px) 0; }

  /* Section number decorations */
  .about .container::before,
  .portfolio .container::before,
  .internship .container::before,
  .experience .container::before,
  .blog .container::before {
    font-size: clamp(2rem, 5vw, 4rem);
    top: -30px;
    right: 20px;
  }

  /* Dark quote */
  .dark-quote blockquote {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  }
}

@media (max-width: 600px) {
  .hero-name { font-size: clamp(2rem, 8vw, 3rem); }
  .hero-name-en { font-size: 1rem; }
  .section-title { font-size: clamp(1.3rem, 5vw, 1.8rem); }
  .hero-avatar { width: 120px; height: 120px; }
  .hero-avatar-wrap::before {
    width: calc(120px + 16px);
    height: calc(120px + 16px);
  }
  .hero-btn { padding: 10px 20px; font-size: 0.85rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 16px 0; }

  .about-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }

  .badge { font-size: 0.8rem; padding: 8px 14px; }

  .container { padding: 0 18px; }
  .dark-quote blockquote { font-size: 1.05rem; }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js .fade-in { opacity: 1; transform: none; }
}
