.brand-mascot,
.hero-mascot { display: none; }

.theme-toggle { white-space: nowrap; }

/* Q-style visual refresh inspired by hand-drawn notebook interfaces. */
@media screen {
  :root {
    --blue: #3f7de8;
    --blue-light: #6697ec;
    --ink: #4a4238;
    --muted: #746c62;
    --line: #c9bda9;
    --page: #fffdf7;
    --canvas: #f5ecd9;
    --notice: #fff5bd;
    --pink: #ef6b7a;
    --yellow: #f2c14e;
    --green: #4fbf8f;
    --soft-blue: #dfeaff;
    --soft-pink: #ffe1e5;
    --soft-green: #dff4e9;
    --paper-shadow: 5px 6px 0 rgba(74, 66, 56, 0.15);
    --max-width: 1180px;
  }

  html {
    background-color: var(--canvas);
    background-image:
      radial-gradient(circle at 10% 18%, rgba(242, 193, 78, 0.24) 0 6px, transparent 7px),
      radial-gradient(circle at 86% 12%, rgba(239, 107, 122, 0.17) 0 8px, transparent 9px),
      radial-gradient(circle at 92% 72%, rgba(79, 191, 143, 0.2) 0 7px, transparent 8px),
      radial-gradient(circle at 23% 82%, rgba(63, 125, 232, 0.12) 0 5px, transparent 6px);
    background-size: 170px 170px, 230px 230px, 190px 190px, 210px 210px;
  }

  body {
    max-width: none;
    color: var(--ink);
    background: rgba(255, 253, 247, 0.82);
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.7;
  }

  a {
    color: #2f69cf;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
  }

  a:hover { color: #d64f61; }

  ::selection {
    color: var(--ink);
    background: #ffe58f;
  }

  .container {
    max-width: var(--max-width);
    padding-right: 28px;
    padding-left: 28px;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 250, 239, 0.93);
    border-bottom: 3px solid var(--ink);
    box-shadow: 0 4px 0 rgba(74, 66, 56, 0.08);
    backdrop-filter: blur(12px);
  }

  .nav-shell {
    min-height: 72px;
    gap: 14px;
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-family: "Comic Sans MS", "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 18px;
  }

  .brand-mascot {
    width: 46px;
    height: 46px;
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
    background: #fff8d8;
    border: 2px solid var(--ink);
    border-radius: 16px 13px 17px 12px;
    box-shadow: 3px 3px 0 rgba(74, 66, 56, 0.18);
    animation: mascot-bob 3.4s ease-in-out infinite;
  }

  .site-nav { gap: 2px; }

  .site-nav a {
    position: relative;
    padding: 8px 7px;
    color: var(--ink);
    border-radius: 12px;
    font-size: 12px;
    transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
  }

  .site-nav a + a::before { display: none; }

  .site-nav a:hover {
    color: #285fbf;
    background: var(--soft-blue);
    text-decoration: none;
    transform: translateY(-1px) rotate(-1deg);
  }

  .site-nav a[aria-current="page"] {
    color: #2459b6;
    background: #fff5bd;
  }

  .site-nav a[aria-current="page"]::after {
    position: absolute;
    right: 8px;
    bottom: 3px;
    left: 8px;
    height: 3px;
    background: repeating-linear-gradient(90deg, var(--pink) 0 8px, transparent 8px 11px);
    border-radius: 50%;
    content: "";
    transform: rotate(-1.5deg);
  }

  .language-switch {
    padding: 3px;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: 2px 3px 0 rgba(74, 66, 56, 0.14);
  }

  .language-switch button {
    min-width: 34px;
    padding: 4px 8px;
    color: var(--muted);
    border: 0;
    border-radius: 999px;
    font-size: 11px;
  }

  .language-switch button + button { border-left: 0; }

  .language-switch button.is-active {
    color: white;
    background: var(--blue);
  }

  .hero {
    position: relative;
    padding: 38px 0 30px;
    border-bottom: 0;
  }

  .hero-grid {
    position: relative;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 40px;
    padding: 38px 42px;
    overflow: hidden;
    background: rgba(255, 253, 247, 0.95);
    border: 3px solid var(--ink);
    border-radius: 36px 18px 34px 20px / 20px 36px 18px 34px;
    box-shadow: 8px 9px 0 rgba(63, 125, 232, 0.2);
  }

  .hero-grid::before,
  .hero-grid::after,
  .page-hero .container::before,
  .page-hero .container::after {
    position: absolute;
    z-index: 0;
    width: 150px;
    height: 150px;
    border: 3px dashed rgba(242, 193, 78, 0.7);
    border-radius: 50%;
    content: "";
    pointer-events: none;
  }

  .hero-grid::before {
    top: -82px;
    left: 38%;
    background: rgba(255, 238, 170, 0.27);
  }

  .hero-grid::after {
    right: -62px;
    bottom: -76px;
    border-color: rgba(79, 191, 143, 0.68);
    background: rgba(201, 240, 222, 0.32);
  }

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

  .eyebrow,
  .mini-label {
    width: fit-content;
    margin-bottom: 10px;
    padding: 3px 10px;
    color: var(--ink);
    background: #fff0a8;
    border: 2px solid var(--ink);
    border-radius: 999px 920px 999px 900px;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 11px;
    letter-spacing: 0.03em;
    text-transform: none;
    transform: rotate(-0.7deg);
  }

  .hero h1,
  .page-hero h1 {
    color: var(--ink);
    font-family: "Comic Sans MS", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .hero h1 { font-size: clamp(32px, 4vw, 46px); }

  .hero h1 .cn-name {
    color: #2f69cf;
    font-weight: 800;
  }

  .hero-role { color: #4b443b; font-size: 17px; }

  .hero-summary,
  .hero-summary p { color: #554e45; }

  .button,
  .filter-row button {
    padding: 7px 14px;
    color: var(--ink);
    background: white;
    border: 2px solid var(--ink);
    border-radius: 999px 940px 999px 930px;
    box-shadow: 3px 4px 0 rgba(74, 66, 56, 0.17);
    font-size: 12px;
    font-weight: 800;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  }

  .button:hover,
  .filter-row button:hover,
  .filter-row button.is-active {
    color: var(--ink);
    background: #fff0a8;
    border-color: var(--ink);
    box-shadow: 1px 2px 0 rgba(74, 66, 56, 0.18);
    text-decoration: none;
    transform: translate(2px, 2px);
  }

  .button-primary {
    color: white;
    background: var(--blue);
  }

  .button-primary:hover { color: var(--ink); background: #a9c6ff; }

  .portrait-wrap { width: 205px; }

  .portrait {
    width: 205px;
    height: 270px;
    border: 3px solid var(--ink);
    border-radius: 28px 16px 30px 20px / 20px 32px 18px 28px;
    box-shadow: 7px 8px 0 rgba(239, 107, 122, 0.25);
    transform: rotate(1.2deg);
  }

  .hero-mascot {
    position: absolute;
    right: -54px;
    bottom: -30px;
    z-index: 3;
    width: 122px;
    height: auto;
    display: block;
    filter: drop-shadow(3px 4px 0 rgba(74, 66, 56, 0.17));
    pointer-events: none;
    animation: mascot-bob 3.4s ease-in-out infinite;
  }

  .section,
  .section-compact,
  .page-main { padding: 30px 0; }

  .section + .section,
  .content-section + .content-section { border-top: 0; }

  .section-white,
  .section-dark { background: transparent; }

  .section-heading { margin-bottom: 18px; }

  .section-heading h2,
  .content-section h2,
  .section-dark .section-heading h2 {
    width: fit-content;
    padding-bottom: 5px;
    color: var(--ink);
    border-bottom: 3px dashed var(--blue-light);
    font-size: 22px;
  }

  .section-lead { color: var(--muted); }

  .text-link {
    padding: 5px 10px;
    color: #285fbf;
    background: var(--soft-blue);
    border-radius: 999px;
    font-weight: 700;
  }

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

  .card {
    padding: 22px;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 20px 13px 22px 15px / 15px 22px 14px 20px;
    box-shadow: var(--paper-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }

  .card:nth-child(odd) { transform: rotate(-0.45deg); }
  .card:nth-child(even) { transform: rotate(0.45deg); }

  .card:hover {
    box-shadow: 3px 4px 0 rgba(74, 66, 56, 0.17);
    transform: translateY(-3px) rotate(0);
  }

  .card-number {
    width: auto;
    margin-right: 5px;
    padding: 2px 7px;
    color: var(--ink);
    background: #fff0a8;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    font-weight: 800;
  }

  .card h3 { color: #285fbf; }
  .card p { margin: 10px 0 0; color: #5f574e; }

  .news-layout { gap: 22px; }

  .timeline {
    padding: 16px 20px;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 20px 14px 22px 16px;
    box-shadow: var(--paper-shadow);
    list-style: none;
  }

  .timeline li {
    padding: 10px 2px;
    border-bottom: 2px dashed #ded3c3;
  }

  .timeline li:last-child { border-bottom: 0; }

  .timeline time {
    width: fit-content;
    height: fit-content;
    padding: 2px 7px;
    color: var(--ink);
    background: var(--soft-blue);
    border: 1.5px solid var(--ink);
    border-radius: 999px;
  }

  .opening-card,
  .recruit-hero-card {
    padding: 20px;
    background: #fff5bd;
    border: 2px solid var(--ink);
    border-radius: 24px 14px 22px 16px / 16px 23px 15px 22px;
    box-shadow: 5px 6px 0 rgba(242, 193, 78, 0.35);
  }

  .opening-card .mini-label,
  .recruit-hero-card .mini-label {
    color: white;
    background: var(--pink);
  }

  .paper-list,
  .publication-list { display: grid; gap: 16px; }

  .paper-card,
  .section-white .paper-card,
  .publication-list .paper-card {
    padding: 18px;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 18px 13px 20px 15px;
    box-shadow: 4px 5px 0 rgba(74, 66, 56, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }

  .paper-card:hover {
    box-shadow: 2px 3px 0 rgba(74, 66, 56, 0.15);
    transform: translateY(-2px);
  }

  .paper-year,
  .section-white .paper-year,
  .publication-list .paper-year {
    width: fit-content;
    height: fit-content;
    padding: 3px 8px;
    color: var(--ink);
    background: #fff0a8;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
  }

  .paper-title,
  .section-white .paper-title,
  .publication-list .paper-title { color: var(--ink); font-size: 16px; }

  .paper-authors,
  .paper-venue,
  .section-white .paper-authors,
  .section-white .paper-venue,
  .publication-list .paper-authors,
  .publication-list .paper-venue { color: #5d554b; }

  .paper-rank {
    width: fit-content;
    padding: 2px 8px;
    color: #b63f50;
    background: var(--soft-pink);
    border: 1.5px solid #b63f50;
    border-radius: 999px;
  }

  .paper-links a,
  .paper-links span,
  .section-white .paper-links a,
  .publication-list .paper-links a,
  .section-white .paper-links span,
  .publication-list .paper-links span {
    padding: 2px 7px;
    color: #285fbf;
    background: var(--soft-blue);
    border: 1px solid #8caee8;
    border-radius: 999px;
  }

  .paper-links a::before,
  .paper-links span::before,
  .paper-links a::after,
  .paper-links span::after { content: none; }

  .paper-visual {
    border: 2px solid var(--ink);
    border-radius: 14px 10px 16px 11px;
    box-shadow: 3px 3px 0 rgba(74, 66, 56, 0.13);
  }

  .page-hero {
    position: relative;
    padding: 30px 0 8px;
    background: transparent;
    border-bottom: 0;
  }

  .page-hero .container {
    position: relative;
    padding: 28px 34px;
    overflow: hidden;
    background: #fffdf7;
    border: 3px solid var(--ink);
    border-radius: 30px 18px 28px 16px / 18px 28px 17px 30px;
    box-shadow: 7px 8px 0 rgba(63, 125, 232, 0.16);
  }

  .page-hero .container::before {
    top: -92px;
    right: 19%;
    background: rgba(255, 225, 229, 0.4);
    border-color: rgba(239, 107, 122, 0.62);
  }

  .page-hero .container::after {
    right: -74px;
    bottom: -96px;
    background: rgba(223, 244, 233, 0.5);
    border-color: rgba(79, 191, 143, 0.62);
  }

  .page-hero .container > * { position: relative; z-index: 1; }
  .page-hero .eyebrow { color: var(--ink); }
  .page-hero h1 { font-size: 31px; }
  .page-hero p { color: #5b534a; }

  .content-section {
    padding: 24px;
    background: rgba(255, 253, 247, 0.96);
    border: 2px solid var(--ink);
    border-radius: 20px 14px 22px 16px;
    box-shadow: var(--paper-shadow);
  }

  .content-section + .content-section {
    margin-top: 22px;
    padding-top: 24px;
    border-top: 2px solid var(--ink);
  }

  .content-section h3,
  .track-card h3,
  .student-card h3 { color: #285fbf; }

  .side-nav {
    top: 92px;
    padding: 14px;
    background: #fff5bd;
    border: 2px solid var(--ink);
    border-radius: 18px 12px 20px 14px;
    box-shadow: 4px 5px 0 rgba(74, 66, 56, 0.14);
  }

  .side-nav a {
    padding: 5px 8px;
    color: var(--ink);
    border-radius: 9px;
    font-weight: 700;
  }

  .side-nav a:hover { background: rgba(255, 255, 255, 0.66); text-decoration: none; }

  .topic-list li,
  .check-list li {
    margin: 7px 0;
    padding: 9px 12px;
    color: var(--ink);
    background: var(--soft-green);
    border: 1.5px dashed #629b7e;
    border-radius: 12px;
  }

  .stats-strip {
    gap: 8px;
    padding: 8px;
    background: #fff5bd;
    border: 2px solid var(--ink);
    border-radius: 18px;
    box-shadow: var(--paper-shadow);
  }

  .stat {
    padding: 10px 13px;
    background: white;
    border: 1.5px solid var(--ink);
    border-radius: 12px;
  }

  .stat:last-child { border-right: 1.5px solid var(--ink); }
  .stat strong { color: var(--ink); }

  .publication-note,
  .publication-priority,
  .quote-card {
    padding: 12px 15px;
    color: var(--ink);
    background: #fff5bd;
    border: 2px dashed #a98924;
    border-left: 5px solid var(--yellow);
    border-radius: 12px;
  }

  .project-list,
  .funding-list { display: grid; gap: 16px; }

  .project-item,
  .funding-item {
    padding: 18px;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 18px 13px 20px 14px;
    box-shadow: 4px 5px 0 rgba(74, 66, 56, 0.12);
  }

  .project-thumb {
    border: 2px solid var(--ink);
    border-radius: 12px;
  }

  .project-item h2,
  .funding-item h3 { color: var(--ink); }

  .funding-role,
  .project-meta {
    width: fit-content;
    padding: 3px 8px;
    color: var(--ink);
    background: var(--soft-blue);
    border: 1px solid #8caee8;
    border-radius: 999px;
  }

  .course-list { gap: 12px; }

  .course-list li {
    padding: 12px 14px;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 14px;
    box-shadow: 3px 4px 0 rgba(74, 66, 56, 0.11);
  }

  .student-groups,
  .track-grid,
  .process-grid { display: grid; gap: 14px; }

  .student-card,
  .track-card,
  .process-step {
    padding: 17px;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 18px 12px 20px 14px;
    box-shadow: 4px 5px 0 rgba(74, 66, 56, 0.11);
  }

  .student-status > h3 {
    width: fit-content;
    padding: 5px 12px;
    color: var(--ink);
    background: var(--soft-blue);
    border: 2px solid var(--ink);
    border-radius: 999px;
  }

  .year-block {
    padding-top: 14px;
    border-top: 4px dashed #ab9d89;
  }

  .year-block:first-child { padding-top: 0; border-top: 0; }

  .year-block + .year-block {
    margin-top: 30px;
    padding-top: 26px;
  }

  .year-block > h3 {
    width: fit-content;
    padding: 6px 13px;
    color: white;
    background: var(--blue);
    border: 2px solid var(--ink);
    border-radius: 999px 920px 999px 900px;
    box-shadow: 3px 4px 0 rgba(74, 66, 56, 0.16);
  }

  .year-role {
    margin-left: 9px;
    padding: 4px 10px;
    color: white;
    background: var(--pink);
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: 2px 3px 0 rgba(74, 66, 56, 0.14);
    font-size: 14px;
  }

  .achievement-list { display: grid; gap: 14px; }

  .achievement-list li,
  .has-certificate,
  .achievement-list li.has-certificate {
    padding: 15px !important;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 18px 12px 20px 14px;
    box-shadow: 4px 5px 0 rgba(74, 66, 56, 0.11);
  }

  .achievement-media a,
  .achievement-certificate-placeholder {
    border: 2px solid var(--ink);
    border-radius: 11px;
  }

  .achievement-certificate-placeholder {
    color: var(--muted);
    background: repeating-linear-gradient(135deg, #fffdf7 0 12px, #f4ecdc 12px 24px);
    border-style: dashed;
  }

  .student-congrats {
    width: fit-content;
    padding: 2px 8px;
    color: #c73e52;
    background: var(--soft-pink);
    border-radius: 999px;
  }

  .certificate-showcase {
    padding: 18px;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 18px;
  }

  .certificate-card__image,
  .certificate-card__blank {
    border: 2px solid var(--ink);
    border-radius: 14px;
    box-shadow: 3px 4px 0 rgba(74, 66, 56, 0.1);
  }

  .process-step b {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: white;
    background: var(--pink);
    border: 1.5px solid var(--ink);
    border-radius: 50%;
  }

  .site-footer {
    margin-top: 28px;
    padding: 24px 0;
    color: var(--muted);
    background: #fff5bd;
    border-top: 3px solid var(--ink);
  }

  .footer-name { color: var(--ink); }
  .footer-copy { color: var(--muted); }

  .footer-bottom,
  .site-counts { border-top: 2px dashed #c7aa54; }

  .menu-toggle {
    color: var(--ink);
    background: white;
    border: 2px solid var(--ink);
    border-radius: 10px;
    box-shadow: 2px 3px 0 rgba(74, 66, 56, 0.15);
  }

  @keyframes mascot-bob {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-4px) rotate(1deg); }
  }
}

@media screen and (max-width: 980px) {
  .site-nav a { padding-right: 5px; padding-left: 5px; font-size: 11px; }
  .brand-text { display: none; }
}

@media screen and (max-width: 760px) {
  .container { padding-right: 18px; padding-left: 18px; }

  .nav-shell { padding-top: 8px; padding-bottom: 8px; }
  .brand-text { display: inline; }

  .site-nav {
    padding: 12px;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 14px;
    box-shadow: 4px 5px 0 rgba(74, 66, 56, 0.13);
  }

  .site-nav a { padding: 7px 9px; font-size: 12px; }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 24px;
    padding: 28px 24px;
  }

  .portrait-wrap,
  .portrait { width: 145px; }
  .portrait { height: 194px; }
  .hero-mascot { right: -24px; bottom: -22px; width: 88px; }
  .card-grid { grid-template-columns: 1fr; }

  .content-section,
  .page-hero .container { padding: 22px; }

  .stats-strip { gap: 6px; }
  .stat { border: 1.5px solid var(--ink); }
}

@media screen and (max-width: 480px) {
  .hero-grid { padding: 24px 20px; }

  .portrait-wrap {
    margin: 5px 0 18px 18px;
  }

  .hero h1 { font-size: 31px; }
  .hero-mascot { right: -18px; bottom: -20px; width: 78px; }

  .publication-list .paper-visual,
  .achievement-media,
  .project-thumb { width: 100%; }

  .page-hero { padding-top: 20px; }
  .page-hero h1 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

