/**
 * FishWhite Theme - 余白
 * @package FishWhite
 * @version 1.0
 */

:root {
  --bg: #f9f8f6;
  --white: #ffffff;
  --ink: #18181b;
  --sub: #52525b;
  --muted: #a1a1aa;
  --line: #e4e4e7;
  --hover: #f4f4f5;
  --green: #16a34a;
  --green-l: #dcfce7;
  --blue: #3b82f6;
  --blue-l: #eff6ff;
  --yellow: #eab308;
  --yellow-l: #fef9c3;
  --red: #ef4444;
  --red-l: #fee2e2;
  --purple: #8b5cf6;
  --purple-l: #ede9fe;
  --serif: Georgia, 'Times New Roman', 'Source Han Serif SC', 'SimSun', 'STSong', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --r: 12px;
  --r-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-weight: 400; font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; transition: opacity 0.15s; }
a:hover { opacity: 0.75; }
img { max-width: 100%; height: auto; display: block; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
button, input, textarea { font-family: inherit; }
::placeholder { color: var(--muted); }

/* ========== LOADER ========== */
.page-loader { position: fixed; inset: 0; background: var(--bg); z-index: 9999; display: flex; align-items: center; justify-content: center; transition: opacity 0.5s, visibility 0.5s; }
.page-loader.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; }
.loader-logo { font-family: var(--serif); font-size: 28px; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 16px; opacity: 0; animation: lfi 0.6s 0.1s forwards; }
.loader-bar { width: 120px; height: 2px; background: var(--line); border-radius: 2px; margin: 0 auto; overflow: hidden; opacity: 0; animation: lfi 0.6s 0.3s forwards; }
.loader-bar::after { content: ''; display: block; width: 40px; height: 100%; background: var(--green); border-radius: 2px; animation: ls 1.2s ease-in-out infinite; }
@keyframes lfi { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ls { 0%, 100% { transform: translateX(-40px); } 50% { transform: translateX(120px); } }

/* ========== LAZYLOAD ========== */
.lazyload, .lazyloading { opacity: 0; transition: opacity 0.4s; }
.lazyloaded { opacity: 1; }
img.lazyload, img.lazyloading { background: var(--hover); }

/* ========== NAV ========== */
nav { position: sticky; top: 0; z-index: 99; background: rgba(249,248,246,0.92); backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 900px; margin: 0 auto; padding: 0 24px; height: 54px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: 0.04em; }
.nav-links { display: flex; gap: 2px; list-style: none; }
.nav-links a { font-size: 13px; color: var(--sub); padding: 5px 12px; border-radius: var(--r-sm); transition: all 0.15s; display: inline-block; }
.nav-links a:hover { background: var(--hover); color: var(--ink); opacity: 1; }
.nav-links li.on a { color: var(--green); font-weight: 500; }

/* ========== LAYOUT ========== */
.wrap { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.page-body { padding: 28px 0 60px; }
.two-col { display: grid; grid-template-columns: 1fr 260px; gap: 48px; align-items: start; }

/* ========== HERO ========== */
.hero-banner { background: var(--white); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero-banner.hero-banner-tint { background: linear-gradient(135deg, var(--white) 0%, #f7faf7 100%); }
.hero-banner.hero-banner-tint::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 12% 18%, rgba(22,163,74,0.05) 0%, transparent 40%), radial-gradient(circle at 88% 82%, rgba(22,163,74,0.04) 0%, transparent 35%); pointer-events: none; }
.hero-content { position: relative; z-index: 1; padding: 36px 0 32px; }
.page-hero { position: relative; z-index: 1; text-align: center; padding: 48px 0 40px; }
.page-hero h1 { font-family: var(--serif); font-size: clamp(24px, 4vw, 38px); font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 10px; word-break: keep-all; }
.page-hero p { color: var(--muted); font-size: 14px; }
.hero-kicker { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); margin-bottom: 14px; }
.hero-h1 { font-family: var(--serif); font-size: clamp(28px, 4.5vw, 46px); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; max-width: 640px; margin-bottom: 14px; word-break: keep-all; }
.hero-lead { font-size: 15px; line-height: 1.8; color: var(--sub); max-width: 520px; margin-bottom: 24px; }
.hero-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-byline { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ========== BUTTONS ========== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s; line-height: 1; }
.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-fill { background: var(--ink); color: #fff; }
.btn-out { background: transparent; color: var(--sub); border: 1px solid var(--line); }
.btn-out:hover { color: var(--ink); border-color: var(--sub); opacity: 1; }

/* ========== SEC LABEL ========== */
.sec-label { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 24px; }

/* ========== POST LIST ========== */
.post-list { display: flex; flex-direction: column; }
.post-item { display: grid; grid-template-columns: 1fr 88px; gap: 20px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); transition: padding 0.2s; }
.post-item:last-child { border-bottom: none; }
.post-item:hover { padding-left: 4px; }
.post-cat { font-size: 11px; font-weight: 500; color: var(--green); letter-spacing: 0.06em; margin-bottom: 5px; }
.post-title { font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.4; margin-bottom: 5px; letter-spacing: -0.01em; color: var(--ink); }
.post-excerpt { font-size: 13px; color: var(--sub); line-height: 1.7; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-empty { text-align: center; padding: 60px 0; color: var(--muted); font-size: 15px; }

.post-thumb { aspect-ratio: 1; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 32px; flex-shrink: 0; overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.th-a { background: #fef9c3; } .th-b { background: #dbeafe; } .th-c { background: #dcfce7; } .th-d { background: #fee2e2; } .th-e { background: #ede9fe; }

/* ========== SIDEBAR ========== */
.sidebar { display: flex; flex-direction: column; gap: 32px; }
.widget-title { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 16px; }
.about-widget { font-size: 13px; color: var(--sub); line-height: 1.8; }
.about-name { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.about-avatar { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 12px; object-fit: cover; }
.archive { list-style: none; }
.archive li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--sub); }
.archive li:last-child { border-bottom: none; }
.archive li a { display: flex; justify-content: space-between; width: 100%; align-items: center; }
.archive li a:hover { color: var(--ink); opacity: 1; }
.archive-n { font-size: 11px; color: var(--muted); background: var(--hover); padding: 1px 8px; border-radius: 100px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--sub); background: var(--white); border: 1px solid var(--line); padding: 3px 12px; border-radius: 100px; transition: all 0.15s; display: inline-block; }
.tag:hover { border-color: var(--green); color: var(--green); background: var(--green-l); opacity: 1; }
.recent-comments { list-style: none; }
.recent-comments li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.recent-comments li:last-child { border-bottom: none; }
.recent-comments a { color: var(--ink); font-weight: 500; }
.recent-comments a:hover { color: var(--green); opacity: 1; }
.recent-comments .comment-excerpt { color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ========== PAGINATION ========== */
.pagination { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.page-nav { display: flex; justify-content: center; align-items: center; gap: 4px; list-style: none; flex-wrap: wrap; }
.page-nav a, .page-nav span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 12px; border-radius: var(--r-sm); font-size: 13px; color: var(--sub); transition: all 0.15s; }
.page-nav a:hover { background: var(--hover); color: var(--ink); opacity: 1; }
.page-nav .current { background: var(--ink); color: var(--white); font-weight: 500; }

/* ========== POST / PAGE HEADER ========== */
.page-hero .post-cat { display: inline-block; font-size: 11px; font-weight: 500; color: var(--green); letter-spacing: 0.06em; margin-bottom: 10px; }
.page-hero .post-meta { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ========== POST CONTENT ========== */
.post-content { font-size: 15px; line-height: 1.85; color: var(--sub); }
.post-content h2, .post-content h3, .post-content h4 { font-family: var(--serif); color: var(--ink); margin: 36px 0 14px; line-height: 1.3; font-weight: 600; }
.post-content h2 { font-size: 22px; } .post-content h3 { font-size: 19px; } .post-content h4 { font-size: 16px; }
.post-content p { margin-bottom: 18px; }
.post-content a { color: var(--green); border-bottom: 1px solid var(--green-l); transition: all 0.15s; }
.post-content a:hover { border-bottom-color: var(--green); opacity: 1; }
.post-content img { border-radius: var(--r); margin: 24px 0; }
.post-content blockquote { border-left: 3px solid var(--green); padding: 12px 18px; margin: 20px 0; background: var(--green-l); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-style: italic; }
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content ul, .post-content ol { margin: 14px 0; padding-left: 22px; }
.post-content li { margin-bottom: 5px; }
.post-content code { background: var(--hover); padding: 2px 6px; border-radius: 4px; font-size: 13px; color: var(--ink); font-family: 'SF Mono', Monaco, monospace; }
.post-content pre { background: #1e1e2e; color: #e4e4e7; padding: 18px; border-radius: var(--r); overflow-x: auto; margin: 20px 0; font-size: 13px; line-height: 1.6; }
.post-content pre code { background: none; padding: 0; color: inherit; }
.post-content hr { border: none; border-top: 1px solid var(--line); margin: 36px 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.post-content th, .post-content td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; }
.post-content th { background: var(--hover); font-weight: 500; }

.post-tags { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-tags-label { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-nav-item { padding: 16px; background: var(--white); border-radius: var(--r); border: 1px solid var(--line); transition: all 0.15s; }
.post-nav-item:hover { border-color: var(--green); background: var(--green-l); opacity: 1; }
.post-nav-label { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.post-nav-title { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.post-nav-next { text-align: right; }

/* ========== SHORTCODES ========== */

/* Inline */
.sc-mark { background: linear-gradient(180deg, transparent 60%, rgba(234,179,8,0.35) 60%); color: var(--ink); padding: 0 2px; border-radius: 2px; }
.sc-kbd { display: inline-block; font-family: inherit; font-size: 0.85em; padding: 2px 6px; background: var(--white); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--sub); box-shadow: 0 1px 1px rgba(0,0,0,0.04); }
.sc-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 100px; font-size: 12px; font-weight: 500; line-height: 1.4; margin: 0 2px; }
.sc-badge-default { background: var(--hover); color: var(--sub); }
.sc-badge-green { background: var(--green-l); color: var(--green); }
.sc-badge-blue { background: var(--blue-l); color: var(--blue); }
.sc-badge-red { background: var(--red-l); color: var(--red); }
.sc-badge-yellow { background: var(--yellow-l); color: var(--yellow); }
.sc-badge-purple { background: var(--purple-l); color: var(--purple); }

/* Notice */
.sc-notice { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--r); margin: 20px 0; font-size: 14px; line-height: 1.7; border: 1px solid var(--line); background: var(--white); position: relative; }
.sc-notice-icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.sc-notice-content { flex: 1; min-width: 0; }
.sc-notice-title { font-family: var(--serif); font-weight: 600; color: var(--ink); margin-bottom: 4px; font-size: 14px; }
.sc-notice-body { color: var(--sub); }
.sc-notice-body > :last-child { margin-bottom: 0; }
.sc-notice-tip { border-color: #dbeafe; background: #f0f9ff; }
.sc-notice-info { border-color: #dbeafe; background: #f0f9ff; }
.sc-notice-success { border-color: #bbf7d0; background: #f0fdf4; }
.sc-notice-warning { border-color: #fde68a; background: #fffbeb; }
.sc-notice-danger, .sc-notice-error { border-color: #fecaca; background: #fef2f2; }
.sc-notice-important { border-color: #ddd6fe; background: #faf5ff; }
.sc-notice-tip .sc-notice-icon, .sc-notice-info .sc-notice-icon { color: var(--blue); }
.sc-notice-success .sc-notice-icon { color: var(--green); }
.sc-notice-warning .sc-notice-icon { color: var(--yellow); }
.sc-notice-danger .sc-notice-icon, .sc-notice-error .sc-notice-icon { color: var(--red); }
.sc-notice-important .sc-notice-icon { color: var(--purple); }

/* Button */
.sc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 20px; border-radius: 100px; font-size: 13px; font-weight: 500; transition: all 0.15s; margin: 3px; border: 1px solid transparent; cursor: pointer; line-height: 1.4; text-decoration: none; }
.sc-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); opacity: 1; }
.sc-btn-default { background: var(--white); color: var(--ink); border-color: var(--line); }
.sc-btn-default:hover { border-color: var(--sub); }
.sc-btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.sc-btn-primary:hover { opacity: 0.85; }
.sc-btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.sc-btn-green:hover { opacity: 0.85; }
.sc-btn-blue { background: var(--blue); color: #fff; border-color: var(--blue); }
.sc-btn-blue:hover { opacity: 0.85; }
.sc-btn-red { background: var(--red); color: #fff; border-color: var(--red); }
.sc-btn-red:hover { opacity: 0.85; }
.sc-btn-outline { background: transparent; color: var(--sub); border-color: var(--line); }
.sc-btn-outline:hover { border-color: var(--green); color: var(--green); background: var(--green-l); }
.sc-btn-ghost { background: transparent; color: var(--sub); border-color: transparent; }
.sc-btn-ghost:hover { background: var(--hover); }
.sc-btn-soft { background: var(--hover); color: var(--ink); border-color: var(--line); }
.sc-btn-soft:hover { background: var(--line); }

/* Card */
.sc-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin: 20px 0; transition: all 0.2s; position: relative; overflow: hidden; }
.sc-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); border-color: var(--green); }
.sc-card::before { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--green); opacity: 0.6; }
.sc-card-title { font-family: var(--serif); font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.sc-card-body { font-size: 14px; line-height: 1.7; color: var(--sub); }

/* Collapse */
.sc-collapse { border: 1px solid var(--line); border-radius: var(--r); margin: 12px 0; overflow: hidden; background: var(--white); }
.sc-collapse-header { padding: 13px 16px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 500; font-size: 14px; transition: background 0.15s; user-select: none; color: var(--ink); }
.sc-collapse-header:hover { background: var(--hover); }
.sc-collapse-header::after { content: ''; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.2s; color: var(--muted); }
.sc-collapse.open .sc-collapse-header::after { transform: rotate(-135deg); color: var(--green); }
.sc-collapse-body { padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; font-size: 14px; line-height: 1.7; color: var(--sub); }
.sc-collapse.open .sc-collapse-body { padding: 0 16px 16px; max-height: 500px; }

/* Tabs */
.sc-tabs { margin: 20px 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); overflow: hidden; }
.sc-tab-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.sc-tab-btn { padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--sub); background: transparent; border: none; border-radius: var(--r-sm) var(--r-sm) 0 0; cursor: pointer; transition: all 0.15s; }
.sc-tab-btn:hover { color: var(--ink); background: var(--white); }
.sc-tab-btn.active { color: var(--green); background: var(--white); box-shadow: 0 -2px 0 var(--green) inset; }
.sc-tab-panel { display: none; padding: 18px; font-size: 14px; line-height: 1.7; color: var(--sub); }
.sc-tab-panel.active { display: block; }

/* Row / Columns */
.sc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 20px 0; }
.sc-col { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.sc-col-2 { grid-column: span 2; }
.sc-col-3 { grid-column: span 3; }

/* File */
.sc-file { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); margin: 20px 0; transition: all 0.15s; }
.sc-file:hover { border-color: var(--green); box-shadow: 0 4px 12px rgba(0,0,0,0.05); opacity: 1; }
.sc-file-icon { flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--green-l); color: var(--green); }
.sc-file-meta { display: flex; flex-direction: column; min-width: 0; }
.sc-file-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.sc-file-url { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Audio */
.sc-audio { margin: 20px 0; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.sc-audio audio { width: 100%; height: 36px; }

/* Divider */
.sc-divider { display: flex; align-items: center; margin: 28px 0; color: var(--muted); font-size: 13px; }
.sc-divider::before, .sc-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.sc-divider span { padding: 0 14px; }

/* Timeline */
.sc-timeline { position: relative; padding-left: 28px; margin: 20px 0; }
.sc-timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.sc-timeline-item { position: relative; padding-bottom: 22px; display: flex; gap: 14px; }
.sc-timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg); position: absolute; left: -28px; top: 4px; }
.sc-timeline-date { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.sc-timeline-title { font-weight: 600; font-size: 15px; color: var(--ink); margin-bottom: 4px; font-family: var(--serif); }
.sc-timeline-body { font-size: 14px; color: var(--sub); line-height: 1.7; }

/* Progress */
.sc-progress-wrap { margin: 14px 0; }
.sc-progress-meta { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; color: var(--sub); }
.sc-progress { width: 100%; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.sc-progress-bar { height: 100%; border-radius: 3px; background: var(--green); transition: width 1s ease; }

/* Gallery */
.sc-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 20px 0; }
.sc-gallery-item { border-radius: var(--r); overflow: hidden; aspect-ratio: 4/3; background: var(--hover); }
.sc-gallery-item img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform 0.3s; }
.sc-gallery-item:hover img { transform: scale(1.05); }

/* Video */
.sc-video-wrap { position: relative; padding-bottom: 56.25%; height: 0; margin: 20px 0; border-radius: var(--r); overflow: hidden; background: var(--hover); }
.sc-video-wrap iframe, .sc-video-wrap video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; border-radius: var(--r); }

/* Code block */
.sc-code { margin: 20px 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.sc-code-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 12px; }
.sc-code-label { font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: 0.04em; }
.sc-code-copy { padding: 4px 10px; font-size: 12px; color: var(--sub); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: all 0.15s; }
.sc-code-copy:hover { color: var(--green); border-color: var(--green); }
.sc-code-pre { margin: 0 !important; border-radius: 0 0 var(--r) var(--r) !important; }
.sc-code-pre code { font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Fira Code', monospace !important; }

/* ========== COMMENTS ========== */
.comments-section { margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--ink); }
.comments-title { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 24px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.comment-closed { text-align: center; padding: 24px; color: var(--muted); font-size: 14px; background: var(--white); border-radius: var(--r); border: 1px solid var(--line); margin-bottom: 32px; }

/* Comment Form */
.comment-form-top { margin-bottom: 40px; padding: 24px; background: var(--white); border-radius: var(--r); border: 1px solid var(--line); }
.comment-form-top .form-head { font-family: var(--serif); font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.form-input, .form-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; background: var(--bg); color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; -webkit-appearance: none; }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-l); }
.form-textarea { min-height: 90px; resize: vertical; margin-bottom: 10px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; }
.form-submit { background: var(--ink); color: #fff; border: none; padding: 10px 24px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; cursor: pointer; transition: opacity 0.15s; }
.form-submit:hover { opacity: 0.85; }
.cancel-reply { font-size: 12px; color: var(--muted); margin-left: 8px; cursor: pointer; transition: color 0.15s; }
.cancel-reply:hover { color: var(--green); }
.c-login-info { font-size: 13px; color: var(--sub); margin-bottom: 12px; }
.c-login-info a { color: var(--muted); font-size: 12px; margin-left: 6px; }
.c-login-info a:hover { color: var(--green); opacity: 1; }

/* Comment List */
.c-list, .c-list-nested, .comment-list, .comment-children { list-style: none; margin: 0; padding: 0; }
.c-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.c-item:last-child { border-bottom: none; }
.c-main { display: flex; gap: 14px; }
.c-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--hover); align-self: flex-start; }
.c-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.c-body { flex: 1; min-width: 0; }
.c-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; line-height: 1.3; }
.c-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.c-meta { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.c-time { font-size: 12px; color: var(--muted); }
.c-location { font-size: 11px; color: var(--sub); background: var(--hover); padding: 1px 6px; border-radius: 4px; line-height: 1.4; }
.c-badge { font-size: 10px; font-weight: 500; color: var(--green); background: var(--green-l); padding: 2px 8px; border-radius: 100px; letter-spacing: 0.04em; }
.c-text { font-size: 14px; line-height: 1.75; color: var(--sub); word-break: break-word; }
.c-text p { margin-bottom: 6px; }
.c-text p:last-child { margin-bottom: 0; }
.c-text a { color: var(--green); border-bottom: 1px solid var(--green-l); }
.c-text a:hover { border-bottom-color: var(--green); opacity: 1; }
.c-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.c-reply { font-size: 12px; color: var(--muted); cursor: pointer; transition: color 0.15s; }
.c-reply a { color: var(--muted); }
.c-reply a:hover { color: var(--green); opacity: 1; }

/* Author */
.c-author .c-name { color: var(--green); }

/* Nested */
.c-children { margin-top: 10px; padding-left: 58px; }
.c-children .c-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.c-children .c-item:last-child { border-bottom: none; padding-bottom: 0; }
.c-children .c-avatar { width: 36px; height: 36px; }
.c-children .c-name { font-size: 13px; }
.c-children .c-text { font-size: 13px; }

/* ========== ARCHIVE ========== */
.archive-list { position: relative; padding-left: 24px; }
.archive-list::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.archive-year-heading { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--ink); margin: 32px 0 16px; position: relative; }
.archive-year-heading:first-child { margin-top: 0; }
.archive-year-heading::before { content: ''; position: absolute; left: -22px; top: 50%; transform: translateY(-50%); width: 10px; height: 10px; background: var(--green); border-radius: 50%; border: 2px solid var(--bg); }
.archive-item { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); position: relative; }
.archive-item:last-child { border-bottom: none; }
.archive-item::before { content: ''; position: absolute; left: -20px; top: 21px; width: 7px; height: 7px; background: var(--line); border-radius: 50%; border: 2px solid var(--bg); transition: background 0.2s; }
.archive-item:hover::before { background: var(--green); }
.archive-item-date { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 78px; padding-top: 2px; }
.archive-item-main { flex: 1; min-width: 0; }
.archive-item-title { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.4; display: block; margin-bottom: 4px; transition: color 0.15s; }
.archive-item-title:hover { color: var(--green); opacity: 1; }
.archive-item-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.archive-item-meta .cat { color: var(--green); background: var(--green-l); padding: 2px 8px; border-radius: 100px; }

