:root {
  color-scheme: light;
  --ink: #33465e;
  --muted: #718097;
  --pink: #bd4f82;
  --pink-dark: #a63f70;
  --pink-soft: #f9dfeb;
  --blue: #7799c8;
  --blue-soft: #e9f2fb;
  --line: rgba(119, 143, 173, .22);
  --glass: rgba(255, 255, 255, .78);
  --shadow: 0 22px 55px rgba(69, 90, 123, .14);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: #eaf1f8; }
body { margin: 0; min-height: 100vh; color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(190, 79, 130, .24); outline-offset: 2px; }

.sky-backdrop {
  position: fixed; inset: 0; z-index: -2;
  background:
    linear-gradient(90deg, rgba(236, 244, 251, .82), rgba(255, 244, 248, .64)),
    url("/assets/dream-island-daylight.jpg") center / cover no-repeat;
}
.sky-backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(237, 244, 251, .15), rgba(233, 240, 247, .78));
  backdrop-filter: blur(2px) saturate(.94);
}

.page-shell { width: min(1480px, calc(100% - 40px)); margin: 18px auto 0; }
.glass-card { border: 1px solid rgba(255,255,255,.84); background: var(--glass); box-shadow: var(--shadow); backdrop-filter: blur(24px) saturate(1.08); }

