@import url('https://fonts.loli.net/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   TPZ Blog — Soft Modern Design System
   ============================================================ */

:root {
  --bg-body: #faf9f7;
  --bg-section: #f2f0f5;
  --text-main: #1e1b2e;
  --text-secondary: #787580;
  --link-color: #4f46e5;
  --link-hover: #4338ca;
  --btn-primary: #4f46e5;
  --btn-primary-hover: #4338ca;
  --card-bg: #ffffff;
  --card-radius: 16px;
  --nav-bg: rgba(250, 249, 247, 0.85);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', Consolas, 'Source Code Pro', monospace;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.08);
  --primary-glow: rgba(79, 70, 229, 0.12);
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --card-hover-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
  --border-color: #e4e2ed;
  --border-subtle: #e8e6f0;
}

/* ---- Dark Mode ---- */
body.theme-dark,
.theme-dark {
  --bg-body: #0f0e17;
  --bg-section: #1a1928;
  --text-main: #e4e2ed;
  --text-secondary: #908da0;
  --link-color: #818cf8;
  --link-hover: #a5b4fc;
  --btn-primary: #6366f1;
  --btn-primary-hover: #818cf8;
  --card-bg: #1a1928;
  --nav-bg: rgba(15, 14, 23, 0.9);
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  --card-hover-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
  --border-color: #2a2840;
  --border-subtle: #252338;
}

/* ============================================================
   Reset & Base
   ============================================================ */

html {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

body {
  margin: 0;
  padding: 0;
  padding-top: 52px;
  font-family: var(--font);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.is-ready main {
  animation: pageFadeIn 0.32s ease both;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.is-navigating::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--btn-primary), var(--link-hover), var(--btn-primary));
  background-size: 200% 100%;
  animation: pageProgress 1s linear infinite;
  z-index: 10002;
}

@keyframes pageProgress {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}

/* ============================================================
   Links
   ============================================================ */

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

a:hover {
  color: var(--link-hover);
}

/* Underline animation on hover for content links */
.page-content a:not(.btn):not(.btn-primary):not(.btn-outline):not(.btn-secondary):not(nav a):not(.pager a):not(.view-all):not(.brand),
.article-body a:not(.btn):not(.btn-primary):not(.btn-outline) {
  background-image: linear-gradient(var(--link-color), var(--link-color));
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.25s ease, color 0.2s ease;
}
.page-content a:not(.btn):not(.btn-primary):not(.btn-outline):not(.btn-secondary):not(nav a):not(.pager a):not(.view-all):not(.brand):hover,
.article-body a:not(.btn):not(.btn-primary):not(.btn-outline):hover {
  background-size: 100% 1px;
}

/* ============================================================
   Header & Navigation
   ============================================================ */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  height: 52px;
  font-size: 14px;
  transition: all 0.3s ease, background-color 0.3s ease;
}

.header-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  height: 52px;
  font-size: 14px;
  transition: all 0.3s ease, background-color 0.3s ease;
}

header .container {
  max-width: 980px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  position: relative;
}

header .brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-main);
  text-decoration: none !important;
  background-image: none !important;
  z-index: 102;
  position: relative;
  letter-spacing: -0.02em;
}

/* ---- Mobile Controls ---- */
.mobile-controls {
  display: none;
  z-index: 102;
}
.mobile-controls.left {
}
.mobile-controls.right {
  gap: 16px;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  padding: 4px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.icon-btn:hover {
  opacity: 1;
}

/* ---- Nav Links ---- */
nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

nav a {
  color: var(--text-main);
  opacity: 0.72;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none !important;
  background-image: none !important;
  transition: opacity 0.2s, color 0.2s;
  white-space: nowrap;
}
nav a:hover {
  opacity: 1;
  color: var(--text-main);
}
nav a.active {
  opacity: 1;
  color: var(--link-color);
  position: relative;
}
nav a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--link-color);
  border-radius: 2px;
}

.desktop-only {
  display: flex;
}

/* ---- Theme Toggle ---- */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s, background-color 0.2s;
}
.theme-toggle:hover {
  opacity: 1;
  background-color: rgba(128, 128, 128, 0.1);
}

