/* ============================================
   海外仓PM博客 - 全局样式
   设计主题：工业物流美学
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Noto+Serif+SC:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* --- CSS 变量 --- */
:root {
  --bg-dark: #16181d;
  --bg-darker: #111216;
  --bg-card: #1e2128;
  --bg-cream: #f4f1ea;
  --bg-cream-dark: #e8e4db;

  --accent: #f59e0b;
  --accent-dim: #b45309;
  --accent-glow: rgba(245, 158, 11, 0.2);
  --blue: #3b82f6;
  --blue-dim: #2563eb;
  --grey: #64748b;
  --grey-light: #94a3b8;
  --grey-dark: #334155;
  --steel: #475569;
  --steel-light: #94a3b8;
  --red: #ef4444;
  --red-dim: #dc2626;

  --font-mono: 'Space Mono', 'JetBrains Mono', monospace;
  --font-serif: 'Noto Serif SC', 'Georgia', serif;
  --font-data: 'JetBrains Mono', monospace;

  --radius-sm: 2px;
  --radius-md: 4px;

  --max-width: 1200px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-dark);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

body {
  font-family: var(--font-serif);
  background: var(--bg-dark);
  color: #e0e0e0;
  line-height: 1.8;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- 选中文字 --- */
::selection {
  background: var(--accent);
  color: var(--bg-dark);
}

/* --- 导航栏 --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.navbar.scrolled {
  background: rgba(20, 22, 27, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(245, 158, 11, 0.1);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo::before {
  content: '';
  display: block;
  width: 24px;
  height: 3px;
  background: var(--accent);
  position: relative;
}

.nav-logo::before {
  box-shadow: 0 8px 0 var(--accent), 0 16px 0 var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey-light);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* --- Section 通用样式 --- */
.section {
  position: relative;
  padding: 100px 48px;
}

.section-header {
  margin-bottom: 64px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 3px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-tag::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.section-title .highlight {
  color: var(--accent);
}

/* --- Hero Section --- */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 48px;
  overflow: hidden;
}

#hero canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-barcode {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-bottom: 40px;
  opacity: 0.6;
}

.hero-barcode span {
  display: block;
  background: var(--accent);
  width: 3px;
  border-radius: 1px;
}

.hero-name {
  font-family: var(--font-mono);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  color: #fff;
  letter-spacing: 4px;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-name .dot {
  color: var(--accent);
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(14px, 2vw, 18px);
  color: var(--grey-light);
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hero-subtitle .cursor {
  display: inline-block;
  width: 2px;
  height: 20px;
  background: var(--accent);
  animation: cursor-blink 0.8s infinite;
}

.hero-location {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey);
  margin-top: 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
  animation: float 2s ease-in-out infinite;
}

.hero-scroll-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--grey);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-scroll-arrow {
  width: 20px;
  height: 32px;
  border: 2px solid var(--grey);
  border-radius: 10px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.hero-scroll-arrow::after {
  content: '';
  width: 2px;
  height: 8px;
  background: var(--accent);
  border-radius: 1px;
  animation: scroll-dot 1.5s ease-in-out infinite;
}

/* --- Dashboard Section --- */
#dashboard {
  background: var(--bg-darker);
  position: relative;
  overflow: hidden;
}

#dashboard::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(245, 158, 11, 0.03) 2px, rgba(245, 158, 11, 0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(37, 99, 235, 0.02) 2px, rgba(37, 99, 235, 0.02) 4px);
  pointer-events: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}

.dash-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.dash-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.dash-card:hover::after {
  transform: scaleX(1);
}

.dash-number {
  font-family: var(--font-data);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.dash-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--grey-light);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.dash-icon {
  margin-bottom: 16px;
  opacity: 0.4;
}

/* --- Divider --- */
.section-divider {
  max-width: var(--max-width);
  margin: 0 auto 80px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-divider .line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--grey-dark) 0, var(--grey-dark) 8px, transparent 8px, transparent 16px);
}

.section-divider .diamond {
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* --- Articles Section --- */
#articles {
  background: var(--bg-cream);
  color: var(--bg-dark);
}

.article-filters {
  border-bottom-color: #d9d5cc;
}

.article-card {
  background: #fff;
  border-color: #e0ddd5;
}

.article-filters {
  display: flex;
  gap: 0;
  max-width: var(--max-width);
  margin: 0 auto 48px;
  border-bottom: 2px solid #e0d8c8;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--grey);
  background: none;
  border: none;
  cursor: pointer;
  padding: 14px 28px;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s;
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.filter-btn:hover {
  color: var(--bg-dark);
}

.filter-btn.active {
  color: var(--bg-dark);
  font-weight: 700;
}

.filter-btn.active::after {
  transform: scaleX(1);
}

.filter-count {
  font-family: var(--font-data);
  font-size: 10px;
  margin-left: 6px;
  opacity: 0.5;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.article-card {
  background: #fff;
  border: 1px solid #e8e0d0;
  border-radius: var(--radius-md);
  padding: 28px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  border-color: var(--accent);
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}

.article-card:hover::before {
  transform: scaleX(1);
}

.article-card.card-amber::before { background: var(--accent); }
.article-card.card-blue::before { background: var(--blue); }
.article-card.card-red::before { background: var(--red); }

.article-card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid #d9d5cc;
  border-radius: var(--radius-sm);
}

.article-card-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--bg-dark);
  margin-bottom: 12px;
  line-height: 1.5;
  transition: color 0.3s;
}

