@font-face {
  font-family: 'SF Pro Text';
  src: local('SF Pro Text'), local('SFProText-Regular'), local('Helvetica Neue'), local('Helvetica'), local('Arial'), sans-serif;
}

:root {
  --bg-body: #fff;
  --bg-section: #f5f5f7;
  --text-main: #1d1d1f;
  --text-secondary: #86868b;
  --link-color: #06c;
  --link-hover: #004499;
  --btn-primary: #0071e3;
  --btn-primary-hover: #0077ed;
  --border-color: #d2d2d7;
  --nav-bg: rgba(255, 255, 255, 0.8);
  --card-bg: #fff;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --card-hover-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

body.theme-dark {
  --bg-body: #000;
  --bg-section: #1d1d1f;
  --text-main: #f5f5f7;
  --text-secondary: #a1a1a6;
  --link-color: #2997ff;
  --link-hover: #47a3ff;
  --btn-primary: #0071e3;
  --btn-primary-hover: #0077ed;
  --border-color: #424245;
  --nav-bg: rgba(0, 0, 0, 0.8);
  --card-bg: #1d1d1f;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  --card-hover-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

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: 44px; /* Fixed header compensation */
  font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* Header */
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 rgba(0,0,0,0.16);
  height: 44px;
  font-size: 12px;
  transition: all 0.3s ease;
}
body.theme-dark header {
  border-bottom: 1px solid rgba(255,255,255,0.16);
}

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: 600;
  font-size: 17px;
  color: var(--text-main);
  text-decoration: none !important;
  z-index: 102; /* Above mobile menu */
  position: relative;
}

/* Mobile Controls */
.mobile-controls {
  display: none; /* Hidden on desktop */
  z-index: 102;
}
.mobile-controls.left {
  /* Left side controls */
}
.mobile-controls.right {
  /* Right side controls */
  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: 24px;
}

nav a {
  color: var(--text-main);
  opacity: 0.8;
  font-weight: 400;
  text-decoration: none !important;
  transition: opacity 0.2s;
  white-space: nowrap;
}
nav a:hover {
  opacity: 1;
}
nav a.active {
  opacity: 1;
  color: var(--link-color);
}

/* Desktop Only Helpers */
.desktop-only {
  display: flex;
}

/* Theme Toggle Button (Desktop) */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  padding: 4px;
  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; /* Tweak padding */
  z-index: 103; /* Ensure above header elements */
  position: relative;
}

/* Hide header when search is open to avoid clutter */
body.search-open header {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}
/* Ensure search overlay remains visible */
body.search-open .search-overlay {
  visibility: visible;
  opacity: 1;
}
.mobile-menu-toggle span {
  display: block;
  width: 18px; /* Slightly smaller */
  height: 1px; /* Thinner Apple style */
  background-color: var(--text-main);
  margin: 5px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Layout */
main {
  width: 100%;
  overflow-x: hidden;
  flex: 1; /* Pushes footer down */
}

.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.08349;
  font-weight: 700;
  letter-spacing: -0.003em;
  margin-bottom: 40px;
  color: var(--text-main);
}

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

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

.page-content p, .page-content ul, .page-content ol {
  font-size: 19px;
  line-height: 1.47059;
  margin-bottom: 1.47059em;
  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;
}