/* ---- Mobile Menu Toggle ---- */
.mobile-menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0;
  z-index: 103;
  position: relative;
}
.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-main);
  margin: 5px 0;
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide header when search is open */
body.search-open header {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}
body.search-open .search-overlay {
  visibility: visible;
  opacity: 1;
}

/* ============================================================
   Main Layout
   ============================================================ */

main {
  width: 100%;
  overflow-x: hidden;
  flex: 1;
}

.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ============================================================
   Typography & Page Content
   ============================================================ */

.page-content {
  padding-top: 60px;
  padding-bottom: 80px;
}

.page-content h1 {
  font-size: 48px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  color: var(--text-main);
}

.page-content h2 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 50px;
  margin-bottom: 20px;
  color: var(--text-main);
}

.page-content h3 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 36px;
  margin-bottom: 16px;
  color: var(--text-main);
}

.page-content p, .page-content ul, .page-content ol {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 1.5em;
  color: var(--text-main);
}
.page-content ul, .page-content ol {
  padding-left: 24px;
}
.page-content li {
  margin-bottom: 0.5em;
}
.page-content .muted {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: -30px;
  margin-bottom: 40px;
}

/* ---- Global Hero Kicker badge ---- */
.hero-kicker {
  display: inline-block;
  padding: 5px 16px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--btn-primary);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 0.6rem;
  border: 1px solid rgba(79, 70, 229, 0.12);
}

/* ---- Page Intro (blog listing, etc.) ---- */
.page-intro {
  padding: 40px 0 20px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  letter-spacing: -0.005em;
}

.btn-primary {
  background: var(--link-color);
  color: #fff;
  border: 1px solid var(--link-color);
}
.btn-primary:hover {
  background: var(--link-hover);
  border-color: var(--link-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  color: var(--link-color);
  border: 1.5px solid var(--link-color);
}
.btn-outline:hover {
  background: var(--link-color);
  color: #fff;
}

.btn-secondary {
  color: var(--link-color);
  font-size: 17px;
  font-weight: 500;
}
.btn-secondary:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

/* ============================================================
   Section Header
   ============================================================ */

.section-header-group {
  margin: 60px auto 20px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
  padding: 0 10px;
}
.section-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text-main);
  letter-spacing: -0.018em;
}
.view-all {
  font-size: 15px;
  font-weight: 500;
  color: var(--link-color);
}

/* ============================================================
   Post List
   ============================================================ */

.post-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.post-list.is-loading {
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

@media (max-width: 900px) {
  .post-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .post-list {
    grid-template-columns: 1fr;
  }
  .post-item .content-wrap {
    padding: 12px 14px 16px;
  }
}

.post-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: cardFadeUp 0.35s ease both;
}

@keyframes cardFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) {
  .post-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
  }
}

.post-item .cover-image,
.post-item img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 0;
  background-color: var(--bg-section);
  transform: translateZ(0);
  transition: transform 0.35s ease;
}

.post-item .content-wrap {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Staggered card entrance */
.post-item:nth-child(1) { animation-delay: 0s; }
.post-item:nth-child(2) { animation-delay: 0.06s; }
.post-item:nth-child(3) { animation-delay: 0.12s; }
.post-item:nth-child(4) { animation-delay: 0.04s; }
.post-item:nth-child(5) { animation-delay: 0.10s; }
.post-item:nth-child(6) { animation-delay: 0.16s; }
.post-item:nth-child(7) { animation-delay: 0.08s; }
.post-item:nth-child(8) { animation-delay: 0.14s; }
.post-item:nth-child(9) { animation-delay: 0.20s; }
.post-item .meta {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.post-item .badge {
  color: var(--link-color);
  font-weight: 600;
}
.post-item h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.post-item h3 a {
  color: var(--text-main);
  transition: color 0.2s ease;
}
@media (hover: hover) {
  .post-item:hover h3 a {
    color: var(--link-color);
  }
}
.post-item p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: auto;
}

/* ============================================================
   Utilities
   ============================================================ */

.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }
.mb-60 { margin-bottom: 60px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }

/* ============================================================
   Typography Globals
   ============================================================ */

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.018em;
}
p {
  line-height: 1.65;
  color: var(--text-main);
}
.section-title {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 600;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .section-title { font-size: 32px; }
}

