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

/* ===== 亮色变量（默认）===== */
:root {
  --bg: #f5f7fa;
  --text: #2c3e50;
  --text-light: #888;
  --card-bg: #fff;
  --card-shadow: rgba(0,0,0,0.06);
  --primary: #ff6b6b;
  --primary-dark: #e05555;
  --gradient-btn: linear-gradient(135deg, #ff6b6b 0%, #f093fb 100%);
  --gradient-btn-hover: linear-gradient(135deg, #e05555 0%, #d47ae8 100%);
  --gradient-other: linear-gradient(135deg, #00FFFF 0%, #00FF80 100%);
  --skill-bg: #ffa500;
  --links-bg: #2c3e50;
  --links-hover: #ff6b6b;
  --border-h2: #ff6b6b;
  --footer-text: #aaa;
  --clock-opacity: 0.7;
}

/* ===== 暗色覆写（系统深色模式时自动生效）===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f1a;
    --text: #e0e0e0;
    --text-light: #999;
    --card-bg: #1a1a2e;
    --card-shadow: rgba(0,0,0,0.3);
    --primary: #ff6b6b;
    --primary-dark: #cc4444;
    --gradient-btn: linear-gradient(135deg, #ff6b6b 0%, #c77dff 100%);
    --gradient-btn-hover: linear-gradient(135deg, #e05555 0%, #a855f7 100%);
    --gradient-other: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
    --skill-bg: #d97706;
    --links-bg: #1e1e32;
    --links-hover: #ff6b6b;
    --border-h2: #ff6b6b;
    --footer-text: #666;
    --clock-opacity: 0.5;
  }

  body {
    background: var(--bg);
  }

  img.avatar {
    filter: brightness(0.85);
  }
}

/* ===== Body ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ===== 整体容器 ===== */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ===== 右上角时间 ===== */
#clock {
  position: fixed;
  top: 24px;
  right: 12px;
  font-size: 0.85rem;
  color: var(--text-light);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", monospace;
  letter-spacing: 0.5px;
  opacity: var(--clock-opacity);
  z-index: 999;
  user-select: none;
}

/* ===== 头部 ===== */
header {
  text-align: center;
  margin-bottom: 20px;
}
.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 6px;
  box-shadow: 0 4px 12px var(--card-shadow);
}
header h1 { font-size: 1.6rem; margin-bottom: 2px; }
.tagline { color: var(--text-light); font-size: 1rem; }

/* ===== 各模块通用 ===== */
section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px var(--card-shadow);
  transition: background 0.3s, box-shadow 0.3s;
}
section h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-h2);
  display: inline-block;
}

/* ===== 标签 ===== */
.skills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.skills li {
  background: var(--skill-bg);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #fff;
}

/* ===== 项目链接按钮 ===== */
.button-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
}
.button-group a {
  flex: 1 1 calc(33% - 12px);   /* 原 25% 改 33%，3 个按钮更合理 */
  padding: 8px 22px;
  background: var(--gradient-btn);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  text-align: center;
  box-sizing: border-box;
}
.button-group a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
  background: var(--gradient-btn-hover);
}
.button-group a:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* ===== 资源按钮 ===== */
.links { display: flex; gap: 12px; flex-wrap: wrap; }
.links a {
  flex: 1; min-width: 120px;
  text-align: center;
  padding: 10px 0;
  border-radius: 8px;
  background: var(--links-bg);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.links a:hover { background: var(--links-hover); }

/* ===== 其他按钮 ===== */
.other {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}
.other a {
  flex: 1 1 calc(33% - 12px);
  padding: 8px 22px;
  background: var(--gradient-other);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 25px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  text-align: center;
  box-sizing: border-box;
}
.other a:hover {
  filter: brightness(1.1);
}

/* ===== 透明按钮 ===== */
.transparent-button {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.transparent-button a {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 10px 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 2px solid var(--text-light);
  transition: all 0.3s ease;
  box-sizing: border-box;
}
.transparent-button a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== 页脚 ===== */
footer {
  text-align: center;
  color: var(--footer-text);
  font-size: 0.85rem;
  margin-top: 20px;
}
