:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f0f4fa;
  --text: #1e293b;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: #0f766e;
  --accent-soft: #f0fdfa;
  --border: #e2e8f0;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --err: #b91c1c;
  --err-soft: #fef2f2;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header & Nav */
.site-header {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 20%, rgba(56, 189, 248, 0.28) 0%, transparent 45%),
    radial-gradient(circle at 88% 85%, rgba(99, 102, 241, 0.3) 0%, transparent 48%),
    linear-gradient(135deg, #0f172a 0%, #1e3a8a 48%, #2563eb 100%);
  color: #fff;
  padding: 2.6rem 1.25rem 2.4rem;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.25;
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.95fr);
  gap: 1.75rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.85rem;
}

.site-header h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.6rem, 3.1vw, 2.25rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.site-header .hero-main > p {
  margin: 0;
  opacity: 0.92;
  font-size: 0.98rem;
  max-width: 600px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.3rem;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.56rem 1.05rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.hero-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.hero-btn.primary {
  background: #ffffff;
  color: #1e3a8a;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
}

.hero-btn.primary:hover {
  background: #f8fafc;
}

.hero-btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}

.hero-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Hero Profile Glass Card */
.hero-profile-card {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 1.3rem 1.35rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
}

.hero-profile-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.8rem;
}

.avatar-ring {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  padding: 2px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  font-family: Georgia, "Times New Roman", serif;
}

.hero-profile-name {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
}

.hero-profile-role {
  font-size: 0.82rem;
  opacity: 0.84;
  margin-top: 0.15rem;
}

.hero-profile-tagline {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  line-height: 1.65;
  opacity: 0.92;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.hero-tags span {
  font-size: 0.76rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-profile-link {
  display: inline-block;
  color: #e0f2fe;
  font-size: 0.84rem;
  font-weight: 600;
}

.hero-profile-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
}

.nav-links a:hover {
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 220px;
  max-width: 320px;
}

.search-box input {
  width: 100%;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  outline: none;
  background: var(--bg);
}

.search-box input:focus {
  border-color: var(--primary);
  background: #fff;
}

.search-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Main Container */
.container {
  max-width: 1120px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
}

.section-title {
  font-size: 1.28rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* About & Personal Info Bento */
.about-section {
  margin-bottom: 0.5rem;
}

.about-section .section-title {
  margin-top: 0.6rem;
}

.about-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(300px, 0.92fr);
  gap: 1.25rem;
  align-items: stretch;
}

.about-bio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.55rem 1.65rem;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.06) 0%, transparent 48%),
    var(--surface);
}

.bio-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bio-avatar {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0284c7 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.bio-identity {
  min-width: 0;
}

.bio-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.bio-name-row h3 {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 700;
  color: #0f172a;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #ccfbf1;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.bio-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.bio-quote {
  margin: 0;
  padding: 0.85rem 1.05rem;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border-left: 3.5px solid var(--primary);
  border-radius: 0 10px 10px 0;
  color: #334155;
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.75;
}

.bio-prose p {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.78;
}

.bio-prose p:last-child {
  margin-bottom: 0;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.pillar-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.pillar-item:hover {
  border-color: #bfdbfe;
  transform: translateY(-2px);
}

.pillar-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.pillar-item strong {
  display: block;
  font-size: 0.9rem;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.pillar-item p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Personal Info & Contact Card */
.about-info-card {
  display: flex;
  flex-direction: column;
  padding: 1.45rem 1.5rem;
  background:
    radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.06) 0%, transparent 50%),
    var(--surface);
}

.info-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.45rem;
}

