html {
  scroll-behavior: smooth;
}

:root {
  --hero-photo: url("../images/mac.jpg");
  --bg: #f7fbff;
  --bg-deep: #e9f2fb;
  --surface: rgba(255, 255, 255, 0.28);
  --surface-strong: rgba(255, 255, 255, 0.46);
  --surface-soft: rgba(244, 250, 255, 0.2);
  --text: #152033;
  --muted: #657184;
  --muted-strong: #49576c;
  --line: rgba(122, 145, 170, 0.28);
  --glass-line: rgba(255, 255, 255, 0.62);
  --glass-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.12) 52%, rgba(235, 251, 255, 0.28));
  --glass-nav: linear-gradient(135deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.14) 48%, rgba(239, 251, 255, 0.32));
  --blue: #2478ff;
  --cyan: #25bfd2;
  --mint: #49c69d;
  --rose: #d9557c;
  --amber: #ad7d28;
  --footer: #101722;
  --shadow: 0 30px 90px rgba(19, 32, 50, 0.2);
  --shadow-soft: 0 18px 48px rgba(19, 32, 50, 0.14);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(255, 255, 255, 0.26), inset 1px 0 0 rgba(255, 255, 255, 0.25);
  --section-width: min(1180px, calc(100% - 48px));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(232, 246, 255, 0.86) 0%, rgba(250, 253, 255, 0.98) 36%, rgba(242, 250, 246, 0.92) 72%, rgba(250, 253, 255, 0.98) 100%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  font-family: "Noto Sans TC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(36, 120, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 120, 255, 0.035) 1px, transparent 1px),
    linear-gradient(115deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, 0.38));
  background-size: 72px 72px, 72px 72px, 100% 100%;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), transparent 78%);
}

a {
  color: inherit;
}

p,
ul {
  margin-top: 0;
}

img {
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--mint));
  transform: scaleX(0);
  transform-origin: left;
}

#header {
  position: relative;
}

#head {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 100svh;
  margin: 0;
  border-bottom: 0;
  background: var(--hero-photo) center/cover no-repeat;
  isolation: isolate;
}

.hero-carousel,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-carousel {
  z-index: 0;
}

.hero-slide {
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity 900ms ease, transform 6200ms ease;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.head-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(230, 246, 255, 0.24) 48%, rgba(247, 251, 255, 0.92) 100%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.04) 42%, rgba(36, 120, 255, 0.12));
}

.hero-shell {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  width: var(--section-width);
  min-height: inherit;
  margin: 0 auto;
  padding: 126px 0 78px;
}

#logo {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 42px 34px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-bg);
  box-shadow: var(--shadow), var(--glass-inset);
  text-align: center;
  backdrop-filter: blur(40px) saturate(180%) brightness(1.08);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.08);
}

#logo::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 34%),
    linear-gradient(245deg, rgba(64, 205, 221, 0.18), rgba(255, 255, 255, 0) 42%);
  opacity: 0.78;
}

#logo > * {
  position: relative;
  z-index: 1;
}

#head img.img-circle {
  width: 128px;
  height: 128px;
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 18px 38px rgba(31, 45, 67, 0.18), var(--glass-inset);
}

#head .title {
  display: block;
  margin-top: 22px;
  font-family: "Noto Serif TC", serif;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.12;
}

#head .tagline,
#head .subtagline {
  display: block;
}

#head .tagline {
  max-width: 720px;
  margin-top: 14px;
  color: var(--muted-strong);
  font-size: 1.25rem;
  line-height: 1.7;
}

#head .subtagline {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.index-navbar {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100%;
  margin: 0;
  padding: 0 24px;
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
}

.nav-shell {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-nav);
  box-shadow: 0 18px 48px rgba(20, 34, 52, 0.16), var(--glass-inset);
  backdrop-filter: blur(34px) saturate(190%) brightness(1.08);
  -webkit-backdrop-filter: blur(34px) saturate(190%) brightness(1.08);
}

.nav-home a,
.nav-center a,
.nav-actions a {
  text-decoration: none;
}

