:root {
  --bg: #fbf0f3;
  --bg-deep: #f6e2e8;
  --panel: #fffafb;
  --panel-2: #fffdfd;
  --ink: #4a3d4e;
  --ink-soft: #a08aa0;
  --rose: #d96a88;
  --rose-deep: #c9537a;
  --sidebar-w: 250px;
  --content-w: 760px;
  --footer-h: 78px;

  --link: #4a5c86;
  --link-visited: #7a5a9c;
  --link-hover: #c9537a;

  --font: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  --font-round: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 30% 22%, rgba(232, 139, 162, 0.24), transparent 52%),
    radial-gradient(circle at 86% 16%, rgba(127, 179, 168, 0.28), transparent 50%),
    radial-gradient(circle at 80% 82%, rgba(217, 106, 136, 0.20), transparent 54%),
    radial-gradient(circle at 36% 78%, rgba(74, 92, 134, 0.22), transparent 56%),
    radial-gradient(circle at 50% 50%, rgba(251, 240, 243, 0.68), transparent 64%),
    linear-gradient(165deg, #fbf0f3 0%, #f6e2e8 40%, #f3ecf0 100%);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  padding: clamp(1.1rem, 2.4vw, 2rem) clamp(1.25rem, 3vw, 2.5rem);
  min-height: calc(100vh - var(--footer-h));
  box-sizing: border-box;
}

.sidebar {
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #fbf0f3 0%, #f9e5ec 100%);
  border: 2px solid rgba(200, 120, 150, 0.45);
  box-shadow: 2px 2px 0 rgba(181, 98, 106, 0.15);
  padding: clamp(1.5rem, 3vw, 2.2rem) 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 2px;
  overflow: hidden;
  border: 2px solid rgba(181, 98, 106, 0.5);
  outline: 1px solid rgba(181, 98, 106, 0.25);
  outline-offset: 2px;
  background: #fdeef2;
  flex-shrink: 0;
}
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

.name {
  margin: 0;
  line-height: 1.2;
  width: 100%;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid rgba(181, 98, 106, 0.35);
}
.name-zh {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.name-en {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-round);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.6;
}
.pronouns {
  display: inline-block;
  margin-top: 0.55rem;
  padding: 0.2rem 0.7rem;
  font-family: var(--font-round);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rose-deep);
  background: rgba(217, 106, 136, 0.08);
  border: 1px solid rgba(217, 106, 136, 0.3);
  border-radius: 999px;
  line-height: 1.4;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  flex: 1 0 auto;
}
.intro p {
  margin: 0;
  font-family: var(--font-round);
  font-size: 0.8rem;
  line-height: 1.65;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-align: justify;
}
.intro p:first-child {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--rose-deep);
  font-weight: 700;
  text-align: left;
}
.intro p + p::before {
  content: "";
  display: block;
  width: 2rem;
  height: 2px;
  margin: 0 0 0.5rem;
  background: rgba(181, 98, 106, 0.3);
}

