:root {
  color-scheme: light;
  --ink: #15191f;
  --muted: #747b85;
  --line: rgba(21, 25, 31, 0.11);
  --paper: #f7f8f5;
  --paper-deep: #eef0eb;
  --white: #ffffff;
  --blue: #2765d7;
  --blue-deep: #194da9;
  --amber: #e3a62b;
  --green: #3f8168;
  --shadow: 0 18px 60px rgba(31, 43, 59, 0.1), 0 2px 10px rgba(31, 43, 59, 0.05);
  --font-display: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-body: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(21, 25, 31, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 25, 31, 0.024) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.94) 0 19%, rgba(255, 255, 255, 0.3) 45%, transparent 70%);
  content: "";
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

img {
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  padding: 0 clamp(22px, 4vw, 58px);
  background: linear-gradient(to bottom, rgba(247, 248, 245, 0.94), rgba(247, 248, 245, 0));
}

.mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.mini-brand img {
  border-radius: 9px;
  box-shadow: 0 5px 18px rgba(31, 43, 59, 0.13);
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6c737d;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 180ms ease;
}

.local-badge:hover { color: #263038; }

.local-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4b9677;
  box-shadow: 0 0 0 4px rgba(75, 150, 119, 0.13);
}

.home-page {
  position: relative;
}

.qsy-corner-card {
  position: absolute;
  top: 98px;
  right: clamp(24px, 4vw, 58px);
  z-index: 12;
  width: 246px;
  padding: 17px 18px 16px;
  overflow: hidden;
  border: 1px solid rgba(46, 88, 68, 0.2);
  border-radius: 5px 5px 18px 5px;
  color: #28342e;
  background:
    linear-gradient(rgba(35, 74, 55, 0.035) 1px, transparent 1px),
    linear-gradient(118deg, #fffef9, #edf5ef);
  background-size: 100% 26px, auto;
  box-shadow:
    0 24px 54px rgba(31, 52, 42, 0.15),
    0 3px 8px rgba(31, 52, 42, 0.07);
  text-align: left;
  transform: rotate(1.2deg);
  transform-origin: top right;
  animation: qsy-card-in 720ms 360ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.qsy-corner-card:hover {
  box-shadow:
    0 29px 64px rgba(31, 52, 42, 0.18),
    0 4px 10px rgba(31, 52, 42, 0.08);
  transform: rotate(0deg) translateY(-3px);
}

.qsy-corner-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  background: linear-gradient(225deg, #e3a62b 0 49%, transparent 50%);
  content: "";
}

.qsy-corner-card::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: #2d7654;
  content: "";
}

.qsy-corner-label,
.qsy-corner-role,
.qsy-corner-sign {
  display: block;
}

.qsy-corner-label {
  color: #2d7654;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.qsy-corner-name {
  display: block;
  margin-top: 5px;
  color: #17231d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.045em;
}

.qsy-corner-name small {
  margin-left: 5px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.qsy-corner-role {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(45, 118, 84, 0.16);
  color: #647068;
  font-family: "Songti SC", "STSong", serif;
  font-size: 9.5px;
  line-height: 1.55;
}

.qsy-corner-card p {
  margin: 7px 0 0;
  color: #4f5d55;
  font-family: "Songti SC", "STSong", serif;
  font-size: 10px;
  line-height: 1.7;
}

.qsy-corner-sign {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  color: #7d887f;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.qsy-corner-sign span {
  width: 17px;
  height: 1px;
  background: #d6a33d;
}

.home-main {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 96px 24px 86px;
}

.hero {
  width: min(100%, 880px);
  text-align: center;
}

.eyebrow {
  color: #78818b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
}

.wordmark {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(9px, 1.2vw, 15px);
  margin: 10px 0 0;
  line-height: 0.95;
  letter-spacing: -0.075em;
}

.wordmark-number {
  position: relative;
  color: var(--blue);
  font-size: clamp(68px, 10vw, 108px);
  font-weight: 800;
}

.wordmark-number::after {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--amber);
  content: "";
}

.wordmark-name {
  font-size: clamp(58px, 8.8vw, 94px);
  font-weight: 500;
}

.principles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px 0 39px;
  color: #414751;
  font-family: var(--font-body);
  font-size: clamp(15px, 2vw, 18px);
  letter-spacing: 0.34em;
}

.principles i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--amber);
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  width: min(100%, 710px);
  min-height: 66px;
  margin: 0 auto;
  padding: 7px 7px 7px 23px;
  border: 1px solid rgba(21, 25, 31, 0.1);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.search-form:focus-within {
  border-color: rgba(39, 101, 215, 0.48);
  box-shadow: 0 22px 72px rgba(39, 101, 215, 0.13), 0 0 0 4px rgba(39, 101, 215, 0.07);
  transform: translateY(-2px);
}

.search-icon {
  flex: 0 0 auto;
  opacity: 0.64;
}

.search-form input {
  min-width: 0;
  flex: 1;
  height: 48px;
  padding: 0 17px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.search-form input::placeholder {
  color: #959ba3;
}

.search-form input::-webkit-search-cancel-button {
  appearance: none;
}

.search-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 19px;
  border: 0;
  border-radius: 17px;
  color: white;
  background: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: background 180ms ease, transform 180ms ease;
}

.search-form button:hover {
  background: var(--blue);
  transform: translateX(2px);
}