.nav-home a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #20304c;
  font-weight: 800;
}

.nav-home i {
  color: var(--blue);
}

.nav-center {
  display: flex;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-center::-webkit-scrollbar {
  display: none;
}

.nav-center a {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 10px 10px;
  border-radius: 999px;
  color: #516177;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.nav-center a:hover,
.nav-center a:focus-visible,
.nav-center a[aria-current="page"] {
  color: var(--blue);
  background: rgba(255, 255, 255, 0.64);
  outline: none;
}

.nav-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 8px;
}

.nav-actions a,
.project-links a,
.link-field button,
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: #0e5ed7;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(224, 244, 255, 0.64));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 10px 24px rgba(36, 120, 255, 0.12);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.lang-toggle {
  cursor: pointer;
  font-family: inherit;
}

.nav-actions a:hover,
.project-links a:hover,
.link-field button:hover {
  border-color: rgba(36, 120, 255, 0.38);
  color: #063f9c;
  transform: translateY(-1px);
}

.container {
  width: var(--section-width);
  margin: 0 auto;
}

.section {
  padding-top: 76px;
  scroll-margin-top: 106px;
}

#profile {
  padding-top: 42px;
}

.topspace {
  margin-top: 0;
}

.col-full {
  width: 100%;
}

.lead {
  max-width: 1040px;
  margin: 0 auto;
  color: var(--muted-strong);
  font-size: 1.55rem;
  line-height: 1.8;
}

.lead strong {
  color: var(--rose);
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted);
}

.highlight-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.metric-box,
.info-card,
.timeline-card,
.project-tile,
.writing-composer {
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-bg);
  box-shadow: var(--shadow-soft), var(--glass-inset);
  backdrop-filter: blur(30px) saturate(170%) brightness(1.06);
  -webkit-backdrop-filter: blur(30px) saturate(170%) brightness(1.06);
}

.metric-box {
  padding: 18px;
}

.metric-number {
  color: #182235;
  font-family: "Noto Serif TC", serif;
  font-size: clamp(1.55rem, 2.3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.metric-label {
  margin-top: 9px;
  color: #52647a;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.section-title {
  position: relative;
  margin: 0 0 34px;
  color: #253145;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0;
}

.section-title span {
  position: relative;
  display: inline-block;
  padding: 0 18px;
  font-family: "Noto Sans TC", Arial, sans-serif;
  letter-spacing: 0;
}

.section-title span::before,
.section-title span::after {
  position: absolute;
  top: 50%;
  width: 104px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(36, 120, 255, 0.34), transparent);
}

.section-title span::before {
  right: 100%;
}

.section-title span::after {
  left: 100%;
}

.card-grid {
  display: grid;
  gap: 18px;
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card {
  padding: 23px;
}

.info-card time,
.timeline-badge,
.project-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
}

.info-card time,
.timeline-badge {
  color: #176f83;
}

.info-card h3,
.timeline-card h3,
.project-tile h3,
.writing-head h3 {
  margin: 14px 0 10px;
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.55rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.info-card p,
.timeline-card p,
.project-tile p,
.project-readme p,
.project-readme li,
.experience-detail li,
.info-card li,
.writing-head p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.78;
}

.info-card p:last-child,
.timeline-card p:last-child,
.project-tile p:last-child,
.writing-head p:last-child {
  margin-bottom: 0;
}

.timeline-wrap {
  display: grid;
  gap: 16px;
}

.timeline-card {
  position: relative;
  padding: 23px 23px 23px 30px;
  overflow: hidden;
}

.timeline-card::before {
  position: absolute;
  top: 24px;
  left: 14px;
  width: 4px;
  height: calc(100% - 48px);
  content: "";
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--mint), rgba(36, 120, 255, 0.42));
}

.experience-card summary {
  position: relative;
  display: grid;
  gap: 0;
  padding-right: 38px;
  cursor: pointer;
  list-style: none;
}

.experience-card summary::-webkit-details-marker {
  display: none;
}