.info-desc {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.78rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.contact-item.link-item {
  color: inherit;
}

.contact-item.link-item:hover {
  text-decoration: none;
  border-color: #93c5fd;
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon.wechat {
  background: #ecfdf5;
  color: #059669;
}

.contact-icon.qq {
  background: #eff6ff;
  color: #2563eb;
}

.contact-icon.blog {
  background: #fef3c7;
  color: #b45309;
}

.contact-icon.github {
  background: #f1f5f9;
  color: #0f172a;
}

.contact-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.contact-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.contact-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.contact-item.link-item .contact-value {
  font-family: inherit;
}

.copy-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.copy-btn.copied {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}

.contact-arrow {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.info-divider {
  height: 1px;
  background: var(--border);
  margin: 1.05rem 0;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.interest-tags span {
  font-size: 0.8rem;
  font-weight: 500;
  color: #334155;
  background: var(--surface-soft);
  border: 1px solid #dbeafe;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
}

.blog-quick-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: auto;
  padding-top: 1.05rem;
}

.blog-quick-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.52rem 0.65rem;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid #dbeafe;
  transition: background 0.16s ease, transform 0.16s ease;
}

.blog-quick-bar a:hover {
  background: #dbeafe;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.media-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.media-tag.audio {
  background: var(--accent-soft);
  color: var(--accent);
}

.card h3 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.08rem;
}

.media-meta {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

video, audio {
  width: 100%;
  border-radius: 10px;
  background: #0f172a;
}

.bili-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
}

.bili-wrap iframe, .bili-wrap video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: contain;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem;
}

.poster-card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.02rem;
}

.poster-img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

audio {
  background: var(--surface-soft);
}

.speed-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.speed-bar span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  padding: 0.22rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-chip.active, .btn-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.media-fallback {
  margin-top: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  color: var(--warn);
  border-radius: 8px;
  font-size: 0.82rem;
  display: none;
}

.ext-link {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Grammar Layout */
.grammar-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.toc-sidebar {
  position: sticky;
  top: 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}

.toc-sidebar h4 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0.25rem;
}

.toc-list a {
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-size: 0.86rem;
  color: var(--text);
}

.toc-list a:hover {
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}

.toc-list a.sub {
  padding-left: 1.15rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.grammar-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  min-width: 0;
}

.grammar-content h2 {
  font-size: 1.32rem;
  color: var(--primary-dark);
  border-bottom: 2px solid var(--primary-soft);
  padding-bottom: 0.4rem;
  margin: 2rem 0 1rem;
}

.grammar-content h2:first-child {
  margin-top: 0;
}

.grammar-content h3 {
  font-size: 1.08rem;
  margin: 1.35rem 0 0.6rem;
  color: #0f172a;
}

.grammar-content h4 {
  font-size: 0.98rem;
  margin: 1rem 0 0.4rem;
  color: var(--accent);
}

.grammar-content p, .grammar-content li {
  font-size: 0.95rem;
}

.grammar-content ul, .grammar-content ol {
  padding-left: 1.35rem;
}

.grammar-content code {
  background: var(--surface-soft);
  color: #1e40af;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
}

.grammar-content blockquote {
  margin: 0.8rem 0;
  padding: 0.65rem 1rem;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0.9rem 0;
}

.grammar-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 520px;
}

.grammar-content th, .grammar-content td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

.grammar-content th {
  background: var(--surface-soft);
  font-weight: 600;
}

mark.hl {
  background: #fef08a;
  color: #1e293b;
  padding: 0 2px;
  border-radius: 3px;
}

/* Quiz */
.quiz-list {
  display: grid;
  gap: 1rem;
}

.quiz-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.quiz-q {
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quiz-opt {
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 0.42rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.quiz-opt:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.quiz-opt.correct {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
  font-weight: 600;
}

.quiz-opt.wrong {
  background: var(--err-soft);
  border-color: var(--err);
  color: var(--err);
}

.quiz-exp {
  margin-top: 0.65rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 0.88rem;
  display: none;
}

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
  padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

@media (max-width: 920px) {
  .hero-grid,
  .about-bento {
    grid-template-columns: 1fr;
  }
  .pillar-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .grammar-layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    position: static;
    max-height: none;
  }
  .grammar-content {
    padding: 1.15rem 1rem;
  }
  .about-bio-card,
  .about-info-card {
    padding: 1.25rem 1.15rem;
  }
  .blog-quick-bar {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    justify-content: center;
  }
}
