/* ==========================================
   中国古典风格 - 个人网站样式
   灵感来源：汇尘轩 - 青色园林主题
   ========================================== */

/* CSS变量 - 古典青色园林主题 */
:root {
  /* 主色（青色园林主题） */
  --main-color: #55a2a0;
  --main-color-light: #8bc3c2;
  --main-color-dark: #3d7a78;
  --accent: #55a2a0;
  --accent-secondary: #c85540;

  /* 背景（宣纸风格） */
  --bg-primary: #faf8f2;
  --bg-secondary: #f5f2ea;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 0.95);

  /* 字体颜色 */
  --text-primary: #333333;
  --text-secondary: #555555;
  --text-muted: #888888;

  /* 边框 */
  --border-color: #e3dfd4;
  --border: 1px solid var(--border-color);

  /* 阴影（水墨风） */
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);

  /* 其他 */
  --radius: 8px;
  --radius-sm: 4px;
  --max-width: 1200px;
}

/* 暗色主题 */
[data-theme="dark"] {
  --main-color: #5a9e9c;
  --main-color-light: #7ab5b3;
  --main-color-dark: #4a8a88;
  --accent: #5a9e9c;
  --accent-secondary: #d4736a;

  --bg-primary: #1a1f1e;
  --bg-secondary: #222725;
  --bg-card: rgba(40, 44, 42, 0.9);
  --bg-card-hover: rgba(50, 55, 53, 0.95);

  --text-primary: #e8e6e1;
  --text-secondary: #b0aca3;
  --text-muted: #7a756d;

  --border-color: #3a3f3d;
  --border: 1px solid var(--border-color);

  --shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-attachment: fixed;
}

/* 容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* 链接 */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-secondary);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-family: "Noto Serif SC", serif;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--main-color-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

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

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

/* 卡片 */
.card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* 标题 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
  font-family: "Noto Serif SC", serif;
  color: var(--text-primary);
}

h1 {
  font-size: 3rem;
  letter-spacing: 0.05em;
}

h2 {
  font-size: 2.25rem;
  letter-spacing: 0.03em;
}

h3 {
  font-size: 1.5rem;
}

/* 段落 */
p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

/* 列表 */
ul, ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* 标签/徽章 */
.badge {
  display: inline-block;
  padding: 4px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 20px;
  background: rgba(85, 162, 160, 0.1);
  color: var(--accent);
  border: 1px solid rgba(85, 162, 160, 0.2);
  font-family: "Noto Serif SC", serif;
}

/* 网格布局 */
.grid {
  display: grid;
  gap: 24px;
}

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

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

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

/* Section样式 */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  color: var(--accent);
}

.section-title p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* 数据统计卡片 */
.stat-card {
  text-align: center;
  padding: 32px;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* 技能进度条 */
.skill-bar {
  margin-bottom: 16px;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.skill-name {
  font-weight: 600;
  color: var(--text-primary);
}

.skill-level {
  color: var(--accent);
}

.skill-track {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 1s ease;
}

/* 时间线 */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -36px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
}

.timeline-date {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.timeline-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.timeline-company {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* 项目卡片 */
.project-card {
  padding: 32px;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.project-results {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

.project-results h4 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 8px;
}

/* 工具图标网格 */
.tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  min-width: 100px;
}

.tool-item:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.tool-icon {
  font-size: 2rem;
}

.tool-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* 页脚 */
.footer {
  background: var(--bg-secondary);
  padding: 48px 0;
  border-top: var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

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

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

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .section {
    padding: 60px 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  /* Hero 区域移动端优化 */
  .hero {
    min-height: auto;
    padding: 100px 0 60px;
  }

  .hero-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 24px;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .hero-buttons .btn {
    width: 100%;
    text-align: center;
  }

  /* 联系信息框移动端优化 */
  .contact-highlight {
    padding: 16px !important;
    margin: 16px 0 !important;
  }

  .contact-highlight > div {
    flex-direction: column;
    gap: 16px !important;
  }

  .contact-highlight > div > div {
    justify-content: center;
  }

  /* 统计卡片移动端优化 */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .stat-card {
    padding: 20px;
  }

  .stat-number {
    font-size: 2rem;
  }

  /* 项目卡片移动端优化 */
  .project-card {
    padding: 20px;
  }

  .project-header {
    flex-direction: column;
    gap: 12px;
  }

  .project-title {
    font-size: 1.25rem;
  }

  /* 时间线移动端优化 */
  .timeline {
    padding-left: 24px;
  }

  .timeline-item::before {
    left: -28px;
    width: 10px;
    height: 10px;
  }

  .timeline-title {
    font-size: 1.125rem;
  }

  /* 技能卡片移动端优化 */
  .skill-info {
    flex-direction: column;
    gap: 4px;
  }

  .skill-name {
    font-size: 0.875rem;
  }

  /* 指标网格移动端优化 */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* 联系部分移动端优化 */
  .contact-info {
    gap: 16px;
  }

  .contact-item {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .contact-item[style*="font-size: 1.25rem"] {
    font-size: 1.125rem !important;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .container {
    padding: 0 16px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.875rem;
  }

  .hero {
    padding: 80px 0 40px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .contact-highlight {
    padding: 12px !important;
  }

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

/* 动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 {
  animation-delay: 0.1s;
}

.animate-delay-2 {
  animation-delay: 0.2s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

/* 减少动画（无障碍） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 主内容区域 */
.main-content {
  position: relative;
  z-index: 1;
}

/* Hero区域 */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

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

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--accent);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* 联系信息高亮框 */
.contact-highlight {
  background: var(--bg-card) !important;
  border: 2px solid var(--accent) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow);
}

/* 技能标签云 */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.skill-tag {
  padding: 6px 14px;
  font-size: 0.875rem;
  background: rgba(85, 162, 160, 0.1);
  color: var(--accent);
  border-radius: 20px;
  border: 1px solid rgba(85, 162, 160, 0.2);
}

/* 项目成果指标 */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.metric-item {
  text-align: center;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* 联系信息 */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
}

.contact-icon {
  font-size: 1.25rem;
  color: var(--accent);
}

/* 加载状态 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 装饰性元素 - 古典风格 */
.decorative-line {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 0 auto 24px;
  border-radius: 2px;
}

/* 引用块 */
blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 24px 0;
  background: rgba(85, 162, 160, 0.05);
  font-style: italic;
  color: var(--text-secondary);
}

/* 代码块 */
code {
  font-family: "Source Code Pro", Monaco, monospace;
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: var(--border);
}

th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--accent);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--main-color-dark);
}

/* 选择文本颜色 */
::selection {
  background: rgba(85, 162, 160, 0.3);
  color: var(--text-primary);
}