.experience-card summary::after {
  position: absolute;
  top: 8px;
  right: 4px;
  width: 11px;
  height: 11px;
  content: "";
  border-right: 2px solid #5f7187;
  border-bottom: 2px solid #5f7187;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.experience-card[open] summary {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.58);
}

.experience-card[open] summary::after {
  transform: rotate(225deg);
}

.experience-detail {
  display: grid;
  grid-template-columns: minmax(170px, 0.34fr) minmax(0, 1fr);
  gap: 20px;
  padding-top: 18px;
}

.experience-visual {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  min-height: 170px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 0;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(36, 120, 255, 0.78), rgba(37, 191, 210, 0.44)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
  box-shadow: var(--glass-inset), 0 18px 36px rgba(36, 120, 255, 0.16);
  cursor: zoom-in;
  font-size: 3rem;
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.experience-visual:hover,
.experience-visual:focus-visible {
  border-color: rgba(36, 120, 255, 0.38);
  box-shadow: var(--glass-inset), 0 24px 46px rgba(36, 120, 255, 0.2);
  transform: translateY(-2px);
}

.experience-visual:focus-visible {
  outline: 3px solid rgba(36, 120, 255, 0.26);
  outline-offset: 3px;
}

.experience-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.experience-visual[data-visual="medical"] img {
  object-position: center top;
}

.experience-visual[data-visual="lab"] {
  background:
    linear-gradient(145deg, rgba(37, 191, 210, 0.76), rgba(73, 198, 157, 0.44)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
}

.experience-visual[data-visual="workshop"] {
  background:
    linear-gradient(145deg, rgba(217, 85, 124, 0.74), rgba(36, 120, 255, 0.44)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
}

.experience-visual[data-visual="medical"] {
  background:
    linear-gradient(145deg, rgba(73, 198, 157, 0.76), rgba(36, 120, 255, 0.46)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
}

.experience-visual[data-visual="engineering"] {
  background:
    linear-gradient(145deg, rgba(173, 125, 40, 0.72), rgba(36, 120, 255, 0.42)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
}

.experience-visual[data-visual="leadership"] {
  background:
    linear-gradient(145deg, rgba(142, 91, 198, 0.76), rgba(36, 120, 255, 0.46)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
}

.experience-icon {
  cursor: default;
  font-size: 3.25rem;
}

.experience-icon:hover {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: var(--glass-inset), 0 18px 36px rgba(36, 120, 255, 0.16);
  transform: none;
}

.experience-detail h4 {
  margin: 0 0 8px;
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.28rem;
  line-height: 1.35;
}

.experience-detail ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.project-grid [hidden],
.certificate-grid [hidden] {
  display: none;
}

.project-tile {
  position: relative;
  min-height: 292px;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-tile::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 34%),
    linear-gradient(250deg, rgba(37, 191, 210, 0.14), rgba(255, 255, 255, 0) 42%);
}

.project-tile:hover {
  border-color: rgba(36, 120, 255, 0.34);
  box-shadow: 0 26px 68px rgba(31, 45, 67, 0.17), var(--glass-inset);
  transform: translateY(-3px);
}

.project-tile summary {
  position: relative;
  display: flex;
  min-height: 292px;
  flex-direction: column;
  padding: 22px 48px 22px 22px;
  cursor: pointer;
  list-style: none;
}

.project-tile summary::-webkit-details-marker {
  display: none;
}

.project-tile summary::after {
  position: absolute;
  top: 24px;
  right: 22px;
  width: 11px;
  height: 11px;
  content: "";
  border-right: 2px solid #5f7187;
  border-bottom: 2px solid #5f7187;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.project-tile[open] summary {
  min-height: 214px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
}

.project-tile[open] summary::after {
  transform: rotate(225deg);
}

.project-chip {
  align-self: flex-start;
  color: #8b641b;
  background: rgba(255, 247, 219, 0.72);
}

.project-tile h3 {
  margin: 18px 0 10px;
  font-size: 1.45rem;
}

.project-tile summary > p {
  margin-bottom: 0;
}

.project-body {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 18px 22px 22px;
}

.project-readme {
  padding: 0;
}

.project-readme h4 {
  margin: 0 0 10px;
  color: #1c2a3e;
  font-family: "Noto Sans TC", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.project-readme ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-links a {
  min-height: 40px;
  padding: 0 13px;
  font-size: 0.82rem;
}

.project-button-disabled {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 0 14px;
  color: #5d6f84;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--glass-inset);
  cursor: not-allowed;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.pagination-controls button,
.pagination-controls span {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-bg);
  box-shadow: var(--glass-inset);
  font-size: 0.86rem;
  font-weight: 900;
}

.pagination-controls button {
  gap: 8px;
  padding: 0 15px;
  color: #0e5ed7;
  cursor: pointer;
}

.pagination-controls button:disabled {
  color: #8090a4;
  cursor: not-allowed;
  opacity: 0.62;
}

.pagination-controls span {
  min-width: 68px;
  padding: 0 14px;
  color: var(--muted-strong);
}

.leetcode-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
  gap: 18px;
  align-items: stretch;
}

.leetcode-summary,
.leetcode-calendar-card,
.leetcode-submissions-card {
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-bg);
  box-shadow: var(--shadow-soft), var(--glass-inset);
  backdrop-filter: blur(30px) saturate(170%) brightness(1.06);
  -webkit-backdrop-filter: blur(30px) saturate(170%) brightness(1.06);
}

.leetcode-summary {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.leetcode-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.leetcode-person img {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--glass-inset), 0 14px 28px rgba(31, 45, 67, 0.12);
}

.leetcode-person span,
.leetcode-person small,
.leetcode-card-head p,
.submission-meta {
  color: var(--muted);
}

.leetcode-person span {
  display: block;
  font-size: 0.8rem;
  font-weight: 900;
}

.leetcode-person strong {
  display: block;
  margin-top: 3px;
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.45rem;
  line-height: 1.25;
}

.leetcode-person small {
  display: block;
  margin-top: 5px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.leetcode-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.leetcode-metric {
  min-width: 0;
  padding: 16px;
}

.leetcode-metric:first-child {
  grid-column: 1 / -1;
}

.leetcode-metric .metric-number {
  font-size: 1.72rem;
  overflow-wrap: anywhere;
}

.leetcode-breakdown {
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.62);
  padding-top: 18px;
}

.difficulty-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: center;
}

.difficulty-name,
.difficulty-count {
  color: #172235;
  font-size: 0.84rem;
  font-weight: 900;
}

.difficulty-count {
  text-align: right;
}

.difficulty-bar {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 2px rgba(31, 45, 67, 0.08);
}

.difficulty-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #49c69d, #25bfd2);
  transition: width 420ms ease;
}

[data-leetcode-difficulty="medium"] .difficulty-fill {
  background: linear-gradient(90deg, #f4bd50, #ad7d28);
}

[data-leetcode-difficulty="hard"] .difficulty-fill {
  background: linear-gradient(90deg, #f06f8f, #d9557c);
}

.leetcode-calendar-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.leetcode-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.leetcode-card-head h3 {
  margin: 0 0 6px;
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.55rem;
  line-height: 1.3;
}

.leetcode-card-head p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.leetcode-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: var(--glass-inset);
}

.leetcode-calendar-wrap {
  overflow-x: auto;
  padding: 4px 0 2px;
  scrollbar-width: thin;
}

.leetcode-calendar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 12px;
  grid-template-rows: repeat(7, 12px);
  gap: 4px;
  min-height: 108px;
  width: max-content;
}

.leetcode-day {
  display: block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 3px;
  background: rgba(220, 229, 238, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.leetcode-day.is-empty {
  visibility: hidden;
}

.leetcode-day.level-1 {
  background: #b7e7c8;
}

.leetcode-day.level-2 {
  background: #70ce91;
}

.leetcode-day.level-3 {
  background: #28a958;
}

.leetcode-day.level-4 {
  background: #116f39;
}

.leetcode-submissions-card {
  grid-column: 1 / -1;
  padding: 22px;
}

.leetcode-submissions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.leetcode-submission,
.leetcode-empty {
  display: grid;
  gap: 8px;
  min-height: 122px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.24));
  box-shadow: var(--glass-inset);
  text-decoration: none;
}

.leetcode-submission:hover {
  border-color: rgba(36, 120, 255, 0.34);
  transform: translateY(-2px);
}

.leetcode-submission strong {
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1rem;
  line-height: 1.35;
}

.submission-status {
  width: fit-content;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #7d4f06;
  background: rgba(255, 239, 198, 0.8);
  font-size: 0.72rem;
  font-weight: 900;
}

.submission-status.accepted {
  color: #12613a;
  background: rgba(205, 244, 221, 0.84);
}

.submission-meta {
  align-self: end;
  font-size: 0.8rem;
  line-height: 1.5;
}

.leetcode-empty {
  grid-column: 1 / -1;
  min-height: 100px;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.leetcode-section.is-loading .leetcode-calendar,
.leetcode-section.is-loading .leetcode-submissions {
  opacity: 0.58;
}

.leetcode-section.has-error .leetcode-summary,
.leetcode-section.has-error .leetcode-calendar-card,
.leetcode-section.has-error .leetcode-submissions-card {
  border-color: rgba(217, 85, 124, 0.36);
}

.github-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.github-summary,
.github-visuals-card,
.github-repos-card {
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-bg);
  box-shadow: var(--shadow-soft), var(--glass-inset);
  backdrop-filter: blur(30px) saturate(170%) brightness(1.06);
  -webkit-backdrop-filter: blur(30px) saturate(170%) brightness(1.06);
}

.github-summary,
.github-visuals-card,
.github-repos-card {
  padding: 22px;
}

@media (min-width: 821px) {
  .github-summary,
  .github-visuals-card {
    min-height: 668px;
    height: 100%;
  }
}

.github-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.github-person img {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--glass-inset), 0 14px 28px rgba(31, 45, 67, 0.12);
}

.github-person span,
.github-person small,
.github-card-head p,
.github-repo-description,
.github-repo-meta {
  color: var(--muted);
}

.github-person span {
  display: block;
  font-size: 0.8rem;
  font-weight: 900;
}

.github-person strong {
  display: block;
  margin-top: 3px;
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.45rem;
  line-height: 1.25;
}

.github-person small {
  display: block;
  margin-top: 5px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.github-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.github-metric {
  min-width: 0;
  padding: 16px;
}

.github-metric .metric-number {
  font-size: 1.72rem;
  overflow-wrap: anywhere;
}

.github-languages {
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.62);
  padding-top: 18px;
}

.github-languages h3,
.github-card-head h3 {
  margin: 0 0 8px;
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.28rem;
  line-height: 1.3;
}

.github-language-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  margin-top: 11px;
}