.topbar {
  height: 72px; display: flex; align-items: center; gap: 38px; padding: 0 24px;
  border: 1px solid rgba(255,255,255,.88); border-radius: 25px; background: rgba(255,255,255,.77);
  box-shadow: 0 14px 36px rgba(69, 90, 123, .12); backdrop-filter: blur(22px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 180px; color: inherit; text-decoration: none; }
.brand img { width: 41px; height: 41px; filter: drop-shadow(0 5px 10px rgba(185,79,130,.22)); }
.brand span { display: grid; line-height: 1.05; }
.brand strong { font-size: 18px; letter-spacing: .08em; }
.brand small { margin-top: 5px; color: #9b7890; font-size: 8px; letter-spacing: .22em; }
.primary-nav { display: flex; align-self: stretch; gap: 10px; }
.primary-nav a, .primary-nav button {
  position: relative; display: grid; place-items: center; min-width: 92px; padding: 0 14px;
  border: 0; background: none; color: var(--muted); text-decoration: none; cursor: pointer;
}
.primary-nav :is(a, button).is-active { color: var(--pink-dark); font-weight: 700; }
.primary-nav :is(a, button).is-active::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(90deg, #cb5e91, #8da7d2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.service-state { display: inline-flex; align-items: center; gap: 7px; color: #62778c; font-size: 12px; }
.service-state i { width: 8px; height: 8px; border-radius: 50%; background: #5c9975; box-shadow: 0 0 0 5px rgba(92,153,117,.12); }

.soft-button, .primary-button, .text-button, .avatar-button { border: 0; cursor: pointer; }
.soft-button { min-height: 38px; padding: 0 18px; border: 1px solid rgba(191,79,131,.18); border-radius: 14px; color: var(--pink-dark); background: rgba(255,241,247,.82); }
.soft-button:hover { background: #fbe4ef; }
.primary-button { min-height: 43px; padding: 0 20px; border-radius: 15px; color: white; font-weight: 700; background: linear-gradient(105deg, #c54f84, #b86398 58%, #799bc9); box-shadow: 0 10px 24px rgba(181,76,129,.22); }
.primary-button:hover { filter: brightness(1.04); transform: translateY(-1px); }
.primary-button:disabled { cursor: not-allowed; filter: grayscale(.4); opacity: .58; transform: none; }
.text-button { padding: 6px 0; color: var(--pink-dark); background: none; text-align: left; }
.avatar-button { width: 39px; height: 39px; border-radius: 14px; color: white; font-weight: 800; background: linear-gradient(145deg, #d07da4, #799bc9); box-shadow: inset 0 0 0 2px rgba(255,255,255,.66); }

.community-layout { display: grid; grid-template-columns: 216px minmax(520px, 1fr) 260px; gap: 16px; min-height: calc(100vh - 130px); margin-top: 16px; }
.sidebar, .content-panel, .welcome-card, .rail-card { border-radius: 25px; }
.sidebar { min-height: 640px; padding: 28px 16px 20px; }
.sidebar-heading { padding: 0 12px 22px; }
.sidebar-heading small, .welcome-card > small, .modal-frame > small, .section-kicker { color: #b04979; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.sidebar-heading h2 { margin: 7px 0 0; font-size: 21px; }
.side-link { width: 100%; min-height: 48px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 6px; padding: 0 12px; border: 0; border-radius: 15px; color: #607188; background: transparent; text-align: left; cursor: pointer; }
.side-link b { min-width: 25px; padding: 3px 7px; border-radius: 10px; color: #8b7990; background: rgba(255,255,255,.58); font-size: 10px; text-align: center; }
.side-link:hover { background: rgba(242, 234, 245, .66); }
.side-link.is-active { color: #a63f70; font-weight: 700; background: linear-gradient(90deg, rgba(248,220,234,.88), rgba(231,238,249,.58)); }
.side-icon { font-size: 17px; text-align: center; }
.category-list { display: grid; gap: 3px; }
.sidebar-note { margin-top: 28px; padding: 16px 13px; border-top: 1px solid var(--line); display: flex; gap: 9px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.sidebar-note p { margin: 0; }
.sidebar-note strong { color: #6b5770; }

.content-panel { min-height: 640px; padding: 31px 34px; overflow: hidden; }
.content-panel:focus { outline: none; }
.loading-state, .empty-state { min-height: 450px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.spinner { width: 30px; height: 30px; border: 3px solid #efd7e4; border-top-color: #b94e80; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.content-heading { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.content-heading > div:first-child { min-width: 0; }
.content-heading h1 { margin: 6px 0 4px; font-size: clamp(25px, 2vw, 34px); line-height: 1.2; letter-spacing: -.03em; }
.content-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.heading-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.search-field { width: min(250px, 27vw); min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.66); }

.thread-list { display: grid; gap: 10px; }
.thread-card { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; padding: 19px 20px; border: 1px solid rgba(125,145,173,.18); border-radius: 18px; color: inherit; background: rgba(255,255,255,.55); text-decoration: none; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.thread-card:hover { transform: translateY(-2px); border-color: rgba(190,79,130,.25); background: rgba(255,255,255,.84); }
.thread-card h3 { margin: 6px 0 7px; font-size: 16px; }
.thread-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: #8793a4; font-size: 10px; }
.thread-meta .category-pill { padding: 4px 9px; border-radius: 10px; color: #ac4777; background: #f9e6ef; font-weight: 700; }
.thread-stats { min-width: 92px; display: flex; align-items: center; justify-content: flex-end; gap: 13px; color: #8290a3; font-size: 11px; }
.thread-stats span { display: grid; justify-items: center; gap: 4px; }
.thread-stats b { color: #55667d; font-size: 13px; }
.pin-badge { color: #b44a7b; }
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }

.right-rail { display: grid; align-content: start; gap: 14px; }
.welcome-card { position: relative; overflow: hidden; min-height: 265px; padding: 29px 25px; background: linear-gradient(145deg, rgba(255,249,251,.9), rgba(244,232,245,.82) 58%, rgba(228,238,249,.84)); }
.welcome-card::after { content: "◇"; position: absolute; right: -9px; top: 36px; color: rgba(197,79,132,.09); font: 150px/1 serif; transform: rotate(12deg); }
.welcome-card h2 { position: relative; z-index: 1; margin: 8px 0 12px; font-size: 28px; line-height: 1.25; }
.welcome-card p { position: relative; z-index: 1; min-height: 52px; margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.welcome-card .primary-button { position: relative; z-index: 1; width: 100%; }
.rail-card { padding: 20px 21px; }
.rail-card-title { display: flex; justify-content: space-between; font-weight: 700; }
.rail-card-title i { color: #bb4f80; font-style: normal; }
.rail-card ol { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: 11px; line-height: 2; }
.rail-card p { color: var(--muted); font-size: 11px; line-height: 1.7; }

.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.news-card { padding: 20px; border: 1px solid rgba(125,145,173,.18); border-radius: 18px; background: rgba(255,255,255,.6); }
.news-card.is-hero { grid-column: 1 / -1; padding: 25px; background: linear-gradient(120deg, rgba(251,226,238,.8), rgba(232,240,250,.78)); }
.news-card small { color: #b34979; font-weight: 700; }
.news-card h3 { margin: 9px 0; font-size: 18px; }
.news-card.is-hero h3 { font-size: 24px; }
.news-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.news-date { display: block; margin-top: 13px; color: #909aaa !important; font-size: 10px !important; }

.back-link { display: inline-flex; margin-bottom: 22px; border: 0; color: #9f456f; background: none; cursor: pointer; }
.thread-article { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.thread-article h1 { margin: 12px 0 10px; font-size: 28px; line-height: 1.35; }
.author-line { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.mini-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 10px; color: white; background: linear-gradient(145deg, #ce77a0, #7d9dca); font-weight: 700; }
.post-body { margin-top: 24px; color: #43566d; line-height: 1.85; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-actions { display: flex; align-items: center; gap: 10px; margin-top: 23px; }
.like-button.is-liked { border-color: #d486a9; background: #fbe6f0; }
.reply-list { display: grid; gap: 10px; margin-top: 20px; }
.reply-card { padding: 18px 19px; border: 1px solid rgba(125,145,173,.18); border-radius: 17px; background: rgba(255,255,255,.5); }
.reply-card .post-body { margin-top: 12px; }
.reply-form { margin-top: 18px; padding: 18px; border-radius: 18px; background: rgba(239,244,250,.74); }
.reply-form textarea { width: 100%; }

.modal { width: min(460px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 27px; color: var(--ink); background: transparent; box-shadow: 0 30px 90px rgba(43,55,80,.28); }
.modal-wide { width: min(700px, calc(100% - 28px)); }
.modal::backdrop { background: rgba(65,76,98,.28); backdrop-filter: blur(8px); }
.modal-frame { position: relative; display: grid; gap: 15px; padding: 34px; border: 1px solid rgba(255,255,255,.92); border-radius: 27px; background: rgba(255,251,253,.95); }
.modal-frame h2 { margin: -4px 0 0; font-size: 25px; }
.modal-frame > p { margin: -7px 0 4px; color: var(--muted); font-size: 12px; }
.modal-close { position: absolute; right: 16px; top: 15px; width: 34px; height: 34px; border: 0; border-radius: 12px; color: #768398; background: rgba(237,241,247,.78); cursor: pointer; font-size: 22px; }
.modal-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 17px; color: white; background: linear-gradient(145deg, #ce77a0, #7d9dca); font-size: 24px; }
label { display: grid; gap: 7px; color: #627187; font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: rgba(255,255,255,.86); }
input, select { height: 43px; padding: 0 13px; }
textarea { padding: 12px 13px; line-height: 1.65; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-error { min-height: 18px; margin: 0 !important; color: #b43d61 !important; }
.form-hint { margin: -7px 0 0 !important; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-switch { justify-self: center; text-align: center; }
.check-line { display: flex; grid-template-columns: auto 1fr; align-items: center; }
.check-line input { width: 17px; height: 17px; }

.account-popover { position: fixed; z-index: 20; right: max(28px, calc((100vw - 1480px) / 2 + 24px)); top: 82px; width: 210px; display: grid; gap: 7px; padding: 18px; border-radius: 17px; }
.account-popover[hidden] { display: none; }
.account-popover small { color: var(--muted); }
.account-popover button { padding: 10px 0; border: 0; border-top: 1px solid var(--line); color: var(--pink-dark); background: none; text-align: left; cursor: pointer; }
.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 18px; border: 1px solid rgba(255,255,255,.88); border-radius: 15px; color: white; background: rgba(57,72,94,.92); box-shadow: 0 16px 45px rgba(34,48,70,.24); }
.toast[hidden] { display: none; }
footer { display: flex; justify-content: space-between; padding: 16px 8px 22px; color: rgba(63,79,101,.66); font-size: 10px; }

@media (max-width: 1120px) {
  .community-layout { grid-template-columns: 190px minmax(0, 1fr); }
  .right-rail { display: none; }
}
@media (max-width: 760px) {
  .page-shell { width: calc(100% - 18px); margin-top: 9px; }
  .topbar { height: auto; min-height: 65px; padding: 10px 14px; gap: 10px; border-radius: 19px; }
  .brand { min-width: 0; }
  .brand span, .service-state { display: none; }
  .primary-nav { align-self: stretch; }
  .primary-nav a, .primary-nav button { min-width: 66px; padding: 0 8px; font-size: 12px; }
  .soft-button { padding: 0 13px; }
  .community-layout { display: block; min-height: 0; }
  .sidebar { min-height: 0; margin-bottom: 10px; padding: 12px; display: flex; overflow-x: auto; border-radius: 19px; }
  .sidebar-heading, .sidebar-note { display: none; }
  .category-list { display: flex; }
  .side-link { width: auto; min-width: max-content; grid-template-columns: auto 1fr; }
  .side-link b { display: none; }
  .content-panel { min-height: 590px; padding: 22px 16px; border-radius: 19px; }
  .content-heading { align-items: stretch; flex-direction: column; gap: 12px; }
  .heading-actions { width: 100%; margin: 0; }
  .search-field { width: 100%; }
  .thread-card { grid-template-columns: 1fr; }
  .thread-stats { justify-content: flex-start; }
  .news-grid, .form-grid { grid-template-columns: 1fr; }
  .modal-frame { padding: 28px 21px 22px; }
  footer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