/* ============================================================
   Paginator
   ============================================================ */

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 60px;
}
.pager a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  background-color: var(--bg-section);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
}
.pager a:hover {
  background-color: var(--border-color);
  text-decoration: none;
}
.pager a.active {
  background-color: var(--btn-primary);
  color: #fff;
  font-weight: 600;
  cursor: default;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.pager a.active:hover {
  background-color: var(--btn-primary);
}

/* ============================================================
   Footer
   ============================================================ */

footer {
  background-color: var(--bg-section);
  padding: 48px 0;
  margin-top: 60px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}
footer .links {
  margin: 12px 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
footer a {
  color: var(--text-main);
  font-weight: 500;
}
footer .muted {
  margin-top: 10px;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ============================================================
   Mobile Responsive
   ============================================================ */

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .mobile-controls {
    display: flex;
    align-items: center;
  }

  .desktop-only {
    display: none !important;
  }

  header .container {
    justify-content: space-between;
  }

  nav {
    position: fixed;
    top: 52px;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--bg-body);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
    padding-top: 60px;
    overflow: hidden;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--border-color);
    visibility: hidden;
  }

  header.nav-open {
    height: 100vh;
    background: rgba(250, 249, 247, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    overflow-y: auto;
  }
  body.theme-dark header.nav-open {
    background: rgba(15, 14, 23, 0.96);
  }

  header.nav-open nav {
    height: auto;
    opacity: 1;
    pointer-events: auto;
    padding: 80px 0 40px;
    box-shadow: none;
    background: transparent;
    visibility: visible;
  }

  nav a {
    width: 100%;
    padding: 16px 40px;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 28px;
    font-weight: 600;
    opacity: 0;
    animation: fadeInSlide 0.5s forwards;
    transform: translateY(20px);
    display: block;
    color: var(--text-main);
  }
  nav a:nth-child(1) { animation-delay: 0.1s; }
  nav a:nth-child(2) { animation-delay: 0.15s; }
  nav a:nth-child(3) { animation-delay: 0.2s; }
  nav a:nth-child(4) { animation-delay: 0.25s; }
  nav a:nth-child(5) { animation-delay: 0.3s; }

  @keyframes fadeInSlide {
    to { opacity: 1; transform: translateY(0); }
  }

  nav a:last-of-type {
    border-bottom: none;
  }

  header.nav-open .theme-toggle {
    display: flex;
    width: 100%;
    height: 60px;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    justify-content: flex-start;
    padding: 0 40px;
    font-size: 17px;
    opacity: 0;
    animation: fadeInSlide 0.5s forwards;
    animation-delay: 0.4s;
    margin-top: 0;
    color: var(--text-main);
  }
  header.nav-open .theme-toggle::after {
    content: "切换外观模式";
    margin-left: 10px;
    font-weight: 600;
    color: var(--text-main);
  }

  .theme-toggle {
    display: none;
  }
  header.nav-open .theme-toggle {
    display: flex;
  }

  header.nav-open .mobile-menu-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  header.nav-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }
  header.nav-open .mobile-menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(4.5px, -4.5px);
  }

  .page-content h1 {
    font-size: 36px;
  }
  .page-content h2 {
    font-size: 28px;
  }

  .section-header {
    flex-direction: row;
    align-items: center;
  }
  .section-title {
    font-size: 28px;
  }

  footer .links {
    flex-direction: column;
    gap: 10px;
  }
}

@media (min-width: 769px) {
  .theme-toggle {
    display: flex !important;
  }
}

@media (max-width: 480px) {
}

/* ============================================================
   Search Overlay
   ============================================================ */

#search-overlay,
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(250, 249, 247, 0.94);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: center;
  padding-top: 100px;
}

body.theme-dark #search-overlay,
body.theme-dark .search-overlay {
  background: rgba(15, 14, 23, 0.94);
}

#search-overlay.active,
.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-container {
  width: 100%;
  max-width: 680px;
  padding: 0 20px;
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.search-bar {
  display: flex;
  align-items: center;
  position: relative;
  margin-bottom: 40px;
  padding-bottom: 0;
  border-bottom: none;
}

.search-icon {
  color: var(--text-secondary);
  position: absolute;
  left: 12px;
  width: 20px;
  height: 20px;
  z-index: 1;
}

#search-input {
  width: 100%;
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  background: var(--card-bg);
  font-size: 17px;
  color: var(--text-main);
  outline: none;
  font-weight: 400;
  padding: 12px 40px 12px 40px;
  line-height: 1.4;
  transition: all 0.2s ease;
  font-family: var(--font);
}