.github-language-name {
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.github-language-bar {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 2px rgba(31, 45, 67, 0.08);
}

.github-language-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.github-language-row strong {
  color: #172235;
  font-size: 0.82rem;
  text-align: right;
}

.github-visuals-card {
  display: grid;
  gap: 20px;
  align-content: start;
}

.github-card-head p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

.github-visual-block {
  display: grid;
  gap: 12px;
}

.github-stat-image {
  width: 100%;
  min-height: 120px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: var(--glass-inset);
  object-fit: contain;
}

.github-contrib-image {
  min-height: 92px;
  padding: 12px;
}

.github-repos-card {
  grid-column: 1 / -1;
}

.github-repo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.github-repo-card,
.github-empty {
  display: grid;
  gap: 9px;
  min-height: 144px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  padding: 15px;
  color: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.24));
  box-shadow: var(--glass-inset);
  text-decoration: none;
  transition: border-color 180ms ease, transform 180ms ease;
}

.github-repo-card:hover {
  border-color: rgba(36, 120, 255, 0.34);
  transform: translateY(-2px);
}

.github-repo-card strong {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.02rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.github-repo-card strong i {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 0.78rem;
}

.github-repo-description {
  display: -webkit-box;
  min-height: 42px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.86rem;
  line-height: 1.55;
}

.github-repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-self: end;
  font-size: 0.76rem;
  line-height: 1.5;
}