.search-form button:focus-visible,
.portal:focus-visible,
.mini-brand:focus-visible {
  outline: 3px solid rgba(39, 101, 215, 0.32);
  outline-offset: 4px;
}

.search-form button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.search-form.is-empty {
  animation: nudge 360ms ease;
}

.search-hint {
  margin: 14px 0 29px;
  color: #8a9097;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.portals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: min(100%, 710px);
  margin: 0 auto;
}

.portal {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.56);
  text-align: left;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1), background 180ms ease, box-shadow 220ms ease;
}

.portal::before {
  position: absolute;
  top: 0;
  right: 20px;
  left: 20px;
  height: 2px;
  border-radius: 0 0 6px 6px;
  background: var(--portal-color);
  content: "";
  opacity: 0;
  transform: scaleX(0.3);
  transition: opacity 180ms ease, transform 220ms ease;
}

.portal:hover {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(31, 43, 59, 0.08);
  transform: translateY(-5px);
}

.portal:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.portal-database { --portal-color: var(--blue); }
.portal-library { --portal-color: var(--amber); }
.portal-forum { --portal-color: var(--green); }

.portal-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--portal-color) 11%, white);
}

.portal-copy {
  min-width: 0;
  margin-left: 12px;
}

.portal-copy strong,
.portal-copy small {
  display: block;
}

.portal-copy strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.portal-copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-arrow {
  margin-left: auto;
  color: #9ba0a6;
  font-size: 15px;
  transition: color 180ms ease, transform 180ms ease;
}

.portal:hover .portal-arrow {
  color: var(--portal-color);
  transform: translate(2px, -2px);
}

.home-footer {
  position: fixed;
  right: 0;
  bottom: 24px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 0 24px;
  color: #91969b;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.footer-line {
  width: 32px;
  height: 1px;
  background: #c9ccc9;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.65;
  pointer-events: none;
}

.ambient-one {
  top: 17%;
  left: -150px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(39, 101, 215, 0.08), transparent 67%);
}

.ambient-two {
  right: -120px;
  bottom: 8%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(227, 166, 43, 0.09), transparent 68%);
}

.reveal {
  opacity: 0;
  animation: reveal-up 620ms cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
}

.reveal-1 { animation-delay: 40ms; }
.reveal-2 { animation-delay: 100ms; }
.reveal-3 { animation-delay: 170ms; }
.reveal-4 { animation-delay: 250ms; }
.reveal-5 { animation-delay: 340ms; }

.noscript {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  text-align: center;
  font-size: 12px;
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-5px); }
  70% { transform: translateX(5px); }
}

@keyframes qsy-card-in {
  from { opacity: 0; transform: translate(16px, -10px) rotate(4deg); }
  to { opacity: 1; transform: translate(0, 0) rotate(1.2deg); }
}

@media (max-width: 1120px) {
  .qsy-corner-card {
    top: 88px;
    right: 22px;
    width: 205px;
    padding: 14px 15px 13px;
  }

  .qsy-corner-name {
    font-size: 26px;
  }

  .qsy-corner-role,
  .qsy-corner-card p {
    font-size: 9px;
  }
}

@media (max-width: 720px) {
  body {
    background-size: 36px 36px;
  }

  .topbar {
    height: 64px;
    padding: 0 19px;
  }

  .mini-brand span {
    display: none;
  }

  .home-main {
    align-items: start;
    padding: 248px 18px 92px;
  }

  .qsy-corner-card {
    top: 76px;
    right: 20px;
    width: 198px;
    padding: 13px 15px 12px;
    border-radius: 4px 4px 16px 4px;
    transform: rotate(1deg);
  }

  .qsy-corner-card::before {
    width: 38px;
    height: 38px;
  }

  .qsy-corner-name {
    font-size: 24px;
  }

  .qsy-corner-role {
    margin-top: 6px;
    padding-top: 6px;
  }

  .qsy-corner-card p {
    margin-top: 5px;
    line-height: 1.58;
  }

  .qsy-corner-sign {
    margin-top: 6px;
  }

  .eyebrow {
    font-size: 9px;
  }

  .wordmark {
    margin-top: 13px;
  }

  .wordmark-number::after {
    width: 10px;
    height: 10px;
    border-width: 3px;
  }

  .principles {
    margin: 20px 0 34px;
  }

  .search-form {
    min-height: 60px;
    padding: 5px 5px 5px 18px;
    border-radius: 20px;
  }

  .search-form input {
    height: 48px;
    padding: 0 13px;
    font-size: 14px;
  }

  .search-form button {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 16px;
  }

  .search-form button span {
    display: none;
  }

  .search-hint {
    margin: 13px 0 25px;
    font-size: 10px;
  }

  .portals {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .portal {
    padding: 12px 14px;
    border-radius: 17px;
  }

  .portal-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 14px;
  }

  .home-footer {
    bottom: 18px;
  }
}

@media (max-width: 410px) {
  .home-page .eyebrow {
    font-size: 8px;
    letter-spacing: 0.2em;
  }
}

@media (max-height: 760px) and (min-width: 721px) {
  .home-main {
    padding-top: 86px;
    padding-bottom: 68px;
  }

  .wordmark-number { font-size: 75px; }
  .wordmark-name { font-size: 66px; }
  .principles { margin: 17px 0 27px; }
  .search-hint { margin-bottom: 20px; }
}

@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;
  }

  .qsy-corner-card {
    animation: none;
  }
}
