/* ============================================================
   zsztwrt 的代码池 - 主样式表
   ============================================================ */

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

/* ── Theme tokens ── */
:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f5;
  --bg-card: #fafaf8;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-hint: #9e9e9e;
  --accent: #534AB7;
  --accent-light: #EEEDFE;
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Cascadia Code', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(255,255,255,0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100% - 900px) / 2));
  z-index: 100;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--accent);
}

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

.nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── Layout ── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 10px 0 60px;
}

section:first-child {
  padding-top: 140px;
}

/* ── Hero ── */
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
}

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

.hero-desc {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 36px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: #453fa0; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hover);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}

/* ── Stats Row ── */
.stats {
  display: flex;
  gap: 40px;
  padding: 36px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 60px;
  flex-wrap: wrap;
}

.stat-item {}

.stat-number {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-hint);
  margin-top: 4px;
}

/* ── Section Header ── */
.section-header {
  margin-bottom: 40px;
}

.section-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.section-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: stretch;
}

@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

.about-text,
.skills-section {
  display: flex;
  flex-direction: column;
}

.about-text {
  justify-content: center;
}

.skills-section {
  justify-content: space-between;
  gap: 20px;
}

.skills-section .skills-group:last-child {
  margin-bottom: 0;
}

.about-text p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 16px;
}

.about-text p:last-child { margin-bottom: 0; }

.skill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--mono);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.skills-section h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-hint);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.skills-group {
  margin-bottom: 20px;
}

/* ── Projects ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

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

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

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

.project-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 16px;
}

.project-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.project-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tag {
  font-size: 11px;
  font-family: var(--mono);
  background: var(--bg-subtle);
  color: var(--text-hint);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.footer-beian {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.beian-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-hint);
  text-decoration: none;
  transition: color 0.2s;
}

.beian-item:hover { color: var(--text-muted); }

.beian-item img {
  width: 14px;
  height: 14px;
  opacity: 0.55;
}

.footer-left {
  font-size: 13px;
  color: var(--text-hint);
}

.footer-right {
  display: flex;
  gap: 20px;
}

.footer-link {
  font-size: 13px;
  color: var(--text-hint);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover { color: var(--text); }

/* ── Contact ── */
.contact-desc {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 480px;
  margin-bottom: 32px;
}

.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Cursor blink ── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