.github-repo-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.github-language-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.github-empty {
  grid-column: 1 / -1;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.github-section.is-loading .github-repo-grid,
.github-section.is-loading .github-languages,
.github-section.is-loading .github-stat-image {
  opacity: 0.58;
}

.github-section.has-error .github-summary,
.github-section.has-error .github-visuals-card,
.github-section.has-error .github-repos-card {
  border-color: rgba(217, 85, 124, 0.36);
}

.certificate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 18px;
}

.certificate-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  height: 100%;
  min-height: 312px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  padding: 18px;
  color: inherit;
  background: var(--glass-bg);
  box-shadow: var(--shadow-soft), var(--glass-inset);
  cursor: pointer;
  font: inherit;
  text-align: left;
  backdrop-filter: blur(30px) saturate(170%) brightness(1.06);
  -webkit-backdrop-filter: blur(30px) saturate(170%) brightness(1.06);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.certificate-card:hover {
  border-color: rgba(36, 120, 255, 0.34);
  box-shadow: 0 26px 68px rgba(31, 45, 67, 0.17), var(--glass-inset);
  transform: translateY(-3px);
}

.certificate-preview {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  min-height: 0;
  width: 100%;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  padding: 8px;
  color: #0e5ed7;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(239, 251, 255, 0.68)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0));
  box-shadow: var(--glass-inset);
  font-size: 2.8rem;
}

