/*
Theme Name: Wenyou Portal
Theme URI: https://example.com/wenyou-portal
Author: Codex
Description: A lightweight dark portal theme for interactive-fiction creators and communities.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: wenyou-portal
*/

:root {
  --bg: #08090c;
  --surface: rgba(20, 21, 27, 0.88);
  --surface-strong: #17181e;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f7f6fa;
  --muted: #aaa8b3;
  --pink: #ff6f9d;
  --pink-strong: #ff3f7d;
  --cyan: #6fe7dc;
  --yellow: #ffd982;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 24px;
  --content: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 63, 125, 0.10), transparent 25rem),
    radial-gradient(circle at 85% 32%, rgba(111, 231, 220, 0.07), transparent 26rem),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 26px 26px, 26px 26px, auto;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.65;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image: radial-gradient(circle, rgba(255,255,255,.15) 1px, transparent 1px);
  background-size: 8px 8px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
  z-index: -1;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }

.container { width: min(calc(100% - 32px), var(--content)); margin-inline: auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: rgba(8, 9, 12, 0.72);
  border-bottom: 1px solid var(--line);
}
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .04em; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px;
  color: #16151a; background: linear-gradient(135deg, var(--pink), #ffc1d4);
  box-shadow: 0 0 24px rgba(255, 111, 157, .32);
}
.menu-toggle { display: none; border: 1px solid var(--line); color: var(--text); background: var(--surface); border-radius: 12px; padding: 8px 12px; }
.site-nav ul { display: flex; align-items: center; gap: 24px; margin: 0; padding: 0; list-style: none; }
.site-nav a { color: var(--muted); font-size: 14px; }
.site-nav a:hover, .site-nav a:focus { color: var(--text); }

.hero { min-height: 650px; display: grid; place-items: center; padding: 90px 0 58px; text-align: center; }
.hero-inner { max-width: 820px; }
.avatar-shell { position: relative; width: 176px; height: 176px; margin: 0 auto 28px; display: grid; place-items: center; }
.avatar-shell::before, .avatar-shell::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,111,157,.42); }
.avatar-shell::before { inset: -12px; box-shadow: 0 0 42px rgba(255, 63, 125, .23), inset 0 0 24px rgba(255, 63, 125, .12); }
.avatar-shell::after { inset: -24px; border-style: dashed; opacity: .45; animation: spin 28s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-avatar { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 5px solid #181820; background: linear-gradient(135deg, #252631, #121217); }
.avatar-fallback { display: grid; place-items: center; font-weight: 900; font-size: 54px; color: var(--pink); }
.status-pill { position: absolute; right: -8px; bottom: 10px; padding: 8px 14px; border: 4px solid var(--bg); border-radius: 999px; background: var(--pink-strong); font-size: 12px; font-weight: 800; }
.eyebrow { color: var(--pink); font-weight: 800; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { margin: 10px 0 8px; font-size: clamp(42px, 8vw, 76px); line-height: 1.08; letter-spacing: -.04em; }
.hero-subtitle { margin: 0 auto; max-width: 680px; color: var(--muted); font-size: clamp(17px, 2.5vw, 22px); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 0 18px; border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); background: rgba(255,255,255,.045); cursor: pointer; transition: .22s ease;
}
.button:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.075); }
.button-primary { color: #17151a; font-weight: 800; border-color: transparent; background: linear-gradient(135deg, var(--pink), #ffc1d4); box-shadow: 0 10px 28px rgba(255, 63, 125, .22); }
.button-small { min-height: 38px; padding: 0 14px; font-size: 13px; }

.feature-dock { position: relative; z-index: 5; margin-top: -72px; padding-bottom: 44px; }
.dock-panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17,18,23,.84); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.dock-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.dock-item { min-height: 82px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 16px; color: var(--muted); background: rgba(255,255,255,.028); transition: .22s ease; }
.dock-item:hover { color: var(--text); transform: translateY(-3px); border-color: rgba(255,111,157,.4); background: rgba(255,111,157,.08); }
.dock-icon { font-size: 22px; }
.dock-label { font-size: 13px; font-weight: 700; }