/* ========== FRIEND LINKS ========== */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.link-card { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); transition: all 0.2s; }
.link-card:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.06); opacity: 1; }
.link-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--hover); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--muted); overflow: hidden; }
.link-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.link-info { flex: 1; min-width: 0; }
.link-name { font-family: var(--serif); font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 2px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-desc { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* ========== GUESTBOOK ========== */
.gb-comments { padding: 16px 0; }
.gb-comment-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gb-comment-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 20px; transition: all 0.25s; position: relative; }
.gb-comment-card:hover { transform: translateY(-3px) rotate(0deg) !important; box-shadow: 0 4px 20px rgba(0,0,0,0.06); opacity: 1; }
.gb-comment-card:nth-child(odd) { transform: rotate(-1deg); }
.gb-comment-card:nth-child(even) { transform: rotate(0.8deg); }
.gb-comment-card:nth-child(3n) { transform: rotate(-0.5deg); }
.gb-comment-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.gb-comment-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--hover); flex-shrink: 0; overflow: hidden; }
.gb-comment-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.gb-comment-meta { flex: 1; min-width: 0; }
.gb-comment-name { font-weight: 600; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-comment-time { font-size: 11px; color: var(--muted); }
.gb-comment-body { font-size: 13px; line-height: 1.7; color: var(--sub); word-break: break-word; }
.gb-comment-body p { margin-bottom: 6px; }
.gb-comment-body p:last-child { margin-bottom: 0; }
.gb-comment-badge { font-size: 10px; font-weight: 500; color: var(--green); background: var(--green-l); padding: 2px 8px; border-radius: 100px; margin-left: auto; flex-shrink: 0; }

/* ========== FOOTER ========== */
footer { border-top: 1px solid var(--line); padding: 24px 0; margin-top: 40px; }
.footer-inner { max-width: 900px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-logo { font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--ink); }
.footer-copy { font-size: 12px; color: var(--muted); }
.footer-copy a { color: var(--muted); }
.footer-copy a:hover { color: var(--ink); opacity: 1; }
.footer-links { display: flex; gap: 16px; list-style: none; }
.footer-links a { font-size: 12px; color: var(--muted); transition: color 0.15s; }
.footer-links a:hover { color: var(--ink); opacity: 1; }

/* ========== SCROLL TOP ========== */
.scroll-top { position: fixed; bottom: 32px; right: 32px; width: 40px; height: 40px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); color: var(--sub); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 98; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-2px); opacity: 1; }

