:root {
  --gray-900: #1a1a1a;
  --gray-800: #2d2d2d;
  --gray-700: #444;
  --gray-600: #555;
  --gray-300: #ccc;
  --gray-200: #e0e0e0;
  --gray-100: #f5f5f5;
  --white: #fff;
  --accent: #666;
  --shadow: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
  --gray-900: #f5f5f5;
  --gray-800: #e0e0e0;
  --gray-700: #ccc;
  --gray-600: #aaa;
  --gray-300: #555;
  --gray-200: #333;
  --gray-100: #1a1a1a;
  --white: #121212;
  --accent: #aaa;
  --shadow: rgba(0,0,0,0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background-color: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 主题切换按钮 */
#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--gray-800);
  color: var(--white);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 6px var(--shadow);
}

/* 返回顶部按钮 */
#back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--gray-800);
  color: var(--white);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  box-shadow: 0 2px 6px var(--shadow);
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* Header */
.header {
  background-color: var(--gray-900);
  color: var(--white);
  padding: 40px 0;
  text-align: center;
  transition: background-color 0.3s;
}

.logo {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 2px solid var(--gray-700);
}

.header h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.header p {
  color: var(--gray-300);
  font-size: 1.1rem;
}

/* Main */
.main {
  padding: 40px 0;
}

.main h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--gray-800);
  text-align: center;
}

.intro p {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 30px;
  font-size: 1.05rem;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.project-card {
  background: var(--white);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px var(--shadow);
}

.project-card h3 {
  color: var(--gray-800);
  margin-bottom: 12px;
}

.project-card p {
  color: var(--gray-600);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.project-card a {
  display: inline-block;
  padding: 8px 16px;
  background-color: var(--gray-800);
  color: var(--white);
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}

.project-card a:hover {
  background-color: var(--gray-700);
  text-decoration: none;
}

/* Contact */
.contact-info {
  text-align: center;
  margin-top: 20px;
}

.contact-info p {
  margin: 12px 0;
  font-size: 1.05rem;
}

/* Footer */
.footer {
  background-color: var(--gray-800);
  color: var(--gray-300);
  text-align: center;
  padding: 20px 0;
  font-size: 0.95rem;
  transition: background-color 0.3s, color 0.3s;
}

/* 响应式 */
@media (max-width: 600px) {
  .header h1 { font-size: 1.8rem; }
  .main h2 { font-size: 1.5rem; }
  #theme-toggle, #back-to-top {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}