.certificate-preview img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
}

.certificate-card strong {
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.28rem;
  line-height: 1.34;
}

.certificate-card span:last-child {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.certificate-lightbox[hidden] {
  display: none;
}

.certificate-lightbox {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(13, 22, 34, 0.46);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
}

.lightbox-panel {
  position: relative;
  display: grid;
  width: min(960px, 100%);
  max-height: min(86vh, 820px);
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(239, 251, 255, 0.58));
  box-shadow: 0 38px 110px rgba(4, 12, 24, 0.32), var(--glass-inset);
}

.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.64);
  padding: 16px 18px;
}

.lightbox-head h2 {
  margin: 0;
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.35rem;
}

.lightbox-head button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #0e5ed7;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--glass-inset);
  cursor: pointer;
}

.lightbox-body {
  display: grid;
  max-height: calc(86vh - 72px);
  overflow: auto;
  padding: 18px;
}

.lightbox-body img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 58px rgba(19, 32, 50, 0.18);
}

.lightbox-placeholder {
  display: grid;
  min-height: 420px;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px dashed rgba(36, 120, 255, 0.32);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.lightbox-placeholder i {
  color: var(--blue);
  font-size: 3rem;
}

.lightbox-placeholder strong {
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.45rem;
}

.writing-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.writing-composer {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.writing-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.platform-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--glass-inset), 0 12px 26px rgba(31, 45, 67, 0.1);
  font-size: 1.25rem;
}

.medium-mark {
  color: #0f1722;
}

.hackmd-mark {
  color: var(--cyan);
}

.writing-head h3 {
  margin: 0 0 5px;
}

.writing-composer label {
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.link-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.link-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  padding: 0 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 0 0 1px rgba(122, 145, 170, 0.12);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
}

.link-field input:focus {
  border-color: rgba(36, 120, 255, 0.46);
  box-shadow: 0 0 0 4px rgba(36, 120, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.link-field button {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.article-preview {
  min-height: 182px;
  border-top: 1px solid rgba(255, 255, 255, 0.62);
  padding-top: 18px;
}

.article-card {
  display: grid;
  gap: 10px;
  min-height: 164px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  color: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.24));
  box-shadow: var(--glass-inset);
  text-decoration: none;
}

.article-card:hover {
  border-color: rgba(36, 120, 255, 0.34);
}

.article-source {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.article-card strong {
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.45rem;
  line-height: 1.3;
}

.article-card > span:not(.article-source):not(.article-meta) {
  color: var(--muted);
  line-height: 1.65;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.article-meta span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #36506f;
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  font-weight: 800;
}

.split-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.split-section-head .section-title {
  width: auto;
  margin-bottom: 0;
  text-align: left;
}

.glass-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  color: #0e5ed7;
  background: var(--glass-nav);
  box-shadow: var(--glass-inset), 0 12px 28px rgba(36, 120, 255, 0.12);
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}

.primary-link {
  color: #ffffff;
  border-color: rgba(36, 120, 255, 0.42);
  background: linear-gradient(180deg, rgba(36, 120, 255, 0.92), rgba(19, 94, 214, 0.84));
}

.writing-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-bg);
  box-shadow: var(--shadow-soft), var(--glass-inset);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
}