.section { padding: 82px 0; }
.section + .section { border-top: 1px solid rgba(255,255,255,.05); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-kicker { color: var(--pink); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.section-title { margin: 6px 0 0; font-size: clamp(28px, 4vw, 44px); line-height: 1.15; }
.section-description { max-width: 560px; margin: 8px 0 0; color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.intro-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 20px; }
.intro-copy { padding: clamp(24px, 5vw, 48px); }
.intro-copy p { color: #d5d3db; font-size: 17px; }
.stat-stack { display: grid; gap: 14px; }
.stat-card { padding: 24px; }
.stat-value { display: block; color: var(--pink); font-size: 30px; font-weight: 900; }
.stat-label { color: var(--muted); font-size: 13px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.content-card { position: relative; overflow: hidden; min-height: 230px; padding: 24px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(29,30,38,.94), rgba(15,16,20,.94)); transition: .22s ease; }
.content-card::after { content: ""; position: absolute; inset: auto -30% -50% 30%; height: 140px; background: radial-gradient(circle, rgba(255,111,157,.13), transparent 65%); }
.content-card:hover { transform: translateY(-4px); border-color: rgba(255,111,157,.35); }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.tag { padding: 4px 9px; border-radius: 999px; color: var(--pink); background: rgba(255,111,157,.10); }
.content-card h3 { margin: 18px 0 8px; font-size: 21px; }
.content-card p { margin: 0 0 22px; color: var(--muted); }
.card-footer { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.download-arrow { color: var(--pink); font-size: 20px; }
.empty-state { padding: 34px; color: var(--muted); text-align: center; }

.timeline { position: relative; padding: 12px 0 12px 30px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(var(--pink), rgba(255,255,255,.06)); }
.timeline-item { position: relative; padding: 0 0 30px 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -27px; top: 7px; width: 10px; height: 10px; border: 3px solid var(--bg); border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 3px rgba(255,111,157,.18); }
.timeline-version { color: var(--pink); font-size: 13px; font-weight: 800; }
.timeline h3 { margin: 4px 0; }
.timeline time, .timeline p { color: var(--muted); }

.faq-list { display: grid; gap: 12px; }
.faq-item { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.faq-item summary { padding: 18px 20px; cursor: pointer; font-weight: 750; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--pink); font-size: 20px; }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 20px 20px; color: var(--muted); }

.community-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.community-card { min-height: 160px; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.028); }
.community-card strong { display: block; margin: 14px 0 6px; font-size: 20px; }
.community-card p { color: var(--muted); margin: 0; }
.community-symbol { font-size: 28px; }

.wish-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 22px; }
.wish-form { padding: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; color: #d8d6de; font-size: 13px; font-weight: 700; }
.field input, .field textarea { width: 100%; color: var(--text); border: 1px solid var(--line); border-radius: 13px; outline: none; background: rgba(0,0,0,.25); }
.field input { height: 46px; padding: 0 14px; }
.field textarea { min-height: 138px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255,111,157,.10); }
.wish-list { display: grid; gap: 12px; }
.wish-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.027); }
.wish-card h3 { margin: 0 0 6px; font-size: 17px; }
.wish-card p { margin: 0; color: var(--muted); }
.wish-author { display: block; margin-top: 12px; color: var(--pink); font-size: 12px; }
.notice { margin-bottom: 18px; padding: 12px 14px; border: 1px solid rgba(111,231,220,.24); border-radius: 12px; color: var(--cyan); background: rgba(111,231,220,.06); }
.honeypot { position: absolute !important; left: -9999px !important; }