/* ========== FADE IN ========== */
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ========== 404 ========== */
.page-404 { text-align: center; padding: 80px 0 120px; }
.page-404 h1 { font-family: var(--serif); font-size: 72px; font-weight: 700; color: var(--line); margin-bottom: 12px; }
.page-404 p { font-size: 15px; color: var(--sub); margin-bottom: 28px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .nav-inner { padding: 0 16px; height: 48px; }
  .wrap { padding: 0 16px; }
  .page-body { padding: 24px 0 60px; }
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { display: none; }
  .hero-banner { padding: 32px 0 28px; }
  .hero-h1 { font-size: 26px; }
  .hero-foot { flex-direction: column; align-items: flex-start; gap: 12px; }
  .post-item { grid-template-columns: 1fr; gap: 12px; padding: 16px 0; }
  .post-thumb { display: none; }
  .page-hero h1 { font-size: 24px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-content h2 { font-size: 20px; }
  .post-content h3 { font-size: 17px; }
  .form-row { grid-template-columns: 1fr; }
  .links-grid { grid-template-columns: 1fr; }
  .sc-gallery { grid-template-columns: repeat(2, 1fr); }
  .sc-row { grid-template-columns: 1fr; }
  .sc-col-2, .sc-col-3 { grid-column: span 1; }
  .archive-list { padding-left: 18px; }
  .archive-list::before { left: 4px; }
  .archive-year-heading { font-size: 18px; margin: 24px 0 12px; }
  .archive-year-heading::before { left: -16px; width: 8px; height: 8px; }
  .archive-item { gap: 12px; padding: 12px 0; }
  .archive-item::before { left: -16px; top: 18px; width: 6px; height: 6px; }
  .archive-item-date { font-size: 12px; min-width: 66px; }
  .archive-item-title { font-size: 15px; }
  .archive-item-meta { gap: 6px; }
  .gb-comment-list { grid-template-columns: 1fr; }
  .gb-comment-card { transform: none !important; }
  .gb-comment-card:hover { transform: translateY(-2px) !important; }
  .c-children { padding-left: 14px; margin-left: 22px; border-left: 2px solid var(--line); }
  .c-head { gap: 6px; }
  .c-name { font-size: 15px; }
  .c-meta { width: 100%; margin-top: 2px; }
  .c-time, .c-location { font-size: 11px; }
  .comment-form-top { padding: 18px; }
  .scroll-top { right: 16px; bottom: 16px; width: 36px; height: 36px; font-size: 16px; }
  .page-404 h1 { font-size: 56px; }
  .footer-inner { flex-direction: column; text-align: center; gap: 8px; }
}

@media (max-width: 480px) {
  .hero-h1 { font-size: 22px; }
  .page-hero h1 { font-size: 20px; }
  .sc-gallery { grid-template-columns: 1fr; }
  .btn { padding: 8px 14px; font-size: 12px; }
  .form-input, .form-textarea { font-size: 16px; }
}

/* ========== GALLERY ========== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery-item { border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; background: var(--hover); border: 1px solid var(--line); transition: all 0.2s; }
.gallery-item:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); opacity: 1; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ========== LIGHTBOX ========== */
#lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 10000; align-items: center; justify-content: center; cursor: zoom-out; }
#lightbox img { max-width: 90%; max-height: 90%; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: rgba(255,255,255,0.6); font-size: 40px; cursor: pointer; line-height: 1; }
.lightbox-close:hover { color: #fff; }

/* ========== EMOJI ========== */
/* 表情解析后显示 */
img.emoji-inline { display: inline-block; vertical-align: middle; width: 1.4em; height: 1.4em; margin: 0 1px; object-fit: contain; }

/* 评论表情包裹面板 */
.emoji-panel { margin-bottom: 12px; overflow: hidden; }
.emoji-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 13px; color: var(--sub); cursor: pointer; background: var(--white); border: 1px solid var(--line); border-radius: 100px; transition: all 0.15s; user-select: none; }
.emoji-toggle:hover { background: var(--hover); border-color: var(--green); color: var(--green); }
.emoji-toggle svg { color: var(--green); flex-shrink: 0; }
.emoji-toggle::after { content: '▼'; font-size: 10px; margin-left: 6px; color: var(--muted); transition: transform 0.2s; }
.emoji-panel.open .emoji-toggle::after { transform: rotate(180deg); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); gap: 4px; padding: 0 10px; max-height: 0; overflow: hidden; transition: max-height 0.3s, padding 0.3s; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); margin-top: 8px; }
.emoji-panel.open .emoji-grid { max-height: 200px; overflow-y: auto; padding: 10px; }
.emoji-grid img { width: 28px; height: 28px; cursor: pointer; border-radius: 4px; padding: 2px; transition: transform 0.15s; }
.emoji-grid img:hover { transform: scale(1.2); background: var(--green-l); }