#search-input:focus {
  background: var(--card-bg);
  border-color: var(--link-color);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

body.theme-dark #search-input:focus {
  background: var(--card-bg);
}

#search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.close-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  transition: opacity 0.2s;
  display: none;
}

.search-cancel-btn {
  margin-left: 12px;
  color: var(--link-color);
  font-size: 17px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
}
.search-cancel-btn:hover {
  color: var(--link-hover);
}

/* ---- Search Type Switch ---- */
.search-type-switch {
  display: flex;
  background: var(--bg-section);
  padding: 3px;
  border-radius: 10px;
  margin-bottom: 20px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.switch-btn {
  border: none;
  background: none;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: var(--font);
}
.switch-btn.active {
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}
body.theme-dark .switch-btn.active {
  background: #2a2840;
  color: #e4e2ed;
}

/* ---- Search Results ---- */
.search-results {
  margin-top: 20px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}
.search-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.search-list li {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}
.search-list li:last-child {
  border-bottom: none;
}
.search-list a {
  text-decoration: none;
  display: block;
}
.search-list h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: var(--link-color);
}
.search-list p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.google-hint {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 40px;
}
.no-results {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 40px;
}

/* ---- Search: Mobile ---- */
@media (max-width: 768px) {
  .search-overlay,
  #search-overlay {
    padding-top: 0;
    align-items: flex-start;
    display: block;
    background: var(--bg-body);
  }
  .search-container {
    padding: 8px 16px;
    margin-top: 0;
    width: 100%;
    max-width: none;
    background: rgba(250, 249, 247, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
  }
  .search-bar { order: 1; margin-bottom: 8px; }
  .search-type-switch {
    order: 2;
    margin-bottom: 0;
    width: 100%;
    justify-content: center;
    background: transparent;
  }
  .search-type-switch .switch-btn {
    flex: 1;
    text-align: center;
    padding: 8px 0;
  }
  .search-type-switch .switch-btn.active {
    background: var(--card-bg);
  }
  body.theme-dark .search-type-switch .switch-btn.active {
    background: #2a2840;
  }

  .search-results {
    order: 3;
    padding: 20px;
    background: var(--bg-body);
    height: calc(100vh - 100px);
  }

  body.theme-dark .search-container {
    background: rgba(15, 14, 23, 0.96);
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .search-bar {
    margin-bottom: 8px;
    height: 44px;
    padding-bottom: 0;
    border-bottom: none;
  }
  .search-icon {
    top: 50%;
    transform: translateY(-50%);
    left: 24px;
  }
  #search-input {
    font-size: 16px;
    padding: 8px 36px 8px 36px;
    height: 36px;
  }
  .search-cancel-btn {
    font-size: 16px;
  }
}

/* ---- Search: Desktop ---- */
@media (min-width: 769px) {
  .search-overlay,
  #search-overlay {
    padding-top: 15vh;
    background: rgba(250, 249, 247, 0.88);
  }
  body.theme-dark .search-overlay,
  body.theme-dark #search-overlay {
    background: rgba(15, 14, 23, 0.88);
  }
  .search-container {
    background: transparent;
    animation: slideDown 0.3s ease-out forwards;
  }
  #search-input {
    height: 56px;
    font-size: 22px;
    padding-left: 56px;
    padding-right: 20px;
    background: var(--card-bg);
    border: 1.5px solid transparent;
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    color: var(--text-main);
  }
  #search-input:focus {
    background: var(--card-bg);
    border-color: var(--link-color);
    box-shadow: 0 0 0 4px var(--primary-glow);
  }
  body.theme-dark #search-input {
    background: var(--card-bg);
  }
  body.theme-dark #search-input:focus {
    background: var(--card-bg);
  }
  .search-icon {
    width: 28px;
    height: 28px;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
  }
  .search-bar {
    margin-bottom: 40px;
    position: relative;
  }
  .search-cancel-btn {
    font-size: 20px;
    display: block;
  }
  .search-type-switch {
    margin-bottom: 30px;
    transform: scale(1.15);
  }
}

