/* Full design override - DESIGN-SPEC palette */
html { overflow-x: hidden; scroll-behavior: smooth; }
html, body, main, main .wrapper, .page-content { background-color: #EFF7F5 !important; }
body { color: #3d4d4a; line-height: 1.7; font-family: "LXGW WenKai Screen", -apple-system, sans-serif; }

/* Post lang blocks: zh by default, en when html[lang="en"] */
.lang-block.content-en { display: none; }
html[lang="en"] .lang-block.content-zh { display: none; }
html[lang="en"] .lang-block.content-en { display: block; }
a { color: #80D0ED; transition: color 0.15s ease; }
a:hover { color: #5a9bb8; }

/* Header */
header.site-header, header.site-header .wrapper, .site-header, .site-header .wrapper { background-color: #F0BBDD !important; }
.site-header { border-top: none; border-bottom: none; padding: 0; margin-bottom: 0; min-height: 66px; line-height: normal; width: 100%; }
.site-header .wrapper { display: flex; justify-content: space-between; align-items: center; margin: 0 auto; padding: 0 24px; max-width: 1200px; width: 100%; height: 66px; box-sizing: border-box; }
.site-header .hero-banner { margin-top: 0; margin-bottom: 0; }
.site-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.site-avatar { width: 24px; height: 24px; min-width: 24px; max-width: 24px; flex-shrink: 0; border-radius: 50%; object-fit: cover; display: block; }
.site-title { font-size: 1rem; font-weight: 600; letter-spacing: -0.02em; color: #2a3a38; }
.site-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; flex-shrink: 0; }
.site-nav .page-link { color: #5a6a67; font-size: 0.875rem; text-decoration: none; }
.site-nav .page-link:hover { color: #2a3a38; }
.search-toggle, .en-toggle { background: none; border: none; font: inherit; cursor: pointer; padding: 0; }
.search-toggle { font-size: 1.1rem; opacity: 0.8; }
.search-toggle:hover { opacity: 1; }

/* Hero banner */
.hero-banner { position: relative; width: 100vw; margin: 0 0 0 calc(-50vw + 50%); background: #F0BBDD; min-height: 140px; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: default; }
.hero-banner-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-banner-text { position: relative; z-index: 1; color: #2a3a38; font-family: "LXGW WenKai Screen", -apple-system, sans-serif; font-size: 2rem !important; font-weight: 500; text-align: center; margin: 0; padding: 28px 24px; max-width: 640px; letter-spacing: 0.02em; }
.hero-banner-text .typing-cursor { display: inline-block; width: 2px; height: 1em; background: #2a3a38; margin-left: 2px; vertical-align: text-bottom; animation: cursor-blink 0.7s step-end infinite; }
.hero-banner-text.typing-done .typing-cursor { display: none; }
@keyframes cursor-blink { 50% { opacity: 0; } }
.hero-banner-caption { opacity: 0; transform: translateY(12px); animation: caption-appear 1.2s ease-out 0.4s forwards; }
@keyframes caption-appear { to { opacity: 1; transform: translateY(0); } }

/* Page content */
.page-content { padding: 24px 0; }
main .wrapper { margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; max-width: 1200px; box-sizing: border-box; }
#writing { scroll-margin-top: 16px; }
.tagline { font-size: 0.95rem; color: #5a6a67; margin: 0 0 24px 0; text-align: center; }

/* Post cards - 368px (image 238px, text 98px) */
.post-cards { display: grid; grid-template-columns: repeat(auto-fill, 368px); gap: 24px; list-style: none; margin: 0; padding: 0; justify-content: center; }
.post-card { position: relative; width: 368px; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(42,58,56,0.06); transition: box-shadow 0.2s ease; }
.post-card:hover { box-shadow: 0 4px 16px rgba(42,58,56,0.1); }
.post-card-link { display: block; text-decoration: none; color: inherit; }
.post-card-image { width: 100%; height: 238px; overflow: hidden; background: #F9DDDD; flex-shrink: 0; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-card-image-placeholder { background: linear-gradient(135deg, #F9DDDD 0%, #B8F3EB 100%); }
.post-card-body { height: 98px; padding: 12px 16px; box-sizing: border-box; position: relative; display: flex; flex-direction: column; }
.post-card-share { position: absolute; bottom: 12px; right: 12px; z-index: 2; }
.post-card-title-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; margin-bottom: 4px; }
.post-card-title { font-size: 0.9rem; font-weight: 600; color: #2a3a38; margin: 0; line-height: 1.3; flex: 1; min-width: 0; transition: color 0.15s ease; }
.post-card-link:hover .post-card-title { color: #5a9bb8; }
.post-card-date { font-size: 0.48rem; color: #5a6a67; flex-shrink: 0; white-space: nowrap; }
.post-card-excerpt { font-size: 0.68rem; color: #5a6a67; line-height: 1.4; margin: 0; flex: 1; min-height: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* Card share: icon-only button */
.share-trigger-card.share-trigger-circle { width: 14px; height: 14px; }
.share-trigger-card .share-icon { width: 8px; height: 8px; }

/* Content paper (About, posts) */
.content-paper { background: #fff; border-radius: 12px; box-shadow: 0 4px 24px rgba(42,58,56,0.08); padding: 40px 80px; margin-bottom: 32px; }
.post.content-paper,
.page.content-paper,
.discussion-paper { max-width: 800px; margin-left: auto; margin-right: auto; }
.content-separator { height: 48px; border-top: 1px solid #B8F3EB; margin-top: 32px; }
.discussion-paper { margin-top: 0; }
.post-header-above { padding-top: 0; }
.post-cover { margin: 24px 0 32px 0; overflow: hidden; border-radius: 12px; }
.post-cover img { width: 100%; height: auto; display: block; vertical-align: top; }
.post-meta-qr-share { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; flex-shrink: 0; margin-left: 4px; }
.post-meta-qr { position: relative; z-index: 2; display: inline-block; }
.post-meta-qr img { width: 24px; height: 24px; border-radius: 6px; opacity: 0.9; transition: transform 0.2s ease; display: block; }
.post-meta-qr:hover img { transform: scale(4); transform-origin: top left; box-shadow: 0 4px 16px rgba(42,58,56,0.2); }
.post-meta-qr-share { position: relative; }
.post-meta-qr-share .post-meta-qr { overflow: visible; }
.post-meta .share-wrap { margin-left: 0; display: inline-flex; align-items: center; }
.post-meta .share-trigger-circle { box-sizing: border-box; }
.post .post-header { padding: 32px 0 24px; text-align: left; border-bottom: 1px solid #B8F3EB; }
.post .post-header .post-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; color: #2a3a38; background: linear-gradient(90deg, rgba(184,243,235,0.7) 0%, transparent 100%); padding: 0.1em 0.2em 0.1em 0; margin-left: -0.2em; }
.post .post-meta { font-size: 0.9rem; color: #5a6a67; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.post-content { padding: 24px 0; }
.post-content img { max-width: 100%; height: auto; margin: 16px 0; border-radius: 8px; }
.post-content hr { border: none; border-top: 1px solid #B8F3EB; margin: 24px 0; }
.like-share-row { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 32px 0 24px; }
.like-share-row .share-wrap { display: inline-flex; align-items: center; }
.like-share-row .share-trigger-circle { box-sizing: border-box; }
.post-footer { padding-top: 24px; border-top: 1px solid #B8F3EB; }
.share-buttons-inline { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; }
.share-sep { color: #5a6a67; margin-right: 4px; }
.share-dropdown { position: relative; display: inline-block; }
.share-trigger { display: inline-flex; align-items: center; gap: 6px; color: #5a6a67; background: #fff; border: 1px solid #B8F3EB; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 0.85rem; cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.share-trigger:hover { color: #2a3a38; border-color: #80D0ED; background: rgba(184,243,235,0.3); }
.share-icon { flex-shrink: 0; }
/* Share button: icon-only, circular */
.share-trigger-circle { width: 20px; height: 20px; padding: 0; border-radius: 50%; justify-content: center; }
.post-meta .share-trigger-circle { width: 24px; height: 24px; padding: 0; }
.post-meta .share-trigger-circle .share-icon { width: 12px; height: 12px; }
.like-share-row .share-trigger-circle { width: 24px; height: 24px; padding: 0; }
.like-share-row .share-trigger-circle .share-icon { width: 12px; height: 12px; }
.share-menu { position: absolute; top: 100%; left: 0; margin-top: 0; min-width: 160px; background: #fff; border: 1px solid #B8F3EB; border-radius: 12px; box-shadow: 0 8px 24px rgba(42,58,56,0.12); padding: 12px 0; z-index: 100; }
.share-menu[hidden] { display: none !important; }
.share-menu-header { font-size: 0.75rem; font-weight: 600; color: #5a6a67; letter-spacing: 0.05em; padding: 0 16px 10px; }
.share-option { display: block; width: 100%; padding: 8px 16px; color: #3d4d4a; text-decoration: none; font: inherit; font-size: 0.9rem; background: none; border: none; cursor: pointer; text-align: left; transition: background 0.15s; }
/* Card share: 2 rows - "Share to" on row 1, platform names on row 2; opens upward */
.share-card .share-menu { left: auto; right: 0; top: auto; bottom: 100%; display: flex; flex-direction: column; gap: 6px; min-width: auto; width: max-content; padding: 10px 12px; border-radius: 8px; margin-top: 0; margin-bottom: 0; }
.share-card .share-menu-header { font-size: 0.65rem; padding: 0; flex-shrink: 0; width: 100%; }
.share-card .share-menu-options { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.share-card .share-menu-options .share-option { padding: 2px 6px; font-size: 0.7rem; display: inline-block; width: auto; }
.share-option:hover { background: rgba(184,243,235,0.3); }
.share-option[role="menuitem"] { font-family: inherit; }
.post-footer .post-back { font-size: 0.95rem; color: #5a6a67; }
.post-footer .post-back:hover { color: #2a3a38; }
.giscus-section { margin-top: 24px; }
.like-btn { display: inline-block; padding: 18px 40px; font-size: 0.8rem; background: #F0BBDD; color: #2a3a38; border-radius: 12px; text-decoration: none; font-weight: 500; transition: background 0.15s, transform 0.1s; }
.like-btn:hover { background: #F9DDDD; transform: translateY(-1px); }
.like-btn-en { display: none; }
html[lang="en"] .like-btn-zh { display: none; }
html[lang="en"] .like-btn-en { display: inline; }
.giscus-heading { font-size: 1.25rem; font-weight: 600; color: #2a3a38; margin: 0 0 20px 0; text-align: center; }
.giscus-heading-en { display: none; }
html[lang="en"] .giscus-heading-zh { display: none; }
html[lang="en"] .giscus-heading-en { display: inline; }
.page-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #B8F3EB; }
.page-title { font-size: 1.75rem; font-weight: 600; color: #2a3a38; margin: 0; }

/* Footer */
.site-footer { text-align: center; padding: 24px 0; font-size: 0.9rem; }
.site-footer .wrapper { display: flex; justify-content: center; }
.site-footer-links { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 0; flex-wrap: wrap; }
.site-footer-links a, .site-footer-heart, .site-footer-est { color: #2a3a38; transition: color 0.15s ease; }
.site-footer-links a:hover, .site-footer-heart:hover { color: #5a9bb8 !important; }
.site-footer-links svg { display: block; vertical-align: middle; }

/* Search overlay */
.search-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: flex-start; justify-content: center; padding: 200px 24px 24px; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; pointer-events: none; }
.search-overlay-open { opacity: 1; visibility: visible; pointer-events: auto; }
.search-overlay-backdrop { position: absolute; inset: 0; background: rgba(42,58,56,0.5); backdrop-filter: blur(4px); cursor: pointer; }
.search-overlay-content { position: relative; z-index: 1; background: #fff; border-radius: 12px; width: 100%; max-width: 480px; box-shadow: 0 16px 48px rgba(42,58,56,0.25); overflow: hidden; }
.search-overlay-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; }
.search-overlay-title { font-size: 0.9rem; color: #5a6a67; }
.search-overlay-close { background: none; border: none; font-size: 1.5rem; line-height: 1; color: #5a6a67; cursor: pointer; padding: 0 4px; }
.search-overlay-close:hover { color: #2a3a38; }
.search-input { width: 100%; padding: 16px 20px; font-size: 1.1rem; border: none; outline: none; }
.search-results { max-height: 280px; overflow-y: auto; }
.search-result-item { display: block; padding: 12px 20px; color: inherit; text-decoration: none; border-bottom: 1px solid rgba(42,58,56,0.06); }
.search-result-item:hover, .search-result-item.selected { background: rgba(184,243,235,0.3); }
.search-result-item strong { display: block; font-size: 0.95rem; margin-bottom: 4px; }
.search-result-item span { font-size: 0.85rem; color: #5a6a67; }
.search-overlay-hint { font-size: 0.75rem; color: #5a6a67; text-align: center; margin: 0; padding: 12px 20px 16px; }