.writing-intro h3 {
  margin: 0 0 8px;
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.7rem;
}

.writing-intro p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.article-strip,
.article-library {
  display: grid;
  gap: 16px;
}

.article-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-library {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-card-rich {
  min-height: 230px;
}

.mini-platform {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--glass-inset);
}

.medium-mini {
  color: #0f1722;
}

.hackmd-mini {
  color: var(--cyan);
}

.page-header-shell {
  min-height: 0;
}

.article-main {
  width: var(--section-width);
  margin: 0 auto;
  padding-top: 132px;
}

.article-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: stretch;
  min-height: 360px;
  padding: 34px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.16)),
    var(--hero-photo) center/cover no-repeat;
  box-shadow: var(--shadow), var(--glass-inset);
  overflow: hidden;
  position: relative;
}

.article-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(247, 251, 255, 0.86), rgba(247, 251, 255, 0.34));
}

.article-hero > * {
  position: relative;
  z-index: 1;
}

.article-hero-copy {
  display: grid;
  align-content: center;
  max-width: 760px;
}

.back-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #0e5ed7;
  font-weight: 900;
  text-decoration: none;
}

.article-hero h1 {
  margin: 0;
  color: #132035;
  font-family: "Noto Serif TC", serif;
  font-size: 4rem;
  line-height: 1.05;
}

.article-hero p {
  max-width: 690px;
  margin: 16px 0 0;
  color: var(--muted-strong);
  font-size: 1.12rem;
  line-height: 1.75;
}

.article-stats {
  display: grid;
  gap: 14px;
  align-content: end;
}

.article-stats div {
  padding: 20px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-bg);
  box-shadow: var(--glass-inset);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
}

.article-stats strong {
  display: block;
  color: #132035;
  font-family: "Noto Serif TC", serif;
  font-size: 2.2rem;
  line-height: 1;
}

.article-stats span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.writing-lab {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.writing-head h2 {
  margin: 0 0 5px;
  color: #172235;
  font-family: "Noto Serif TC", serif;
  font-size: 1.55rem;
  line-height: 1.35;
}

.article-controls {
  position: sticky;
  top: 92px;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-nav);
  box-shadow: 0 16px 42px rgba(20, 34, 52, 0.12), var(--glass-inset);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--glass-inset);
}

.search-field i {
  color: var(--blue);
}

.search-field input {
  width: 100%;
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 0.94rem;
  outline: none;
}

.filter-tabs {
  display: flex;
  gap: 8px;
}

.filter-tabs button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: var(--glass-inset);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
}

.filter-tabs button.is-active {
  color: #ffffff;
  border-color: rgba(36, 120, 255, 0.36);
  background: linear-gradient(180deg, rgba(36, 120, 255, 0.92), rgba(19, 94, 214, 0.84));
}

.article-featured {
  padding-top: 48px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 30px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--glass-bg);
  text-align: center;
  box-shadow: var(--glass-inset);
}

#underfooter {
  margin-top: 76px;
  background:
    linear-gradient(145deg, rgba(16, 23, 34, 0.96), rgba(20, 35, 48, 0.94)),
    var(--footer);
}

.footer-shell {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  width: var(--section-width);
  margin: 0 auto;
  padding: 26px 0;
}

.footer-shell h4 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 0.75rem;
  letter-spacing: 0;
}