.site-footer { padding: 38px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.prose { padding: clamp(24px, 5vw, 48px); }
.prose h1 { font-size: clamp(32px, 5vw, 56px); }
.prose a { color: var(--pink); text-decoration: underline; }
.archive-header { padding: 100px 0 42px; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Single-screen portal homepage */
.portal-shell {
  width: min(calc(100% - 48px), 1360px);
  min-height: calc(100svh - 158px);
  margin-inline: auto;
  padding: 18px 0 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.portal-hero { text-align: center; }
.portal-avatar-shell { position: relative; width: 136px; height: 136px; margin: 0 auto 13px; display: grid; place-items: center; }
.portal-avatar-shell::before,
.portal-avatar-shell::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.portal-avatar-shell::before { inset: -7px; border: 2px solid rgba(255,111,157,.72); box-shadow: 0 0 34px rgba(255,63,125,.24), inset 0 0 18px rgba(255,63,125,.10); }
.portal-avatar-shell::after { inset: -16px; border: 1px solid rgba(255,111,157,.3); border-left-color: transparent; transform: rotate(22deg); }
.portal-avatar { width: 122px; height: 122px; border-radius: 50%; object-fit: cover; border: 4px solid #1b1b24; background: radial-gradient(circle at 52% 30%, #343848, #111219 67%); }
.portal-avatar-fallback { display: grid; place-items: center; overflow: hidden; }
.portal-avatar-fallback::before { content: ""; position: absolute; width: 56px; height: 56px; top: 34px; border-radius: 50% 50% 44% 42%; background: linear-gradient(145deg, #141620, #08090d); box-shadow: -20px 34px 0 14px #0b0c12, 20px 34px 0 14px #0b0c12; transform: rotate(-8deg); }
.portal-avatar-fallback span { position: relative; z-index: 1; margin-top: 72px; color: rgba(255,111,157,.8); font-size: 13px; font-weight: 900; letter-spacing: .12em; }
.portal-status { position: absolute; z-index: 2; right: -12px; bottom: 7px; padding: 7px 14px; border: 4px solid var(--bg); border-radius: 999px; background: linear-gradient(135deg, var(--pink), var(--pink-strong)); color: #fff; font-size: 12px; font-weight: 900; }
.portal-eyebrow { color: var(--pink); font-size: 11px; font-weight: 900; letter-spacing: .18em; }
.portal-hero h1 { margin: 2px 0 0; font-size: clamp(38px, 4vw, 58px); line-height: 1.05; letter-spacing: -.05em; text-shadow: 0 0 26px rgba(255,111,157,.12); }
.portal-hero p { margin: 6px auto 0; color: #c2c0ca; font-size: clamp(14px, 1.5vw, 18px); }
.portal-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(138px, 1fr); gap: 14px; }
.portal-card { grid-column: span 3; position: relative; isolation: isolate; overflow: hidden; min-height: 138px; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid rgba(255,255,255,.17); border-radius: 18px; background: linear-gradient(135deg, rgba(34,34,44,.94), rgba(13,14,19,.98)); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 14px 38px rgba(0,0,0,.23); transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.portal-card:nth-child(n+5) { grid-column: span 4; }
.portal-card:hover,
.portal-card:focus-visible { transform: translateY(-4px); border-color: rgba(255,111,157,.66); box-shadow: 0 18px 50px rgba(0,0,0,.38), 0 0 28px rgba(255,63,125,.10); outline: none; }
.portal-card::before { content: ""; position: absolute; z-index: -2; inset: 0; opacity: .68; background: radial-gradient(circle at 82% 34%, rgba(255,63,125,.16), transparent 34%), linear-gradient(120deg, transparent 42%, rgba(255,255,255,.025)); }
.portal-card::after { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .28; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(90deg, transparent, #000); }
.portal-card-art { position: absolute; z-index: -1; inset: 0; opacity: .58; }
.portal-card-art i { position: absolute; display: block; border: 1px solid rgba(255,111,157,.2); background: rgba(255,111,157,.05); transform: rotate(-7deg); }
.portal-card-art i:nth-child(1) { width: 44%; height: 74%; right: -7%; top: 3%; }
.portal-card-art i:nth-child(2) { width: 28%; height: 56%; right: 18%; top: 24%; }
.portal-card-art i:nth-child(3) { width: 24%; height: 42%; right: 43%; top: 45%; }
.portal-card-icon { position: absolute; top: 20px; left: 23px; color: #ff9cba; font-size: 36px; line-height: 1; font-weight: 500; filter: drop-shadow(0 0 12px rgba(255,63,125,.52)); }
.portal-card-copy { position: relative; z-index: 2; display: block; max-width: calc(100% - 48px); }
.portal-card-copy strong { display: block; margin-bottom: 2px; font-size: clamp(19px, 1.7vw, 26px); line-height: 1.2; }
.portal-card-copy small { color: #b8b6c0; font-size: 14px; }
.portal-card-arrow { position: absolute; z-index: 2; right: 20px; bottom: 20px; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,111,157,.55); border-radius: 50%; font-size: 22px; transition: .22s ease; }
.portal-card:hover .portal-card-arrow { color: #111217; background: var(--pink); transform: translateX(3px); }
.portal-card-folder::before { background: radial-gradient(circle at 76% 18%, rgba(255,111,157,.25), transparent 34%), linear-gradient(135deg, rgba(111,231,220,.035), transparent 55%); }
.portal-card-log::before { background: radial-gradient(circle at 75% 20%, rgba(111,231,220,.13), transparent 38%), linear-gradient(135deg, rgba(255,63,125,.08), transparent 52%); }
.portal-card-faq::before { background: radial-gradient(circle at 80% 18%, rgba(123,121,255,.14), transparent 36%), linear-gradient(135deg, rgba(255,63,125,.08), transparent 58%); }
.portal-card-community::before { background: radial-gradient(circle at 75% 28%, rgba(255,111,157,.18), transparent 42%), linear-gradient(135deg, rgba(255,255,255,.025), transparent); }
.portal-card-guides::before { background: radial-gradient(circle at 76% 24%, rgba(111,231,220,.15), transparent 38%), linear-gradient(135deg, rgba(255,63,125,.07), transparent); }
.portal-card-wishes::before { background: radial-gradient(circle at 76% 20%, rgba(123,121,255,.20), transparent 35%), linear-gradient(135deg, rgba(255,63,125,.10), transparent); }
.portal-motto { display: flex; align-items: center; justify-content: center; gap: 18px; color: #8f8d98; font-size: 12px; letter-spacing: .12em; }
.portal-motto span { width: 70px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.22)); }
.portal-motto span:last-child { transform: rotate(180deg); }
body.home .site-footer { padding: 16px 0; font-size: 11px; }
body.home .footer-links { display: none; }
.portal-section-header { padding-bottom: 32px; }
.portal-section-header .back-link { display: inline-flex; margin-bottom: 26px; color: var(--muted); font-size: 14px; }
.portal-section-header .back-link:hover { color: var(--pink); }
.portal-section-content { padding-top: 32px; min-height: 46vh; }

@media (max-width: 920px) {
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 142px; }
  .portal-card, .portal-card:nth-child(n+5) { grid-column: span 1; }
  .portal-card:last-child { grid-column: span 2; }
  .dock-grid { grid-template-columns: repeat(4, 1fr); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-grid, .wish-layout { grid-template-columns: 1fr; }
  .community-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .menu-toggle { display: inline-flex; }
  .site-nav { position: absolute; left: 16px; right: 16px; top: 60px; display: none; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #13141a; box-shadow: var(--shadow); }
  .site-nav.is-open { display: block; }
  .site-nav ul { align-items: stretch; flex-direction: column; gap: 6px; }
  .site-nav a { display: block; padding: 10px; }
  .hero { min-height: 610px; padding-top: 70px; }
  .avatar-shell { width: 146px; height: 146px; }
  .hero-avatar { width: 132px; height: 132px; }
  .dock-grid { grid-template-columns: repeat(2, 1fr); }
  .dock-item:last-child { grid-column: span 2; }
  .section { padding: 64px 0; }
  .section-heading { display: block; }
  .card-grid { grid-template-columns: 1fr; }
  .portal-shell { width: min(calc(100% - 24px), 560px); min-height: auto; padding: 24px 0 28px; gap: 20px; }
  .portal-avatar-shell { width: 112px; height: 112px; }
  .portal-avatar { width: 100px; height: 100px; }
  .portal-avatar-fallback::before { top: 28px; transform: scale(.82) rotate(-8deg); }
  .portal-avatar-fallback span { margin-top: 58px; }
  .portal-hero h1 { font-size: 38px; }
  .portal-grid { gap: 10px; grid-auto-rows: 132px; }
  .portal-card { min-height: 132px; padding: 16px; border-radius: 16px; }
  .portal-card-icon { top: 15px; left: 16px; font-size: 29px; }
  .portal-card-copy { max-width: calc(100% - 30px); }
  .portal-card-copy strong { font-size: 17px; }
  .portal-card-copy small { font-size: 11px; }
  .portal-card-arrow { right: 13px; bottom: 13px; width: 32px; height: 32px; font-size: 17px; }
}
@media (min-width: 921px) and (max-height: 860px) {
  .portal-shell { gap: 10px; padding-block: 10px; }
  .portal-avatar-shell { width: 96px; height: 96px; margin-bottom: 7px; }
  .portal-avatar { width: 86px; height: 86px; }
  .portal-avatar-fallback::before { top: 21px; transform: scale(.68) rotate(-8deg); }
  .portal-avatar-fallback span { margin-top: 50px; }
  .portal-status { right: -18px; padding: 5px 10px; font-size: 10px; }
  .portal-hero h1 { font-size: 38px; }
  .portal-hero p { margin-top: 2px; font-size: 14px; }
  .portal-grid { grid-auto-rows: 116px; gap: 10px; }
  .portal-card { min-height: 116px; padding: 18px; }
  .portal-card-icon { top: 15px; left: 18px; font-size: 28px; }
  .portal-card-copy strong { font-size: 20px; }
  .portal-card-copy small { font-size: 12px; }
  .portal-card-arrow { width: 34px; height: 34px; right: 15px; bottom: 15px; }
  .portal-motto { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