/* ============================================================
   Contact QR Grid
   ============================================================ */

.contact-qr-grid {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 40px;
}
.qr-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.qr-image-wrapper {
  width: 150px;
  height: 150px;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  margin-bottom: 12px;
  cursor: zoom-in;
  background: #fff;
  position: relative;
  padding: 10px;
}
.qr-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
  display: block;
}
.qr-image-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3) url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="11" cy="11" r="8"%3E%3C/circle%3E%3Cline x1="21" y1="21" x2="16.65" y2="16.65"%3E%3C/line%3E%3Cline x1="11" y1="8" x2="11" y2="14"%3E%3C/line%3E%3Cline x1="8" y1="11" x2="14" y2="11"%3E%3C/line%3E%3C/svg%3E') center no-repeat;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.qr-image-wrapper:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.qr-image-wrapper:hover img {
  transform: scale(1.02);
}
.qr-image-wrapper:hover::after {
  opacity: 1;
}
.qr-item p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ---- QR Zoom Overlay ---- */
.qr-zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10001;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  cursor: zoom-out;
}
.qr-zoom-overlay.active {
  opacity: 1;
  visibility: visible;
}
.qr-zoom-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.qr-zoom-overlay.active img {
  transform: scale(1);
}

/* ============================================================
   Generated Article — Soft Modern Typography
   ============================================================ */

.generated-article {
  max-width: 860px;
  margin: 0 auto;
}
.generated-article .article-header {
  margin-bottom: 32px;
}
.generated-article .article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.5px;
  margin: 0.5rem 0 0.75rem;
}
.generated-article .hero-kicker {
  display: inline-block;
  padding: 5px 16px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--btn-primary);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 0.6rem;
  border: 1px solid rgba(79, 70, 229, 0.12);
}

.generated-article .article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  margin: 24px 0 12px;
  background: var(--bg-section);
}

.generated-article .article-body {
  font-size: 18px;
  line-height: 1.82;
  color: var(--text-main);
}
.generated-article .article-body > *:first-child {
  margin-top: 0;
}
.generated-article .article-body > *:last-child {
  margin-bottom: 0;
}
.generated-article .article-body p,
.generated-article .article-body ul,
.generated-article .article-body ol,
.generated-article .article-body blockquote,
.generated-article .article-body pre,
.generated-article .article-body table {
  margin-bottom: 1.4em;
}
.generated-article .article-body ul,
.generated-article .article-body ol {
  padding-left: 1.5em;
}
.generated-article .article-body li {
  margin-bottom: 0.45em;
}
.generated-article .article-body li::marker {
  color: var(--btn-primary);
}
.generated-article .article-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 2.2em 0 0.7em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-section);
  letter-spacing: -0.3px;
}
.generated-article .article-body h3 {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.4;
  margin: 1.6em 0 0.55em;
}
.generated-article .article-body a {
  color: var(--btn-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
  word-break: break-word;
}
.generated-article .article-body a:hover {
  border-bottom-color: var(--btn-primary);
}
.generated-article .article-body strong {
  font-weight: 650;
}

/* ---- Blockquote ---- */
.generated-article .article-body blockquote {
  margin: 1.4em 0;
  padding: 20px 24px;
  border-left: 4px solid var(--btn-primary);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, rgba(79, 70, 229, 0.01) 100%);
  border-radius: 0 14px 14px 0;
  color: var(--text-secondary);
  font-style: normal;
  box-shadow: var(--shadow-sm);
}
.generated-article .article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* ---- Images ---- */
.generated-article .article-body img,
.generated-article .article-body figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.4em auto;
  box-shadow: 0 8px 24px rgba(15,23,42,0.08);
  background: var(--bg-section);
}
.generated-article .article-body figure {
  margin: 1.4em 0;
  text-align: center;
}

/* ---- Tables ---- */
.generated-article .article-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  font-size: 0.94em;
}
.generated-article .article-body th,
.generated-article .article-body td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.generated-article .article-body th {
  background: var(--bg-section);
  font-weight: 650;
  font-size: 0.9em;
  color: var(--text-secondary);
}
.generated-article .article-body tr:last-child td {
  border-bottom: none;
}
.generated-article .article-body tbody tr:hover {
  background: rgba(79, 70, 229, 0.03);
}