/* Hero Section */
section.hero {
  width: 100%;
  text-align: center;
  padding: 120px 0 80px;
  background-color: var(--bg-section);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
section.hero.has-bg {
  background-size: cover;
  background-position: center;
  color: #fff;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
section.hero .title {
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 10px;
}
section.hero .subtitle {
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
section.hero .cta-links a {
  display: inline-block;
  padding: 10px 20px;
  background: var(--btn-primary);
  color: #fff;
  border-radius: 20px;
  margin: 0 10px;
  font-size: 17px;
  text-decoration: none;
  transition: background 0.2s;
}
section.hero .cta-links a:hover {
  background: var(--btn-primary-hover);
  text-decoration: none;
}
section.hero .cta-links a:nth-child(2) {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
}
section.hero .cta-links a:nth-child(2):hover {
  background: rgba(255,255,255,0.3);
}

/* Grid & Cards */
section.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 22px 40px;
}

/* Specific spacing for About page grid to fix "too close" issue */
.page-content .grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 40px; /* Restored larger gap for content pages */
  width: 100%;
  margin-top: 20px;
}

.card {
  background: var(--bg-section);
  padding: 30px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 400px;
  position: relative;
  border-radius: 28px;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
  overflow: hidden;
  grid-column: span 4;
}

/* Card Variants for Homepage */
.card.span-4 { grid-column: span 4; }
.card.span-5 { grid-column: span 5; }
.card.span-6 { grid-column: span 6; }
.card.span-7 { grid-column: span 7; }
.card.span-8 { grid-column: span 8; }
.card.span-12 { grid-column: span 12; }

.card.theme-dark {
  background: #1d1d1f;
  color: #f5f5f7;
}
.card.theme-dark h2, .card.theme-dark p, .card.theme-dark h3 {
  color: #f5f5f7;
}
.card.theme-dark .btn-secondary {
  color: #2997ff;
}

/* Irregular Split / Gradient Themes */
.card.theme-split-1 {
  /* Diagonal sharp split */
  background: linear-gradient(115deg, #0071e3 50%, #1d1d1f 50%);
  color: #fff;
}
.card.theme-split-2 {
  /* Vertical offset split */
  background: linear-gradient(to right, #302b63 60%, #24243e 60%);
  color: #fff;
}
.card.theme-gradient-1 {
  background: radial-gradient(circle at top left, #47a3ff, #0071e3);
  color: #fff;
}

.card.theme-split-1 h2, .card.theme-split-1 p, .card.theme-split-1 h3,
.card.theme-split-2 h2, .card.theme-split-2 p, .card.theme-split-2 h3,
.card.theme-gradient-1 h2, .card.theme-gradient-1 p, .card.theme-gradient-1 h3 {
  color: #fff;
}
.card.theme-split-1 .btn-secondary,
.card.theme-split-2 .btn-secondary,
.card.theme-gradient-1 .btn-secondary {
  color: rgba(255,255,255,0.9);
}

.card-image {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 60%;
  max-width: 300px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}
.card:hover .card-image {
  transform: scale(1.05) rotate(-2deg);
}

@media (max-width: 768px) {
  section.grid, .page-content .grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .page-content .grid {
    gap: 30px; /* Slightly larger on mobile for About page */
  }
  .card {
    min-height: 300px;
    width: 100%;
    grid-column: auto !important; /* Force full width on mobile */
  }
}
.card:hover {
  transform: scale(1.01);
  box-shadow: var(--card-hover-shadow);
}
.card h2 {
  font-size: 32px;
  margin: 0 0 12px;
  color: var(--text-main);
}
.card h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.card p {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-main);
  margin: 0 0 16px;
}
.card .links {
  margin-top: auto;
}
.btn {
  display: inline-block;
  background: var(--btn-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 14px;
}
.btn:hover {
  background: var(--btn-primary-hover);
  text-decoration: none;
  color: #fff;
}
.btn-secondary {
  color: var(--link-color);
  font-size: 17px;
}
.btn-secondary:hover {
  text-decoration: underline;
}

/* Feature Section (Apple Style) */
.feature-section {
  margin: 60px auto;
  text-align: center;
  max-width: 800px;
}
.feature-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.feature-desc {
  font-size: 24px;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 40px;
}
.feature-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* Section Header Group */
.section-header-group {
  margin: 60px auto 20px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  padding: 0 10px;
}
.section-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--text-main);
}
.view-all {
  font-size: 17px;
  font-weight: 400;
  color: var(--link-color);
}

/* Post List */
.post-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Strict 3 columns for desktop alignment */
  gap: 30px;
}
@media (max-width: 900px) {
  .post-list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .post-list {
    grid-template-columns: 1fr;
  }
}
.post-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%; /* Ensure full height for alignment */
}
.post-item .cover-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  background-color: var(--bg-section);
}
.post-item .content-wrap {
  padding: 0 5px;
  flex: 1; /* Take remaining space */
  display: flex;
  flex-direction: column;
}
.post-item .meta {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.post-item .badge {
  color: var(--text-main);
}
.post-item h3 {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 5px;
}
.post-item h3 a {
  color: var(--text-main);
}
.post-item p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: auto; /* Push text if needed, or just let it flow */
}

/* 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 */
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}
p {
  line-height: 1.6;
  color: var(--text-sec);
}
.page-title {
  font-size: 48px;
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 20px;
}
.section-title {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 600;
  margin-bottom: 40px;
}
.lead-text {
  font-size: 21px;
  line-height: 1.4;
  color: var(--text-sec);
  max-width: 800px;
  margin: 0 auto;
}

