/* =============================================
   非凡像素 - Linear Design System Inspired
   Based on DESIGN.md from Linear.app
   ============================================= */

:root {
  /* === Surface / Background (Luminance Stacking) === */
  --bg:             #08090a;   /* Marketing Black – deepest canvas */
  --bg-panel:       #0f1011;   /* Panel Dark – header, footer */
  --bg-surface:     #191a1b;   /* Level 3 – elevated surfaces */
  --bg-card:        rgba(255,255,255,0.02);  /* Card surfaces – translucent, never solid */
  --bg-card-hover:  rgba(255,255,255,0.05);  /* Card hover state */

  /* === Text (cool grayscale hierarchy) === */
  --text:           #d0d6e0;   /* Silver Gray – body text */
  --text-bright:    #f7f8f8;   /* Primary White – headings (NOT pure white) */
  --text-dim:       #8a8f98;   /* Tertiary Gray – muted text */
  --text-faint:     #62666d;   /* Quaternary Gray – timestamps, disabled */

  /* === Brand Accent (indigo-violet, the ONLY chromatic color) === */
  --accent:         #5e6ad2;   /* Brand Indigo – CTA backgrounds */
  --accent-bright:  #7170ff;   /* Accent Violet – links, active states */
  --accent-hover:   #828fff;   /* Lighter variant – hover states */
  --accent-glow:    rgba(94, 106, 210, 0.10);

  /* === Borders (semi-transparent white, whisper-thin) === */
  --border:         rgba(255,255,255,0.08);  /* Standard border */
  --border-subtle:  rgba(255,255,255,0.05);  /* Subtle border */

  /* === Tags / Pills === */
  --tag-bg:         rgba(255,255,255,0.05);
  --tag-text:       #d0d6e0;
  --tag-border:     rgba(255,255,255,0.08);

  /* === Typography === */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  --font-mono: 'Berkeley Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', 'Menlo', 'Consolas', monospace;

  /* === Layout === */
  --max-width: 780px;

  /* === Border Radius (Linear scale) === */
  --radius-micro: 2px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-feature-settings: "cv01", "ss03";  /* Linear's signature Inter tweaks */
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Header ===== */
.site-header {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.5rem 1.5rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-title {
  font-size: 1.5rem;
  font-weight: 590;
  color: var(--text-bright);
  letter-spacing: -0.5px;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-title .pixel {
  color: var(--accent-bright);
}

.site-subtitle {
  font-size: 0.81rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 0.25rem;
  letter-spacing: -0.13px;
}

.site-nav {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.81rem;
  font-weight: 510;  /* Linear's signature weight */
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  letter-spacing: -0.13px;
}

.site-nav a:hover {
  color: var(--text-bright);
  background: rgba(255,255,255,0.04);
  border-color: var(--border-subtle);
}

.site-nav a.active {
  color: var(--text-bright);
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
}

/* ===== Main Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* ===== Page Header ===== */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 510;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
  letter-spacing: -0.288px;
  line-height: 1.33;
}

.page-header p {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.page-header p a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.15s;
}

.page-header p a:hover {
  color: var(--accent-hover);
}

/* ===== Post List ===== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.12);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.post-date {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-weight: 400;
}

.post-tag {
  font-size: 0.69rem;
  font-weight: 510;
  background: transparent;
  color: var(--tag-text);
  padding: 0.1rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.08);
}

.post-title {
  font-size: 1.05rem;
  font-weight: 510;
  color: var(--text-bright);
  line-height: 1.4;
  margin-bottom: 0.35rem;
  letter-spacing: -0.165px;
}

.post-excerpt {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.165px;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 0.75rem;
  font-weight: 510;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* ===== Article Page ===== */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-header .post-meta {
  margin-bottom: 0.8rem;
}

.article-title {
  font-size: 2rem;
  font-weight: 510;
  color: var(--text-bright);
  line-height: 1.13;
  margin-bottom: 0.8rem;
  letter-spacing: -0.704px;
}

.article-desc {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  letter-spacing: -0.165px;
}

/* ===== Article Content ===== */
.article-content h1 {
  font-size: 1.5rem;
  font-weight: 510;
  margin: 2.5rem 0 1rem;
  color: var(--text-bright);
  letter-spacing: -0.288px;
  line-height: 1.33;
}

.article-content h2 {
  font-size: 1.25rem;
  font-weight: 510;
  margin: 2rem 0 0.8rem;
  color: var(--text-bright);
  letter-spacing: -0.24px;
  line-height: 1.33;
}

.article-content h3 {
  font-size: 1.06rem;
  font-weight: 590;
  margin: 1.5rem 0 0.6rem;
  color: var(--text-bright);
  line-height: 1.6;
}

.article-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
  letter-spacing: -0.165px;
}

.article-content a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.15s;
}

