:root {
  color-scheme: dark;
  --bg: #080a0d;
  --panel: #111419;
  --panel-strong: #15191f;
  --line: rgba(255, 255, 255, .1);
  --muted: #9299a4;
  --text: #f4f5f7;
  --accent: #b9a7ff;
  --cyan: #75d5dd;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 2026-08-28 Phase 0: the legacy community route now presents a delivery case library. */

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: radial-gradient(circle at 10% -10%, rgba(111, 94, 209, .15), transparent 25rem), var(--bg); font-size: 14px; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.site-header { position: sticky; z-index: 30; top: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 68px; padding: 0 clamp(18px, 4vw, 64px); border-bottom: 1px solid rgba(255, 255, 255, .08); background: rgba(8, 10, 13, .82); backdrop-filter: blur(22px); }
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; font-weight: 720; letter-spacing: .03em; }
.brand i { width: 18px; height: 18px; border: 2px solid var(--accent); border-radius: 5px; transform: rotate(45deg); box-shadow: 8px -8px 0 -5px var(--cyan); }
.site-header nav { display: flex; gap: 4px; padding: 4px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; background: rgba(255, 255, 255, .025); }
.site-header nav a { padding: 8px 15px; border-radius: 8px; color: #8e949e; font-size: 12px; }
.site-header nav a:hover, .site-header nav a.active { color: #fff; background: rgba(255, 255, 255, .08); }
.header-actions { display: flex; justify-self: end; align-items: center; gap: 8px; }
.manager-button, .create-link { min-height: 38px; padding: 0 13px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 9px; color: #d6dae0; background: transparent; cursor: pointer; font-size: 11px; }
.manager-button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.create-link { display: inline-flex; align-items: center; gap: 7px; color: #17141d; background: #eeeafc; font-weight: 650; }

main { width: min(1500px, 100%); margin: auto; padding: 0 clamp(18px, 4vw, 64px) 100px; }
.community-hero { max-width: 920px; padding: clamp(44px, 5vw, 68px) 0 34px; }
.eyebrow { display: block; margin-bottom: 13px; color: #858d9a; font-size: 9px; letter-spacing: .2em; }
.community-hero h1 { max-width: 760px; margin: 0; font-size: clamp(32px, 3.2vw, 46px); font-weight: 560; line-height: 1.08; letter-spacing: -.045em; }
.community-hero p { margin: 16px 0 0; color: #9ca3ad; font-size: 14px; line-height: 1.65; }

.community-toolbar { position: sticky; z-index: 20; top: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(8, 10, 13, .92); backdrop-filter: blur(18px); }
.filter-list, .sort-list { display: flex; gap: 4px; overflow: auto; scrollbar-width: none; }
.filter-list button, .sort-list button { min-height: 34px; border: 0; border-radius: 8px; padding: 0 12px; color: #858c97; background: transparent; white-space: nowrap; cursor: pointer; font-size: 11px; }
.filter-list button:hover, .filter-list button.active, .sort-list button:hover, .sort-list button.active { color: #fff; background: #1b1f26; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.sort-list { padding-right: 8px; border-right: 1px solid var(--line); }
.search-box { display: flex; align-items: center; gap: 8px; width: min(26vw, 310px); padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: #727985; background: #0d1014; }
.search-box input { width: 100%; height: 36px; border: 0; outline: 0; color: #fff; background: transparent; font-size: 11px; }

.feed-section { padding-top: 34px; }
.feed-heading { display: flex; align-items: center; justify-content: flex-end; min-height: 20px; margin-bottom: 14px; }
.feed-heading > div > span { display: block; margin-bottom: 5px; color: #6f7782; font-size: 8px; letter-spacing: .16em; }
.feed-heading h2 { margin: 0; font-size: 19px; font-weight: 590; }
.feed-heading > span { color: #8b929d; font-size: 12px; }
.community-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.community-card { min-width: 0; border: 0; padding: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.card-visual { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid rgba(255, 255, 255, .08); border-radius: 13px; background: radial-gradient(circle at 35% 35%, hsla(var(--seed), 75%, 68%, .28), transparent 32%), radial-gradient(circle at 70% 60%, hsla(calc(var(--seed) + 95), 70%, 55%, .18), transparent 25%), linear-gradient(140deg, #161a21, #090b0e); }
.card-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.2, .8, .2, 1); }
.community-card:hover img { transform: scale(1.028); }
.card-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, .46)); pointer-events: none; }
.card-category { position: absolute; z-index: 2; top: 10px; left: 10px; padding: 5px 8px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 7px; color: #f1f2f4; background: rgba(6, 8, 11, .58); backdrop-filter: blur(12px); font-size: 11px; }
.card-format { display: none; }
.fallback-orbit { position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1; border: 1px solid hsla(var(--seed), 80%, 80%, .5); border-radius: 50%; transform: translate(-50%, -50%) rotate(-18deg); box-shadow: 0 0 60px hsla(var(--seed), 75%, 55%, .15); }
.fallback-orbit::before, .fallback-orbit::after { content: ""; position: absolute; inset: 18%; border: 1px solid rgba(255, 255, 255, .18); border-radius: 38% 62% 52% 48%; transform: rotate(55deg); }
.fallback-orbit::after { inset: 38%; background: hsla(var(--seed), 75%, 70%, .65); box-shadow: 0 0 30px hsla(var(--seed), 75%, 60%, .45); }
.card-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 2px 18px; }
.card-author { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.card-author > i { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 50%; color: #dcd4ff; background: #171b22; font-size: 10px; font-style: normal; }
.card-copy h3 { overflow: hidden; margin: 0 0 4px; font-size: 14px; font-weight: 590; text-overflow: ellipsis; white-space: nowrap; }
.card-copy p { overflow: hidden; margin: 0; color: #8d95a0; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.card-stats { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: #8d95a0; font-size: 11px; white-space: nowrap; }

.empty-state { padding: 82px 20px; border: 1px dashed rgba(255, 255, 255, .12); border-radius: 16px; text-align: center; }
.empty-state i { display: block; width: 38px; height: 38px; margin: 0 auto 18px; border: 1px solid var(--accent); border-radius: 12px; transform: rotate(45deg); }
.empty-state h2 { margin: 0 0 8px; font-size: 16px; }
.empty-state p { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.empty-state a { display: inline-flex; padding: 10px 14px; border-radius: 9px; color: #17141d; background: #eeeafc; font-size: 11px; font-weight: 650; }

.creator-manager { position: fixed; z-index: 90; inset: 0; }
.creator-manager[hidden] { display: none; }
.creator-manager-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(0, 0, 0, .66); backdrop-filter: blur(10px); }
.creator-manager-panel { position: absolute; top: 0; right: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; width: min(480px, 100%); height: 100%; border-left: 1px solid rgba(255, 255, 255, .12); background: #0d1014; box-shadow: -30px 0 90px rgba(0, 0, 0, .45); }
.creator-manager-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 28px 24px 20px; border-bottom: 1px solid var(--line); }
.creator-manager-panel header span { color: #858d9a; font-size: 8px; letter-spacing: .18em; }
.creator-manager-panel h2 { margin: 7px 0 5px; font-size: 24px; font-weight: 570; letter-spacing: -.035em; }
.creator-manager-panel header p { margin: 0; color: #858d98; font-size: 11px; }
.creator-manager-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: #b5bac2; background: transparent; cursor: pointer; font-size: 21px; }
.creator-manager-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.creator-manager-summary span { padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: #8d95a0; background: #11151a; font-size: 11px; }
.creator-manager-summary b { display: block; margin-bottom: 3px; color: #f0f1f3; font-size: 17px; font-weight: 580; }
.creator-manager-list { min-height: 0; overflow: auto; padding: 8px 24px 20px; }
.manager-loading, .manager-empty { display: flex; min-height: 230px; flex-direction: column; align-items: center; justify-content: center; color: #858c96; text-align: center; font-size: 11px; }
.manager-loading i { width: 18px; height: 18px; margin-bottom: 10px; border: 2px solid rgba(255, 255, 255, .12); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.manager-empty b { margin-bottom: 7px; color: #e7e8eb; font-size: 14px; }
.manager-project { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.manager-project-cover { width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; background: radial-gradient(circle at 30% 25%, hsla(var(--seed), 70%, 68%, .32), transparent 35%), #171b21; }
.manager-project-copy { min-width: 0; }
.manager-project-copy > span { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: #929aa5; font-size: 11px; }
.manager-project-copy > span i { width: 5px; height: 5px; border-radius: 50%; background: #69717d; }
.manager-project.is-public .manager-project-copy > span i { background: #65d2aa; box-shadow: 0 0 0 4px rgba(101, 210, 170, .08); }
.manager-project.is-ready .manager-project-copy > span i { background: var(--accent); }
.manager-project-copy h3 { overflow: hidden; margin: 0 0 4px; font-size: 14px; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
.manager-project-copy p { overflow: hidden; margin: 0; color: #858e99; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.manager-project-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.manager-project-actions a, .manager-project-actions button { border: 0; padding: 0; color: #b5a7f8; background: transparent; cursor: pointer; font-size: 11px; white-space: nowrap; }
.manager-project-actions button { color: #8b929c; }
.creator-manager-panel > footer { display: flex; gap: 8px; padding: 16px 24px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.creator-manager-panel > footer a { display: inline-flex; flex: 1; align-items: center; justify-content: center; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; color: #c7cbd1; font-size: 12px; }
.creator-manager-panel > footer a.is-primary { color: #17141d; background: #eeeafc; font-weight: 650; }

.detail-modal { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: clamp(10px, 3vw, 36px); }
.detail-modal[hidden] { display: none; }
.detail-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0, 0, 0, .76); backdrop-filter: blur(16px); }
.detail-panel { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(1220px, 100%); height: min(850px, 94vh); overflow: hidden; border: 1px solid rgba(255, 255, 255, .13); border-radius: 20px; background: #0d1014; box-shadow: 0 40px 120px rgba(0, 0, 0, .62); }
.detail-panel > header, .detail-panel > footer { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 18px 20px; }
.detail-panel > header { border-bottom: 1px solid var(--line); }
.detail-panel h2 { margin: 3px 0 4px; font-size: 19px; font-weight: 590; }
.detail-panel header p { margin: 0; color: #8f97a2; font-size: 12px; }
.detail-category { color: var(--accent); font-size: 11px; }
.detail-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; color: #aeb3bb; background: transparent; cursor: pointer; font-size: 22px; }
.detail-viewer-shell { position: relative; min-height: 0; background: #050608; }
.detail-viewer-shell iframe { display: block; width: 100%; height: 100%; border: 0; }
.detail-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: #a1a7b0; background: #080a0d; font-size: 11px; pointer-events: none; transition: opacity .35s; }
.detail-loading.is-hidden { opacity: 0; }
.detail-loading.is-slow { color: #c9c1ec; }
.detail-loading.is-error { color: #ffb9b9; background: rgba(20, 9, 12, .96); }
.detail-loading i { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.detail-loading.is-slow i { animation-duration: 1.4s; }
.detail-loading.is-error i { border-color: rgba(255, 132, 132, .7); animation: none; }
.detail-panel > footer { align-items: flex-end; border-top: 1px solid var(--line); }
.detail-panel footer > div:first-child { min-width: 0; }
.detail-panel footer p { max-width: 720px; margin: 0 0 9px; color: #a3a9b2; font-size: 12px; line-height: 1.55; }
.detail-tags { display: flex; gap: 6px; }
.detail-tags span { padding: 4px 7px; border-radius: 6px; color: #8b939e; background: #171b21; font-size: 11px; }
.detail-actions { display: flex; gap: 8px; flex-shrink: 0; }
.detail-actions a { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; color: #d8dbe0; background: transparent; cursor: pointer; font-size: 11px; }
.detail-actions a { color: #141119; background: #e9e5f6; font-weight: 630; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; max-width: min(420px, calc(100% - 32px)); padding: 11px 15px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; color: #eee; background: rgba(19, 22, 28, .94); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .community-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .community-toolbar { align-items: stretch; flex-direction: column; gap: 8px; }
  .toolbar-actions { justify-content: space-between; width: 100%; }
  .search-box { width: min(48vw, 380px); }
}

@media (max-width: 820px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { display: none; }
  .community-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .community-hero { padding: 44px 0 34px; }
  .community-hero h1 { font-size: 38px; }
  .toolbar-actions { align-items: stretch; flex-direction: column; }
  .sort-list { padding: 0 0 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .search-box { width: 100%; }
  .detail-panel > footer { align-items: stretch; flex-direction: column; }
  .detail-actions { justify-content: flex-end; }
}

@media (max-width: 560px) {
  .site-header { height: 62px; padding-inline: 16px; }
  .manager-button, .create-link { min-height: 36px; padding-inline: 10px; }
  .community-toolbar { top: 62px; }
  .community-hero { padding: 38px 0 30px; }
  .community-hero h1 { max-width: 100%; font-size: clamp(27px, 7.7vw, 30px); line-height: 1.12; }
  .community-hero p { max-width: 310px; margin-top: 12px; font-size: 12px; }
  .filter-list button, .sort-list button { min-height: 32px; padding-inline: 10px; }
  .feed-section { padding-top: 28px; }
  .community-grid { display: block; }
  .community-card { display: block; }
  .card-copy { padding-bottom: 17px; }
  .creator-manager-panel { width: 100%; }
  .creator-manager-panel > header { padding: 22px 18px 17px; }
  .creator-manager-summary, .creator-manager-list { padding-left: 18px; padding-right: 18px; }
  .creator-manager-panel > footer { padding-left: 18px; padding-right: 18px; }
  .detail-modal { padding: 0; }
  .detail-panel { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .detail-panel > header, .detail-panel > footer { padding: 14px; }
  .detail-viewer-shell { min-height: 52vh; }
  .detail-actions { width: 100%; }
  .detail-actions > * { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