/* Feature Grid */
.grid-2, .grid-3 {
  display: grid;
  gap: 30px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
  .page-title { font-size: 36px; }
  .section-title { font-size: 32px; }
  .lead-text { font-size: 19px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Apple-style Cards */
.card-apple {
  background: var(--bg-section);
  border-radius: 18px;
  padding: 40px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-apple:hover {
  transform: scale(1.02);
}
.card-apple h3 {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--text-main);
}
.card-apple p {
  font-size: 17px;
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-primary {
  background: var(--link-color);
  color: #fff;
  border: 1px solid var(--link-color);
}
.btn-primary:hover {
  background: #0077ED; /* Slightly darker blue */
}
.btn-outline {
  background: transparent;
  color: var(--link-color);
  border: 1px solid var(--link-color);
}
.btn-outline:hover {
  background: var(--link-color);
  color: #fff;
}

/* Pagination (Apple Style) */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 60px;
}
.pager a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 20px;
  background-color: var(--bg-section);
  color: var(--text-main);
  font-size: 15px;
  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(--text-main);
  color: var(--bg-body);
  font-weight: 600;
  cursor: default;
}
.pager a.active:hover {
  background-color: var(--text-main); /* No change on hover for active */
}

/* Footer */
footer {
  background-color: var(--bg-section);
  padding: 40px 0;
  margin-top: 60px;
  font-size: 12px;
  color: var(--text-secondary);
}
footer .links {
  margin: 10px 0;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
footer a {
  color: var(--text-main);
}
footer .muted {
  margin-top: 10px;
  color: #999;
}

/* =========================================
   Mobile Responsiveness
   ========================================= */

@media (max-width: 980px) {
  section.grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Layout */
  .container {
    padding: 0 16px;
  }
  
  /* Header Mobile Menu */
  .mobile-controls {
    display: flex;
    align-items: center;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  /* Reset nav layout for mobile */
  header .container {
    justify-content: space-between;
  }
  
  nav {
    position: fixed;
    top: 44px;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--bg-body); /* Opaque background for menu */
    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; /* Hide content when closed */
  }
  
  /* Class to open menu */
  header.nav-open {
    height: 100vh; /* Full screen */
    background: rgba(255, 255, 255, 0.95); /* Frosted glass */
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    overflow-y: auto; /* Allow scroll if menu is long */
  }
  body.theme-dark header.nav-open {
    background: rgba(0, 0, 0, 0.95);
  }
  header.nav-open nav {
    height: auto;
    opacity: 1;
    pointer-events: auto;
    padding: 80px 0 40px; /* More top padding for breathing room */
    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; /* Larger, bolder */
    font-weight: 600;
    opacity: 0; /* Animate in */
    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; /* Clean separation */
  }
  
  /* Mobile Theme Toggle */
  header.nav-open .theme-toggle {
    display: flex; /* Show it in menu */
    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);
  }
  
  /* Hide desktop theme toggle when nav is closed/desktop */
  .theme-toggle {
    display: none; /* Hide on mobile by default */
  }
  header.nav-open .theme-toggle {
    display: flex; /* Show in open menu */
  }
  
  /* Toggle Animation */
  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);
  }

  /* Grid */
  section.grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  /* Force single column for cards that span on desktop */
  .card[style*="grid-column"] {
    grid-column: auto !important;
  }
  
  /* Hero */
  section.hero {
    padding: 80px 0 60px;
    min-height: 400px;
  }
  section.hero .title {
    font-size: 40px;
  }
  section.hero .subtitle {
    font-size: 20px;
    padding: 0 20px;
  }
  
  /* Feature Section */
  .feature-title {
    font-size: 32px;
  }
  .feature-desc {
    font-size: 19px;
  }
  
  /* Typography */
  .page-content h1 {
    font-size: 36px;
  }
  .page-content h2 {
    font-size: 28px;
  }
  
  /* Section Headers */
  .section-header {
    flex-direction: row; /* Keep row but maybe adjust */
    align-items: center;
  }
  .section-title {
    font-size: 28px;
  }
  
  /* Footer */
  footer .links {
    flex-direction: column;
    gap: 10px;
  }
}

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