.footer-shell p,
.footer-shell a {
  margin: 4px 0;
  color: #c9d1dc;
  font-size: 0.84rem;
  line-height: 1.6;
  text-decoration: none;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-links a {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1rem;
  transition: transform 160ms ease, background 160ms ease;
}

.social-links a:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.footer-shell a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0 18px;
  color: #9ca7b6;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.78rem;
}

@media (max-width: 1120px) {
  .nav-shell {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .nav-actions {
    justify-content: center;
  }

  .nav-center {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-center::-webkit-scrollbar {
    display: none;
  }

  .nav-center a {
    flex: 0 0 auto;
  }

  .highlight-panel,
  .project-grid,
  .certificate-grid,
  .leetcode-submissions,
  .github-repo-grid,
  .three-col,
  .article-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  :root {
    --section-width: calc(100% - 32px);
  }

  #head {
    min-height: 100svh;
  }

  .hero-shell {
    padding: 126px 0 76px;
  }

  #logo {
    padding: 32px 22px;
  }

  #head .title {
    font-size: 2.65rem;
  }

  #head .tagline {
    font-size: 1.05rem;
  }

  .lead {
    font-size: 1.22rem;
  }

  .highlight-panel,
  .three-col,
  .two-col,
  .project-grid,
  .certificate-grid,
  .leetcode-shell,
  .leetcode-submissions,
  .github-shell,
  .github-repo-grid,
  .writing-shell,
  .writing-lab,
  .article-strip,
  .article-library,
  .article-hero,
  .article-controls,
  .footer-shell {
    grid-template-columns: 1fr;
  }

  .article-main {
    padding-top: 112px;
  }

  .article-hero {
    min-height: 320px;
    padding: 28px;
  }

  .article-hero h1 {
    font-size: 3rem;
  }

  .article-controls {
    position: static;
  }

  .experience-detail {
    grid-template-columns: 1fr;
  }

  .section-title span::before,
  .section-title span::after {
    width: 54px;
  }
}

@media (max-width: 620px) {
  :root {
    --section-width: calc(100% - 24px);
  }

  .index-navbar {
    top: 8px;
    padding: 0 10px;
  }

  .nav-shell {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }

  .nav-center {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-center::-webkit-scrollbar {
    display: none;
  }

  .nav-center a {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 9px 8px;
    font-size: 0.78rem;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-actions::-webkit-scrollbar {
    display: none;
  }

  .nav-actions a,
  .nav-actions .lang-toggle {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 9px;
    font-size: 0.74rem;
  }

  #head {
    min-height: 100svh;
  }

  .hero-shell {
    padding: 158px 0 58px;
  }

  #head img.img-circle {
    width: 104px;
    height: 104px;
  }

  #head .title {
    font-size: 2.15rem;
  }

  #head .tagline {
    font-size: 0.98rem;
  }

  .section {
    padding-top: 52px;
    scroll-margin-top: 160px;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .section-title span::before,
  .section-title span::after {
    display: none;
  }

  .info-card h3,
  .timeline-card h3,
  .project-tile h3,
  .writing-head h3,
  .article-card strong {
    font-size: 1.25rem;
  }

  .project-tile,
  .project-tile summary {
    min-height: 250px;
  }

  .project-tile[open] summary {
    min-height: 190px;
  }

  .link-field {
    grid-template-columns: 1fr;
  }

  .link-field button {
    width: 100%;
  }

  .writing-intro,
  .split-section-head,
  .leetcode-metrics,
  .leetcode-card-head,
  .github-metrics,
  .article-controls {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .split-section-head {
    display: grid;
  }

  .leetcode-card-head {
    display: grid;
  }

  .article-main {
    padding-top: 150px;
  }

  .article-hero {
    padding: 22px;
  }

  .article-hero h1 {
    font-size: 2.35rem;
  }

  .filter-tabs {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .filter-tabs button {
    flex: 0 0 auto;
  }

  .pagination-controls {
    flex-wrap: wrap;
  }

  .certificate-card {
    min-height: 300px;
  }

  .experience-visual {
    min-height: 132px;
  }

  .certificate-lightbox {
    padding: 12px;
  }

  .lightbox-placeholder {
    min-height: 280px;
  }
}