.article-content a:hover {
  color: var(--accent-hover);
}

.article-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.75rem 1.2rem;
  margin: 1.2rem 0;
  background: rgba(255,255,255,0.02);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255,255,255,0.05);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-micro);
  border: 1px solid var(--border-subtle);
  color: var(--text-bright);
}

.article-content pre {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow-x: auto;
  margin: 1.2rem 0;
}

.article-content pre code {
  display: block;
  padding: 1.2rem;
  background: none;
  border: none;
  font-size: 0.85rem;
}

.article-content pre code.hljs {
  background: #0d1117;
  border-radius: var(--radius);
}

.article-content ul, .article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.article-content li {
  margin-bottom: 0.3rem;
  line-height: 1.6;
  letter-spacing: -0.165px;
}

.article-content strong {
  color: var(--text-bright);
  font-weight: 590;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 2rem 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.88rem;
}

.article-content th, .article-content td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
}

.article-content th {
  background: rgba(255,255,255,0.03);
  color: var(--text-bright);
  font-weight: 510;
  font-size: 0.81rem;
}

.article-content img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1rem 0;
}

/* ===== Back Link ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.81rem;
  font-weight: 510;
  margin-bottom: 1.5rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  letter-spacing: -0.13px;
}

.back-link:hover {
  color: var(--text-bright);
  background: rgba(255,255,255,0.04);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-faint);
}

/* ===== Section Divider ===== */
.section-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 3rem 0;
}

/* ===== Gallery ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.gallery-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.12);
}

.gallery-img-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

.gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-img-wrap img {
  transform: scale(1.03);
}

.gallery-info {
  padding: 0.75rem 1rem;
}

.gallery-info .post-title {
  font-size: 0.88rem;
  font-weight: 510;
  margin-bottom: 0.25rem;
}

.gallery-info .post-meta {
  margin-bottom: 0.2rem;
}

.gallery-artist {
  font-size: 0.69rem;
  color: var(--text-faint);
  margin-top: 0.15rem;
  font-weight: 400;
}

/* Gallery Detail Page */
.gallery-detail-img {
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  text-align: center;
}

.gallery-detail-img img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.gallery-artist-detail {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* ===== Year Group ===== */
.year-group {
  margin-bottom: 2rem;
}

.year-label {
  font-size: 0.88rem;
  font-weight: 510;
  color: var(--accent-bright);
  font-family: var(--font-mono);
  margin-bottom: 0.8rem;
}

/* ===== Twitter Link Card ===== */
.twitter-link-card {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.twitter-card-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.twitter-card-inner:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
}

.twitter-card-icon {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-bright);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.twitter-card-username {
  font-size: 0.94rem;
  font-weight: 510;
  color: var(--text-bright);
}

.twitter-card-action {
  font-size: 0.81rem;
  color: var(--text-dim);
  margin-top: 2px;
  font-weight: 400;
}

.twitter-card-arrow {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--accent-bright);
  font-weight: 510;
  flex-shrink: 0;
}

.twitter-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text-bright);
  font-size: 0.69rem;
  font-weight: 510;
  padding: 2px 6px;
  border-radius: var(--radius-micro);
  border: 1px solid rgba(255,255,255,0.08);
  z-index: 2;
}

.gallery-twitter-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--bg-surface);
  border-radius: var(--radius) var(--radius) 0 0;
}

.twitter-placeholder-icon {
  font-size: 3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-header {
    padding: 1.2rem 1rem;
  }

  .site-nav {
    gap: 0.15rem;
  }

  .site-nav a {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .article-title {
    font-size: 1.5rem;
    letter-spacing: -0.288px;
  }

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

  .post-card {
    padding: 1rem 1.2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
  }

  .page-header h1 {
    font-size: 1.25rem;
  }
}