@media (max-width: 480px) {
  section.hero .title {
    font-size: 32px;
  }
  .feature-actions {
    flex-direction: column;
    align-items: center;
  }
  .feature-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* Search Overlay - Apple Style Refined */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: center;
  padding-top: 100px;
}
body.theme-dark .search-overlay {
  background: rgba(28, 28, 30, 0.92);
}
.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: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.12);
  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;
}
#search-input:focus {
  background: #fff;
  border-color: var(--link-color);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.2);
}
body.theme-dark #search-input:focus {
  background: #1c1c1e;
}
#search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.8;
}
.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; /* Hide default, show when needed or just use separate cancel button outside */
}
/* Re-implement Cancel button as separate element for Apple style */
.search-cancel-btn {
  margin-left: 12px;
  color: var(--link-color);
  font-size: 17px;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.search-cancel-btn:hover {
  text-decoration: underline;
}

/* Search Type Switch (Segmented Control) */
.search-type-switch {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  padding: 2px;
  border-radius: 8px;
  margin-bottom: 20px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.switch-btn {
  border: none;
  background: none;
  padding: 4px 12px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
}
.switch-btn.active {
  background: #fff;
  color: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
body.theme-dark .switch-btn.active {
  background: #636366;
  color: #fff;
}

/* 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;
}

@media (max-width: 768px) {
  /* Search Overlay - Mobile Adjustment */
  .search-overlay {
    padding-top: 0;
    align-items: flex-start;
    display: block; /* Allow flow */
    background: var(--bg-body); /* Solid bg or high blur fallback */
  }
  .search-container {
    padding: 8px 16px;
    margin-top: 0;
    width: 100%;
    max-width: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    /* Mobile: Integrate switcher into header? or put below */
    display: flex;
    flex-direction: column;
  }
  /* Reorder for mobile: Search Bar first, then Switcher */
  .search-bar { order: 1; margin-bottom: 8px; }
  .search-type-switch { 
    order: 2; 
    margin-bottom: 0; 
    width: 100%; 
    justify-content: center;
    background: transparent; /* Cleaner on mobile header */
  }
  .search-type-switch .switch-btn {
    flex: 1;
    text-align: center;
    padding: 8px 0;
  }
  .search-type-switch .switch-btn.active {
     background: rgba(118, 118, 128, 0.2); /* Subtle active state for mobile text-only feel or keep pill */
     background: #fff; /* Keep pill */
  }
  body.theme-dark .search-type-switch .switch-btn.active {
     background: #636366;
  }
  
  .search-results {
    order: 3;
    padding: 20px; /* Add padding for results body */
    background: var(--bg-body);
    height: calc(100vh - 100px); /* Fill rest */
  }

  body.theme-dark .search-container {
    background: rgba(28, 28, 30, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .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; /* Prevent zoom on iOS */
    padding: 8px 36px 8px 36px;
    height: 36px;
  }
  .search-cancel-btn {
    font-size: 16px;
  }
}

/* PC Specific Polish */
@media (min-width: 769px) {
  .search-overlay {
    padding-top: 15vh; /* Move down a bit */
    background: rgba(255, 255, 255, 0.85); /* Lighter backdrop */
  }
  body.theme-dark .search-overlay {
    background: rgba(0, 0, 0, 0.85);
  }
  .search-container {
    background: transparent; /* No container bg on PC, just content */
    animation: slideDown 0.3s ease-out forwards;
  }
  #search-input {
    height: 56px;
    font-size: 22px;
    padding-left: 56px;
    padding-right: 20px;
    background: rgba(118, 118, 128, 0.1);
    border: 1px solid transparent;
    border-radius: 16px;
    box-shadow: none;
    width: 100%;
    color: var(--text-main);
  }
  #search-input:focus {
    background: #fff;
    border-color: var(--link-color);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.2);
  }
  body.theme-dark #search-input {
    background: rgba(118, 118, 128, 0.2);
  }
  body.theme-dark #search-input:focus {
    background: #1c1c1e;
  }
  .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; /* Ensure visible */
  }
  .search-type-switch {
    margin-bottom: 30px;
    transform: scale(1.2); /* Make it slightly bigger */
  }
}

/* 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: 12px;
  overflow: hidden;
  box-shadow: var(--card-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;
}
.qr-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.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(--card-hover-shadow);
}
.qr-image-wrapper:hover img {
  transform: scale(1.05);
}
.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);
}