/* ---- Code Blocks ---- */
.generated-article .article-body pre {
  position: relative;
  overflow-x: auto;
  padding: 0;
  border-radius: 14px;
  background: #1e293b;
  color: #e2e8f0;
  margin: 1.6em 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 0 0 1px rgba(255,255,255,0.04) inset;
  border: none;
  counter-reset: code-line;
}

/* Language label bar */
.generated-article .article-body pre::before {
  content: attr(data-lang);
  display: block;
  height: 36px;
  background: #0f172a;
  border-radius: 14px 14px 0 0;
  padding: 0 16px;
  line-height: 36px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-image:
    radial-gradient(circle 6px, #ff5f56 40%, transparent 40%),
    radial-gradient(circle 6px, #ffbd2e 40%, transparent 40%),
    radial-gradient(circle 6px, #27ca40 40%, transparent 40%);
  background-position: 78px center, 98px center, 118px center;
  background-repeat: no-repeat;
}

.generated-article .article-body pre > code {
  display: block;
  padding: 18px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88em;
  line-height: 1.68;
  tab-size: 4;
  background: transparent !important;
  color: inherit !important;
  border-radius: 0 !important;
}

/* Line numbers via CSS counter — works with .code-line spans from enhance.js */
.generated-article .article-body pre.with-line-numbers > code {
  padding-left: 56px;
  position: relative;
}

.generated-article .article-body pre.with-line-numbers .code-line {
  display: block;
  counter-increment: code-line;
  position: relative;
}

.generated-article .article-body pre.with-line-numbers .code-line::before {
  content: counter(code-line);
  position: absolute;
  left: -40px;
  width: 32px;
  text-align: right;
  color: #64748b;
  font-size: 0.85em;
  user-select: none;
  pointer-events: none;
}

.generated-article .article-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
.generated-article .article-body :not(pre) > code {
  padding: 0.2em 0.5em;
  border-radius: 6px;
  background: rgba(79, 70, 229, 0.08);
  color: var(--btn-primary);
  font-weight: 500;
  white-space: nowrap;
}

/* ---- Article Footer ---- */
.article-post-footer {
  margin: 3rem 0 1.5rem;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--bg-section) 0%, var(--bg-body) 100%);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.article-post-footer .source-ref {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  word-break: break-all;
  min-width: 0;
}
.article-post-footer .source-ref a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.article-post-footer .source-ref a:hover {
  border-bottom-color: var(--link-color);
}
.article-post-footer .back-link {
  margin: 0;
  font-size: 0.92rem;
  flex-shrink: 0;
}
.article-post-footer .back-link a {
  color: var(--btn-primary);
  text-decoration: none;
  font-weight: 550;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(79, 70, 229, 0.06);
  transition: background 0.2s ease;
}
.article-post-footer .back-link a:hover {
  background: rgba(79, 70, 229, 0.12);
  text-decoration: none;
}

.article-footer-block {
  margin: 2.5rem 0 1.5rem;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--bg-section) 0%, var(--bg-body) 100%);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ---- Article: Mobile ---- */
@media (max-width: 768px) {
  .generated-article {
    padding: 0 16px;
  }
  .generated-article .article-header h1 {
    font-size: 1.55rem;
  }
  .generated-article .article-cover {
    border-radius: 16px;
  }
  .generated-article .article-body {
    font-size: 17px;
    line-height: 1.78;
  }
  .generated-article .article-body h2 {
    font-size: 1.35rem;
  }
  .generated-article .article-body h3 {
    font-size: 1.15rem;
  }
  .generated-article .article-body pre {
    border-radius: 12px;
  }
  .generated-article .article-body pre::before {
    height: 32px;
    border-radius: 12px 12px 0 0;
    line-height: 32px;
    font-size: 10px;
    background-image:
      radial-gradient(circle 5px, #ff5f56 40%, transparent 40%),
      radial-gradient(circle 5px, #ffbd2e 40%, transparent 40%),
      radial-gradient(circle 5px, #27ca40 40%, transparent 40%);
    background-position: 68px center, 84px center, 100px center;
  }
  .generated-article .article-body pre > code {
    padding: 14px 16px;
    font-size: 0.82em;
  }
  .generated-article .article-body pre.with-line-numbers > code {
    padding-left: 48px;
  }
  .generated-article .article-body pre.with-line-numbers .code-line::before {
    left: -34px;
    width: 26px;
    font-size: 0.78em;
  }
  .generated-article .article-body blockquote {
    padding: 14px 16px;
    border-radius: 0 12px 12px 0;
  }
  .generated-article .article-body table {
    display: block;
    overflow-x: auto;
  }
  .generated-article .article-body :not(pre) > code {
    white-space: normal;
    word-break: break-all;
  }
  .article-post-footer {
    padding: 20px;
    border-radius: 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .article-footer-block {
    padding: 20px;
    border-radius: 14px;
  }
}

@media (max-width: 480px) {
  .generated-article .article-header h1 {
    font-size: 1.35rem;
  }
  .generated-article .article-body {
    font-size: 16px;
    line-height: 1.75;
  }
  .generated-article .article-body h2 {
    font-size: 1.25rem;
  }
  .generated-article .article-body h3 {
    font-size: 1.08rem;
  }
}

/* ============================================================
   Reading Progress Bar
   ============================================================ */

#reading-progress {
  position: fixed;
  top: 52px;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9998;
  pointer-events: none;
  background: transparent;
}

#reading-progress::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--btn-primary), #818cf8, #a78bfa);
  border-radius: 0 3px 3px 0;
  transition: width 0.15s linear;
}

/* ============================================================
   Scroll-to-Top Button
   ============================================================ */

#scroll-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, box-shadow 0.2s ease;
  color: var(--text-main);
  -webkit-tap-highlight-color: transparent;
}

#scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scroll-to-top:hover {
  background: var(--bg-section);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

#scroll-to-top:active {
  transform: translateY(0) scale(0.95);
}

/* ============================================================
   Anchor Scroll Offset (fixed header compensation)
   ============================================================ */

h2[id], h3[id], h4[id] {
  scroll-margin-top: 72px;
}

/* ============================================================
   Focus Visible — Keyboard Accessibility
   ============================================================ */

:focus-visible {
  outline: 2.5px solid var(--link-color);
  outline-offset: 3px;
  border-radius: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   Image Blur-up Loading Effect
   ============================================================ */

img.lazy-blur {
  filter: blur(12px) saturate(0.6);
  transform: scale(1.04);
  transition: filter 0.5s ease, transform 0.5s ease;
}

img.lazy-blur.loaded {
  filter: blur(0) saturate(1);
  transform: scale(1);
}

/* ============================================================
   Selection Style
   ============================================================ */

::selection {
  background: rgba(79, 70, 229, 0.18);
  color: var(--text-main);
}

body.theme-dark ::selection {
  background: rgba(129, 140, 248, 0.24);
}

/* ============================================================
   Print Styles
   ============================================================ */

@media print {
  header, .header-nav, #site-header, #site-footer, footer,
  #scroll-to-top, #reading-progress, #search-overlay,
  .search-overlay, .pager, .toc {
    display: none !important;
  }

  body {
    padding-top: 0;
    background: #fff;
    color: #111;
    font-size: 14px;
    line-height: 1.6;
  }

  main {
    max-width: 100%;
    padding: 0 20px;
  }

  .post-item {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a { color: #111; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
}

/* ============================================================
   Reduced Motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body.is-ready main {
    animation: none;
  }

  body.is-navigating::after {
    display: none;
  }
}

/* ============================================================
   Homepage — Hero
   ============================================================ */

.hero-home {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 560px;
  padding: 100px 24px 90px;
  overflow: hidden;
  background: linear-gradient(165deg, #0f0e17 0%, #1a1540 25%, #2d1b69 50%, #1e1b4b 75%, #0f0e17 100%);
  color: #fff;
  text-align: center;
}

.hero-home__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Glow orbs */
.hero-home__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: orbDrift 12s ease-in-out infinite alternate;
}

.hero-home__orb--1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.7) 0%, transparent 70%);
  top: -15%;
  right: -8%;
  animation-delay: 0s;
}

.hero-home__orb--2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.5) 0%, transparent 70%);
  bottom: -10%;
  left: -5%;
  animation-delay: -4s;
}