/* ========== DARK MODE ========== */
@media (prefers-color-scheme: dark) {
  :root { --bg: #18181b; --white: #27272a; --ink: #f4f4f5; --sub: #a1a1aa; --muted: #71717a; --line: #3f3f46; --hover: #3f3f46; }
  nav { background: rgba(24,24,27,0.92); }
  .post-content code { background: #3f3f46; color: #f4f4f5; }
  .post-content pre { background: #09090b; }
  .sc-notice { background: var(--white); }
  .sc-notice-tip, .sc-notice-info { background: rgba(59,130,246,0.10); border-color: rgba(59,130,246,0.35); }
  .sc-notice-success { background: rgba(22,163,74,0.10); border-color: rgba(22,163,74,0.35); }
  .sc-notice-warning { background: rgba(234,179,8,0.10); border-color: rgba(234,179,8,0.35); }
  .sc-notice-danger, .sc-notice-error { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.35); }
  .sc-notice-important { background: rgba(139,92,246,0.10); border-color: rgba(139,92,246,0.35); }
  .sc-kbd { background: var(--white); border-color: var(--line); }
  .sc-tab-nav { background: var(--hover); }
  .sc-file-icon { background: rgba(22,163,74,0.20); }
  .sc-audio { background: var(--white); }
  .sc-divider::before, .sc-divider::after { background: var(--line); }
}