.social {
  width: 100%;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.social-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0;
  color: var(--link);
  text-decoration: none;
  font-family: var(--font-round);
  font-size: 0.82rem;
  border: 1px solid rgba(120, 100, 120, 0.28);
  background: linear-gradient(180deg, #fffdfd, #f7eef2);
  box-shadow: 1px 1px 0 rgba(181, 98, 106, 0.2), inset 0 1px 0 #fff;
  transition: none;
}
.social-link svg { flex-shrink: 0; color: var(--link); }
.social-link:visited { color: var(--link); }
.social-link:hover {
  color: var(--link-hover);
  background: linear-gradient(180deg, #f8e8ef, #f2dbe6);
  box-shadow: inset 0 1px 2px rgba(181, 98, 106, 0.15);
}
.social-link:hover svg { color: var(--link-hover); }

.social-link--featured {
  color: #fff;
  background: linear-gradient(180deg, var(--rose), var(--rose-deep));
  border-color: rgba(201, 83, 122, 0.6);
  box-shadow: 1px 1px 0 rgba(181, 98, 106, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-weight: 500;
}
.social-link--featured svg { color: #fff; }
.social-link--featured:visited { color: #fff; }
.social-link--featured:hover {
  color: #fff;
  background: linear-gradient(180deg, #e4829d, var(--rose-deep));
  box-shadow: inset 0 1px 2px rgba(120, 40, 60, 0.35);
}
.social-link--featured:hover svg { color: #fff; }

.content {
  flex: 0 1 var(--content-w);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(1.6rem, 4vw, 2.2rem);
}

.content > .panel:first-child {
  flex: 1 0 auto;
}

.panel {
  background: var(--panel-2);
  border: 2px solid rgba(200, 120, 150, 0.4);
  box-shadow: 2px 2px 0 rgba(181, 98, 106, 0.15);
  border-radius: 0;
  padding: 0;
  overflow: hidden;
}

.panel-title {
  margin: 0;
  padding: 0.55rem 1.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  background: linear-gradient(180deg, var(--rose) 0%, var(--rose-deep) 100%);
  border-bottom: 2px solid rgba(200, 120, 150, 0.4);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.08);
}
.panel-title .label {
  font-family: var(--font-round);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.body-text {
  margin: 0;
  padding: 1.1rem 1.2rem 1.4rem;
  color: var(--ink);
  font-size: 1rem;
  text-align: justify;
}
.body-text::first-letter {
  color: var(--rose-deep);
  font-weight: 700;
}

.footer {
  width: 100%;
  text-align: center;
  color: var(--ink-soft);
  font-family: var(--font-round);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  border-top: 2px solid rgba(200, 120, 150, 0.35);
  padding: 0.9rem 1rem;
  background: var(--panel);
  min-height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

@media (max-width: 820px) {
  .frame {
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
    min-height: auto;
  }
  .sidebar {
    width: 100%;
    max-width: 480px;
    background: var(--bg-deep);
  }
  .content {
    flex: 0 0 auto;
    width: 100%;
    max-width: 480px;
  }
  .social {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .social-link { padding: 0.45rem 0.7rem; }
}

.game-embed {
  width: 100%;
  box-shadow: 2px 2px 0 rgba(181, 98, 106, 0.2);
  background: #fffdfd;
}
.game-frame {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  background: #b8b8b8;
}


:root[data-theme="dark"] {
  --bg: #1d1620;
  --bg-deep: #261a24;
  --panel: #2a2026;
  --panel-2: #2e232a;
  --ink: #efe3ea;
  --ink-soft: #b59aa8;
  --rose: #ba7d90;
  --rose-deep: #a86178;

  --link: #93a8c9;
  --link-visited: #ae93c6;
  --link-hover: #c98ba0;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 30% 22%, rgba(186, 125, 144, 0.14), transparent 52%),
    radial-gradient(circle at 86% 16%, rgba(111, 156, 146, 0.14), transparent 50%),
    radial-gradient(circle at 80% 82%, rgba(168, 97, 120, 0.16), transparent 54%),
    radial-gradient(circle at 36% 78%, rgba(123, 141, 177, 0.18), transparent 56%),
    linear-gradient(165deg, #1d1620 0%, #261a24 40%, #2a1c26 100%);
  color: var(--ink);
}
:root[data-theme="dark"] body::before {
  mix-blend-mode: screen;
  opacity: 0.35;
}

:root[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #2a2026 0%, #31202b 100%);
  border-color: rgba(186, 125, 144, 0.45);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}
:root[data-theme="dark"] .name {
  border-bottom-color: rgba(186, 125, 144, 0.4);
}
:root[data-theme="dark"] .pronouns {
  color: var(--rose-deep);
  background: rgba(186, 125, 144, 0.14);
  border-color: rgba(186, 125, 144, 0.4);
}
:root[data-theme="dark"] .intro p + p::before {
  background: rgba(186, 125, 144, 0.4);
}

:root[data-theme="dark"] .social-link {
  background: linear-gradient(180deg, #352a33, #2a2026);
  border-color: rgba(186, 125, 144, 0.28);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] .social-link:hover {
  background: linear-gradient(180deg, #40303a, #372830);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
:root[data-theme="dark"] .social-link--featured {
  color: #f3e4ea;
  background: linear-gradient(180deg, #ba7d90, #a86178);
  border-color: rgba(186, 125, 144, 0.6);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
:root[data-theme="dark"] .social-link--featured svg { color: #f3e4ea; }
:root[data-theme="dark"] .social-link--featured:visited { color: #f3e4ea; }
:root[data-theme="dark"] .social-link--featured:hover {
  background: linear-gradient(180deg, #c98ba0, #a86178);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .panel {
  background: var(--panel-2);
  border-color: rgba(186, 125, 144, 0.4);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}
:root[data-theme="dark"] .panel-title {
  background: linear-gradient(180deg, var(--rose) 0%, var(--rose-deep) 100%);
  border-bottom-color: rgba(186, 125, 144, 0.4);
  color: #f3e4ea;
}
:root[data-theme="dark"] .panel-title .label {
  color: rgba(243, 228, 234, 0.85);
}
:root[data-theme="dark"] .body-text {
  color: var(--ink);
}
:root[data-theme="dark"] .body-text::first-letter {
  color: var(--rose-deep);
}

:root[data-theme="dark"] .game-embed {
  background: #2e232a;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .footer {
  border-top-color: rgba(186, 125, 144, 0.4);
  background: var(--panel);
  color: var(--ink-soft);
}

body, .sidebar, .panel, .social-link, .footer, .game-embed {
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