@keyframes orbDrift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -15px) scale(1.04); }
  66% { transform: translate(-10px, 12px) scale(0.97); }
  100% { transform: translate(5px, -5px) scale(1.02); }
}

/* Subtle grid overlay */
.hero-home__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 70%);
}

.hero-home__content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-home__kicker {
  display: inline-block;
  padding: 4px 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.75);
  margin-bottom: 28px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero-home__title {
  font-size: clamp(2.5rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  color: #fff;
}

.hero-home__title span {
  background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 40%, #e9d5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-home__desc {
  font-size: 1.15rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.7);
  max-width: 520px;
  margin: 0 auto 36px;
  font-weight: 400;
}

.hero-home__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-home__btn {
  display: inline-flex;
  align-items: center;
  padding: 13px 30px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  letter-spacing: -0.005em;
}

.hero-home__btn--primary {
  background: #6366f1;
  color: #fff;
  box-shadow: 0 4px 18px rgba(99,102,241,0.35);
}
.hero-home__btn--primary:hover {
  background: #818cf8;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99,102,241,0.45);
  color: #fff;
}

.hero-home__btn--ghost {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-home__btn--ghost:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
  transform: translateY(-2px);
}

/* ============================================================
   Homepage — Highlights
   ============================================================ */

.highlights {
  padding: 80px 0 60px;
}