.article-card:hover .article-card-title {
  color: var(--accent-dim);
}

.article-card-summary {
  font-size: 14px;
  color: var(--grey);
  line-height: 1.7;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--grey-light);
}

.article-card-barcode {
  display: flex;
  gap: 1px;
  margin-top: 16px;
  opacity: 0.15;
}

.article-card-barcode span {
  display: block;
  background: var(--bg-dark);
  width: 2px;
}

/* --- Timeline Section --- */
#timeline {
  background: var(--bg-dark);
}

.timeline-wrapper {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.timeline-wrapper::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: repeating-linear-gradient(0deg,
    var(--accent) 0,
    var(--accent) 4px,
    transparent 4px,
    transparent 12px
  );
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 64px;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s, transform 0.6s;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:nth-child(odd) {
  flex-direction: row;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline-content {
  width: calc(50% - 40px);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  transition: border-color 0.3s;
}

.timeline-content:hover {
  border-color: var(--accent);
}

.timeline-node {
  position: absolute;
  left: 50%;
  top: 28px;
  width: 14px;
  height: 14px;
  background: var(--bg-dark);
  border: 2px solid var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  transition: background 0.3s, box-shadow 0.3s;
}

.timeline-item:hover .timeline-node {
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.timeline-year {
  font-family: var(--font-data);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.timeline-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.timeline-company {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.timeline-desc {
  font-size: 14px;
  color: var(--grey-light);
  line-height: 1.7;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.timeline-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--grey);
  padding: 2px 8px;
  border: 1px solid var(--grey-dark);
  border-radius: var(--radius-sm);
}

/* --- About Section --- */
#about {
  background: var(--bg-darker);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 64px;
  max-width: var(--max-width);
  margin: 0 auto;
  align-items: start;
}

.about-avatar-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.about-avatar {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.about-avatar::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: 2px;
}

.about-avatar-inner {
  font-family: var(--font-mono);
  font-size: 56px;
  color: var(--accent);
  font-weight: 700;
}

.about-name-tag {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--grey-light);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.about-social {
  display: flex;
  gap: 16px;
}

.about-social a {
  width: 40px;
  height: 40px;
  border: 1px solid var(--grey-dark);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-light);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 18px;
  transition: all 0.3s;
}

.about-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
}

.about-bio {
  font-size: 16px;
  color: #d0d0d0;
  line-height: 2;
  margin-bottom: 32px;
}

.about-bio .em {
  color: var(--accent);
  font-style: normal;
}

.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 14px;
  border: 1px solid var(--grey-dark);
  border-radius: var(--radius-sm);
  color: var(--grey-light);
  transition: all 0.3s;
  cursor: default;
  position: relative;
}

.skill-tag::before {
  content: '#';
  color: var(--accent);
  margin-right: 4px;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: #fff;
  background: rgba(245, 158, 11, 0.08);
}

.contact-form {
  display: flex;
  gap: 12px;
  max-width: 520px;
}

.contact-form input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--grey-dark);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.contact-form input:focus {
  border-color: var(--accent);
}

.contact-form input::placeholder {
  color: var(--grey);
}

.contact-form button {
  padding: 12px 28px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--bg-dark);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
}

.contact-form button:hover {
  background: #fbbf24;
  transform: translateY(-1px);
}

/* --- Footer --- */
.footer {
  background: var(--bg-darker);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 32px 48px;
  text-align: center;
}

.footer-barcode {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-bottom: 16px;
  opacity: 0.3;
}

.footer-barcode span {
  display: block;
  background: var(--accent);
  width: 2px;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--grey);
  letter-spacing: 1.5px;
}

/* --- 响应式 --- */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .section {
    padding: 80px 32px;
  }

  .navbar {
    padding: 0 32px;
  }
}

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

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .article-filters {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .timeline-wrapper::before {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    flex-direction: row;
    padding-left: 50px;
  }

  .timeline-content {
    width: 100%;
  }

  .timeline-node {
    left: 20px;
    top: 28px;
  }

  .section {
    padding: 60px 20px;
  }

  .navbar {
    padding: 0 20px;
  }

  .nav-links {
    display: none;
  }

  .contact-form {
    flex-direction: column;
  }

  .hero-name {
    letter-spacing: 2px;
  }
}