.highlights__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.highlights__sub {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.highlight-card {
  display: flex;
  flex-direction: column;
  padding: 30px 28px 26px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.highlight-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  box-shadow: inset 0 0 0 1.5px var(--link-color);
}

.highlight-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.highlight-card:hover::after {
  opacity: 1;
}

.highlight-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(129,140,248,0.06) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--btn-primary);
  margin-bottom: 20px;
  transition: transform 0.3s ease, background 0.3s ease;
}

.highlight-card:hover .highlight-card__icon {
  transform: scale(1.06);
  background: linear-gradient(135deg, rgba(99,102,241,0.18) 0%, rgba(129,140,248,0.1) 100%);
}

.highlight-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.highlight-card__desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 18px;
  flex: 1;
}

.highlight-card__link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--btn-primary);
  transition: color 0.2s ease;
}

.highlight-card:hover .highlight-card__link {
  color: var(--link-hover);
}

.highlight-card--sm {
  padding: 24px 28px;
}

/* ============================================================
   Homepage — Mission
   ============================================================ */

.mission {
  padding: 56px 0 64px;
  border-top: 1px solid var(--border-subtle);
  margin: 0 22px;
}

.mission .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 720px;
}

.mission__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  text-align: center;
}

.mission__num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--btn-primary);
  letter-spacing: -0.015em;
  line-height: 1;
}

.mission__label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.mission__divider {
  width: 1px;
  height: 48px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

/* ============================================================
   Homepage — Responsive
   ============================================================ */

@media (max-width: 768px) {
  .hero-home {
    min-height: 460px;
    padding: 80px 20px 70px;
  }

  .hero-home__orb--1 {
    width: 300px;
    height: 300px;
    top: -10%;
    right: -20%;
  }

  .hero-home__orb--2 {
    width: 240px;
    height: 240px;
    bottom: -8%;
    left: -15%;
  }

  .hero-home__desc {
    font-size: 1rem;
    max-width: 400px;
  }

  .hero-home__btn {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .highlights {
    padding: 50px 0 40px;
  }

  .highlights__grid,
  .highlights__sub {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .highlight-card {
    padding: 22px 20px 20px;
  }

  .highlight-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-bottom: 14px;
  }

  .mission {
    margin: 0 16px;
    padding: 40px 0 48px;
  }

  .mission .container {
    flex-direction: column;
    gap: 24px;
  }

  .mission__stat {
    flex-direction: row;
    gap: 12px;
  }

  .mission__num {
    font-size: 1.4rem;
    min-width: 90px;
    text-align: right;
  }

  .mission__label {
    font-size: 0.85rem;
  }

  .mission__divider {
    width: 60px;
    height: 1px;
  }
}

@media (max-width: 480px) {
  .hero-home {
    min-height: 400px;
    padding: 70px 16px 60px;
  }

  .hero-home__actions {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .hero-home__btn {
    width: 100%;
    max-width: 260px;
    justify-content: center;
  }

  .highlights {
    padding: 36px 0 30px;
  }
}
