:root{
  --bg: #0b0b0d;
  --panel: #141418;
  --text: #f0efe8;
  --muted: #b9b7aa;
  --gold: #c8a45a;
  --line: rgba(255,255,255,0.08);

  --townsfolk: #63a7ff;  /* 蓝 */
  --outsider:  #44d2c5;  /* 青 */
  --minion:    #ff9b3d;  /* 橙 ✅ */
  --demon:     #ff5b5b;  /* 红 */
  --traveler:  #b07bff;  /* 紫 ✅ */
}

*{ box-sizing:border-box; }
body{
  margin:0;
  background: radial-gradient(1200px 800px at 20% 0%, rgba(200,164,90,0.10), transparent 60%), var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", Arial;
}
a{ color:inherit; text-decoration:none; }

.wrap{ width:min(1120px, calc(100% - 32px)); margin:0 auto; }

.topbar{
  position:sticky; top:0; z-index:50;
  background: rgba(11,11,13,0.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar .wrap{
  display:flex; align-items:center; gap:16px;
  padding:14px 0;
}
.brand{
  font-weight:700;
  letter-spacing:0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.brand-link{ color:var(--gold); }
.nav{ margin-left:auto; display:flex; gap:14px; align-items:center; }
.nav a{ color:var(--muted); }
.nav a:hover{ color:var(--text); }

.mobile-search-toggle{
  display:none;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.04);
  color:var(--text);
  cursor:pointer;
}

.mobile-search-toggle.is-active{
  border-color:rgba(200,164,90,0.45);
  background:rgba(200,164,90,0.14);
}

.search{
  display:flex;
  gap:10px;
  flex:1;
  max-width: 760px; /* 稍微加宽 */
}
#roleInput{ flex: 1.2; }
#titleInput{ flex: 1; }
.search input{
  flex:1;
  padding:10px 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color:var(--text);
  border-radius:12px;
  outline:none;
}
.search input:focus{ border-color: rgba(200,164,90,0.55); }

.btn-primary{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid rgba(200,164,90,0.55);
  background: rgba(200,164,90,0.14);
  color: var(--text);
  cursor:pointer;
}
.btn-primary:hover{ background: rgba(200,164,90,0.22); }

.btn-ghost{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor:pointer;
}
.btn-ghost:hover{ color:var(--text); }

.back-to-top-btn{
  position:fixed;
  right:24px;
  bottom:24px;
  width:46px;
  height:46px;
  border:none;
  border-radius:999px;
  background:rgba(200,164,90,0.9);
  color:#111;
  font-size:22px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(0,0,0,0.28);
  opacity:0;
  pointer-events:none;
  transform:translateY(10px);
  transition:opacity .18s ease, transform .18s ease, background .18s ease;
  z-index:60;
}

.back-to-top-btn.is-visible{
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
}

.back-to-top-btn:hover{
  background:rgba(215,182,109,1);
}

.back-home-btn{
  position:fixed;
  right:24px;
  bottom:24px;
  min-width:72px;
  height:46px;
  padding:0 16px;
  border:none;
  border-radius:999px;
  background:rgba(200,164,90,0.92);
  color:#111;
  font-size:15px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(0,0,0,0.28);
  transition:transform .18s ease, background .18s ease;
  z-index:60;
}

.back-home-btn:hover{
  background:rgba(215,182,109,1);
  transform:translateY(-2px);
}

.hint{ color:var(--muted); margin:18px 0 6px; }

.category{ padding:18px 0 8px; border-bottom:1px solid var(--line); }
.category-title{
  font-size:20px;
  margin: 10px 0 14px;
  letter-spacing:0.02em;
}
.card-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:14px;
  padding-bottom:18px;
}
@media (max-width: 960px){ .card-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .card-grid{ grid-template-columns: 1fr; } }

.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover{
  transform: translateY(-2px);
  border-color: rgba(200,164,90,0.35);
}
.card-title{ font-size:18px; font-weight:700; margin-bottom:6px; }
.card-sub{ color:var(--muted); font-size:13px; margin-bottom:10px; }
.card-meta{ display:flex; gap:8px; }
.pill{
  font-size:12px;
  color: var(--gold);
  border:1px solid rgba(200,164,90,0.35);
  padding:4px 8px;
  border-radius:999px;
}

.detail-head{ padding:22px 0 10px; }
.detail-head h1{ margin:0 0 6px; font-size:32px; }
.muted{ color:var(--muted); }
.desc{ color:var(--muted); line-height:1.6; }

.detail-rating-panel{
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
}

.detail-rating-stats{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.detail-rating-stat{
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  background: rgba(0,0,0,0.16);
}

.detail-rating-label{
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.detail-rating-value{
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.detail-rating-form{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.detail-rating-item{
  min-width: 0;
}

.detail-rating-submit{
  width: 100%;
  height: 44px;
}

.panel{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.03);
  border-radius:18px;
  padding:16px;
}

.role-group{ margin:18px 0; }
.role-group h3{ margin:0 0 10px; color: var(--gold); letter-spacing:0.03em; }
.role-grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 960px){ .role-grid{ grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px){ .role-grid{ grid-template-columns: repeat(3, 1fr); } }

.role-item{
  border:1px solid var(--line);
  border-radius:14px;
  background: rgba(0,0,0,0.20);
  padding:10px;
  display:flex;
  align-items:center;
  gap:10px;
}
.role-icon{
  width:36px; height:36px;
  border-radius:10px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,0.10);
}
.role-name{ font-weight:650; }

.role-townsfolk .role-name{ color: var(--townsfolk); }
.role-outsider .role-name{ color: var(--outsider); }
.role-minion .role-name{ color: var(--minion); }
.role-demon .role-name{ color: var(--demon); }
.role-traveler .role-name{ color: var(--traveler); }
.role-fabled .role-name{ color: var(--fabled); }

.review-row{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}
.review-row:last-child{ border-bottom:none; }
.file{ flex:1; color:var(--muted); }
.select{
  border-radius:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
}

.select option{
  color: #000;
}

.role-item{
  align-items: flex-start;
  gap: 12px;
  padding: 12px;    /* 稍微更厚一点 */
}

.role-text{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}

.role-ability{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  /* ✅避免太长撑爆：你想换成完全展开也可以删掉这几行 */

}

.subcategory{ margin: 10px 0 18px; }
.subcategory-title{
  margin: 12px 0 10px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .02em;
}

.card-cover{
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}
.card-cover img{
  width: 100%;
  height: 100%;
  object-fit: contain;     /* ✅宽度完整显示，不裁切 */
  display: block;
}
.card-cover{
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);  /* ✅填充留白区域 */
  display: flex;                 /* ✅居中 */
  align-items: center;
  justify-content: center;
}

.detail-logo{
  width: 100%;
  max-width: 860px;
  aspect-ratio: 21 / 9;   /* 横幅更适合 logo；想要更高就改 16/9 */
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0 14px;
}

.detail-logo img{
  width: 100%;
  height: 100%;
  object-fit: contain;   /* ✅宽度完整显示 */
  display: block;
}

.hd-section{
  margin: 26px 0 36px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.hd-title{
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: .02em;
}
.hd-actions{
  margin-bottom: 12px;
}
.hd-image{
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
}
.hd-image img{
  width: 100%;
  height: auto;
  display: block;
}

.pill-cyan{
  color: var(--outsider); /* 你外来者青色变量 */
  border-color: rgba(68, 210, 197, 0.45); /* 或者直接用 var 也行 */
}

/* ---------- HERO ---------- */
.hero{
  margin: 18px 0 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; }
}
.hero-right{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.hero-kicker{
  color: var(--gold);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 800;
  font-size: 12px;
}
.hero-title{
  margin: 6px 0 6px;
  font-size: 40px;
  line-height: 1.05;
}
.hero-sub{
  color: var(--muted);
  line-height: 1.6;
  max-width: 52ch;
}
.hero-stats{
  display:flex;
  gap:12px;
  margin-top: 14px;
}
.stat{
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}
.stat-num{ font-size: 22px; font-weight: 900; color: var(--text); }
.stat-label{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.hero-card{
  border-radius: 20px;
  border: 1px solid rgba(200,164,90,0.28);
  background: radial-gradient(900px 300px at 20% 0%, rgba(200,164,90,0.18), transparent 55%),
              rgba(0,0,0,0.18);
  padding: 14px;
  height: auto;
}
.home-account-panel{
  min-height: 0;
}
.home-auth-panel{
  margin-bottom: 18px;
}
.home-auth-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:14px;
}
.home-auth-form{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.home-auth-panel-form{
  gap:14px;
}
.home-auth-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.home-auth-grid > *{
  min-width:0;
}
.home-auth-switches{
  display:flex;
  gap:8px;
}
.home-auth-switches .auth-switch.is-active{
  color:var(--text);
  border-color:rgba(200,164,90,0.45);
  background:rgba(200,164,90,0.14);
}
.home-workspace-panel{
  margin-bottom: 18px;
}
.author-body{
  display:grid;
  grid-template-columns:minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap:18px;
  align-items:start;
}
.author-main,
.author-side{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.author-hero-points{
  margin-top:14px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.author-quick-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.author-quick-link{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
  color:var(--text);
  text-decoration:none;
  transition:transform .14s ease, border-color .14s ease, background .14s ease;
}
.author-quick-link:hover{
  transform:translateY(-2px);
  border-color:rgba(200,164,90,0.45);
  background:rgba(200,164,90,0.12);
}
.author-quick-link span{
  color:var(--muted);
  font-size:13px;
}
.author-info-panel{
  margin-bottom:0;
}
.author-info-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.author-info-item{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(0,0,0,0.16);
  color:var(--text);
  line-height:1.5;
}
.author-group-panel{
  margin-bottom: 0;
}
.author-group-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:14px;
}
.author-group-card{
  display:flex;
  justify-content:center;
  align-items:center;
  padding:18px;
  border-radius:18px;
  border:1px solid var(--line);
  background:rgba(0,0,0,0.18);
}
.author-group-qr{
  display:block;
  width:min(100%, 360px);
  height:auto;
  border-radius:16px;
  box-shadow:0 14px 32px rgba(0,0,0,0.3);
}
.author-page{
  padding-top: 18px;
  padding-bottom: 32px;
}
.author-hero{
  margin-bottom: 18px;
}
.home-workspace-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.home-workspace-tools{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
}
.home-workspace-counts{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.home-bulk-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.home-workspace-grid{
  margin-top:14px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
}
.home-workspace-group h3{
  margin:0 0 10px;
  font-size:16px;
}
.home-workspace-group-published{
  margin-top:14px;
}
.home-workspace-group-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}
.home-script-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.home-script-list-compact{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.home-script-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(0,0,0,0.16);
}
.home-script-item-compact{
  align-items:flex-start;
  padding:10px 12px;
}
.home-script-check{
  display:flex;
  align-items:flex-start;
  padding-top:2px;
}
.home-script-check input{
  width:16px;
  height:16px;
  accent-color: var(--accent);
}
.home-script-main{
  min-width:0;
  flex:1 1 auto;
}
.home-script-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.home-script-item-compact .home-script-actions{
  gap:8px;
}
.home-script-item-compact .home-script-actions .btn-ghost,
.home-script-item-compact .home-script-actions .btn-primary{
  padding:8px 10px;
}
.home-script-title{
  font-weight:700;
  line-height:1.4;
  word-break:break-word;
}
.home-script-meta{
  margin-top:4px;
  font-size:13px;
  color:var(--muted);
}
.home-edit-script-btn{
  flex:0 0 auto;
}
.hero-card-title{
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}
.hero-card-tip{
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.hero-chips{ display:flex; flex-wrap: wrap; gap:8px; }
.chip{
  border-radius: 999px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}
.chip:hover{
  border-color: rgba(200,164,90,0.4);
  background: rgba(200,164,90,0.14);
}

@media (max-width: 900px){
  .author-body{
    grid-template-columns:1fr;
  }
  .author-quick-grid{
    grid-template-columns:1fr;
  }
  .home-workspace-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .home-script-list-compact{
    grid-template-columns:1fr;
  }
}

@media (max-width: 640px){
  .home-auth-head,
  .author-group-head,
  .home-workspace-head,
  .home-workspace-tools,
  .home-workspace-group-head,
  .author-quick-grid,
  .home-script-item,
  .home-script-actions{
    flex-direction:column;
    align-items:stretch;
  }

  .home-auth-grid{
    grid-template-columns:1fr;
  }

  .home-workspace-grid{
    grid-template-columns:1fr;
  }

  .home-script-list-compact{
    grid-template-columns:1fr;
  }
}

/* ---------- CATEGORY TITLES ---------- */
.category{
  padding: 18px 0 10px;
  border-bottom: 1px solid var(--line);
}
.category-title{
  font-size: 20px;
  margin: 10px 0 12px;
  letter-spacing: 0.04em;
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}
.category-title::after{
  content:"";
  position:absolute;
  left:0; bottom:0;
  width: 72px;
  height: 2px;
  background: rgba(200,164,90,0.55);
  border-radius: 2px;
}

/* ---------- SUBCATEGORY ---------- */
.subcategory{
  margin: 10px 0 18px;
}
.subcategory-title{
  display:inline-block;
  margin: 12px 0 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.02);
}

/* ---------- CARD UPGRADE ---------- */
.card{
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.card:hover{
  transform: translateY(-3px);
  border-color: rgba(200,164,90,0.42);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.card-cover{
  width: 100%;
  aspect-ratio: 16/9;
  background: rgba(0,0,0,0.25);
  display:flex;
  align-items:center;
  justify-content:center;
  position: relative;
}
.card-cover img{
  width: 100%;
  height: 100%;
  object-fit: contain; /* 你要求宽图完整显示 */
  display: block;
}
.card-cover-overlay{
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.35));
  pointer-events:none;
}

.card-body{
  padding: 14px 16px 16px;
}
.card-title{
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 6px;
}
.card-sub{
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-author{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-rating{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f5d66c;
}

.card-rating-stars{
  letter-spacing: 1px;
}

.card-rating-value{
  color: var(--muted);
  font-size: 12px;
}
.card-meta{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
/* ---------- Layout with right sidenav ---------- */
.layout{
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 980px){
  .layout{
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .layout.sidenav-collapsed{
    grid-template-columns: 1fr;
  }

  .sidenav{
    display: block;
    position: sticky;
    top: 62px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 10px;
    border-radius: 16px;
  }

  .sidenav-head{
    margin-bottom: 8px;
  }

  .sidenav-toggle{
    display: none;
  }

  .sidenav-list{
    display: inline-flex;
    flex-direction: row;
    gap: 8px;
    min-width: max-content;
  }

  .sidenav-group{
    display: inline-flex;
    gap: 8px;
    margin-bottom: 0;
  }

  .sidenav-sublist{
    display: none;
  }

  .sidenav-link,
  .sidenav-cat{
    white-space: nowrap;
    padding: 9px 12px;
  }

  .sidenav-count{
    float: none;
    margin-left: 6px;
  }
}

.sidenav{
  position: sticky;
  top: 86px;                 /* 顶部栏高度附近，按你 topbar 实际高度微调 */
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  padding: 12px;
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.sidenav-title{
  color: var(--gold);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 10px;
}

.sidenav-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidenav-link{
  display: block;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--muted);
  line-height: 1.2;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.sidenav-link:hover{
  color: var(--text);
  border-color: rgba(200,164,90,0.35);
  background: rgba(200,164,90,0.10);
}
.sidenav-link.active{
  color: var(--text);
  border-color: rgba(200,164,90,0.55);
  background: rgba(200,164,90,0.14);
}

.sidenav-group{ margin-bottom: 10px; }

.sidenav-cat{
  font-weight: 900;
  color: var(--text);
  border-color: rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.sidenav-sublist{
  margin-top: 6px;
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,0.08);
  display:flex;
  flex-direction: column;
  gap: 6px;
}

.sidenav-sub{
  font-size: 13px;
  padding: 8px 10px;
}

.sidenav-count{
  float: right;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ---------- Collapsible sidenav ---------- */
.sidenav-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

.sidenav-toggle{
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  padding: 8px 10px;
  line-height: 1;
}
.sidenav-toggle:hover{
  border-color: rgba(200,164,90,0.35);
  background: rgba(200,164,90,0.10);
}

/* 折叠态：变窄 + 隐藏内容 */
.sidenav.is-collapsed{
  width: 56px;
  padding: 10px;
}

.sidenav.is-collapsed .sidenav-title,
.sidenav.is-collapsed .sidenav-list{
  display:none;
}

.sidenav.is-collapsed .sidenav-head{
  margin-bottom: 0;
  justify-content: center;
}

/* 折叠态按钮更大一点方便点 */
.sidenav.is-collapsed .sidenav-toggle{
  width: 40px;
  height: 40px;
  border-radius: 14px;
}

/* 布局：右侧列宽随展开/折叠变化 */
.layout{
  grid-template-columns: 1fr 260px;
}
.layout.sidenav-collapsed{
  grid-template-columns: 1fr 70px;
}

.brand-logo{
  height: 28px;       /* 你想更大就调 32/36 */
  width: auto;
  display: block;
}

.hero-download{
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.action-msg{
  min-width: 72px;
  font-size: 13px;
  color: var(--muted);
}

.action-msg.is-loading{
  color: var(--gold);
}

.action-msg.is-success{
  color: #57d38c;
  font-weight: 700;
}

.action-msg.is-error{
  color: #ff7b7b;
  font-weight: 700;
}
/* ===== 投稿页 ===== */

.submit-page{
  padding: 28px 0 40px;
}

.submit-hero{
  margin: 4px 0 20px;
}

.page-kicker{
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.submit-title{
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.15;
}

.submit-lead{
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.8;
}

.submit-layout{
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px){
  .submit-layout{
    grid-template-columns: 1fr;
  }
}

.submit-panel,
.submit-side{
  padding: 22px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025));
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.panel-title{
  margin: 0 0 18px;
  font-size: 20px;
  color: var(--text);
}

.submit-form{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-label{
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.text-input,
.file-input{
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.035);
  color: var(--text);
  outline: none;
}

.text-input:focus,
.file-input:focus{
  border-color: rgba(200,164,90,0.55);
  box-shadow: 0 0 0 3px rgba(200,164,90,0.08);
}

.file-input{
  padding: 10px 12px;
}

.form-tip{
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 2px;
}

.submit-btn{
  margin-top: 8px;
  min-height: 46px;
  font-size: 15px;
}

.submit-msg{
  min-height: 24px;
  margin-top: 4px;
}

.notice-box{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.025);
  line-height: 1.85;
  color: var(--muted);
}

.notice-box p{
  margin: 0 0 8px;
}

.notice-box p:last-child{
  margin-bottom: 0;
}

.qr-card{
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,0.025);
  text-align: center;
}

.qr-title{
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}

.qr-image{
  width: min(100%, 260px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  padding: 10px;
  border: 1px solid var(--line);
}

.qr-tip{
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* 投稿结果提示色 */
.submit-msg.is-success{
  color: #57d38c;
  font-weight: 700;
}

.submit-msg.is-error{
  color: #ff7b7b;
  font-weight: 700;
}
.reject-reason{
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
}

.reject-reason:focus{
  border-color: rgba(200,164,90,0.55);
  box-shadow: 0 0 0 3px rgba(200,164,90,0.08);
}

.text-area{
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.035);
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 160px;
  line-height: 1.7;
  box-sizing: border-box;
}

.text-area:focus{
  border-color: rgba(200,164,90,0.55);
  box-shadow: 0 0 0 3px rgba(200,164,90,0.08);
}

.hero-download{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.copy-json-msg{
  margin-top: 10px;
  min-height: 22px;
}

.gold-btn{
  background: linear-gradient(180deg, #d8b36a, #b88a36);
  color: #1b150b !important;
  border: 1px solid rgba(255, 215, 130, 0.35);
  box-shadow: 0 6px 16px rgba(184, 138, 54, 0.22);
}

.gold-btn:hover{
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.gold-btn:disabled{
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
/* =========================
   管理页：admin review
   追加到 site.css 末尾
   ========================= */

.admin-section{
  margin: 22px 0 30px;
}

.admin-section > h1{
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.2;
}

.admin-section .panel{
  padding: 14px 16px;
}

.admin-toolbar{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.admin-filter-select{
  flex: 0 0 180px;
}

.admin-filter-input{
  flex: 1 1 320px;
}

.admin-pager{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.admin-pager-info{
  min-width: 140px;
  text-align: center;
}

.latest-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
}

.latest-card{
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  flex: 0 1 calc(25% - 11px);
  min-width: 260px;
  max-width: 100%;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  height: auto;
  align-self: start;
}

.latest-card:last-child{
  border-bottom: 1px solid var(--line);
}

.latest-card .file{
  flex: 0 0 auto;
  min-width: 0;
}

.latest-card .btn-ghost,
.latest-card .btn-primary,
.latest-card .action-msg{
  width: 100%;
}

.latest-card .action-msg{
  min-width: 0;
  flex: 0 0 auto;
}

.review-row{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.review-row:last-child{
  border-bottom: none;
}

.file{
  flex: 1 1 320px;
  min-width: 220px;
  color: var(--muted);
}

.file > div:first-child{
  color: var(--text);
  line-height: 1.45;
  word-break: break-all;
}

.file .hint{
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.select{
  min-width: 160px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.select:hover{
  background: rgba(255,255,255,0.06);
}

.select:focus{
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.07);
}

.select option{
  color: #000;
}

.approve-category-select,
.approve-subfolder-select,
.move-select,
.subfolder-select{
  flex: 0 0 170px;
}

.reject-reason{
  flex: 1 1 260px;
  min-width: 220px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}

.reject-reason::placeholder{
  color: var(--muted);
}

.reject-reason:focus{
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.07);
}

.review-row .btn-primary,
.review-row .btn-ghost{
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.review-row .btn-ghost{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.action-msg{
  min-width: 120px;
  font-size: 13px;
  line-height: 1.4;
  flex: 0 1 220px;
}

.action-msg.is-loading{
  color: var(--muted);
}

.action-msg.is-success{
  color: #22c55e;
}

.action-msg.is-error{
  color: #ef4444;
}

.review-row [disabled]{
  cursor: not-allowed;
}

.review-row .btn-primary[disabled],
.review-row .btn-ghost[disabled],
.review-row .select[disabled],
.review-row .reject-reason[disabled]{
  opacity: .65;
}

/* 已发布区的标题信息更稳 */
.review-row[data-published-row] .file{
  flex: 1 1 360px;
}

/* 顶部管理按钮区域 */
.topbar .nav a{
  white-space: nowrap;
}

/* 中等屏幕：按钮和输入框更容易换行 */
@media (max-width: 1100px){
  .approve-category-select,
  .approve-subfolder-select,
  .move-select,
  .subfolder-select,
  .admin-filter-select{
    flex-basis: 150px;
    min-width: 150px;
  }

  .reject-reason,
  .admin-filter-input{
    flex-basis: 100%;
    order: 10;
  }

  .action-msg{
    flex-basis: 100%;
    min-width: 0;
  }
}

/* 手机端：一行一组，避免挤压 */
@media (max-width: 720px){
  .latest-grid{
    display: flex;
    flex-direction: column;
  }

  .latest-card{
    flex: 1 1 100%;
    min-width: 0;
  }

  .admin-pager{
    justify-content: stretch;
  }

  .admin-pager .btn-ghost,
  .admin-pager-info{
    flex: 1 1 100%;
  }

  .admin-section{
    margin: 18px 0 24px;
  }

  .admin-section > h1{
    font-size: 24px;
    margin-bottom: 12px;
  }

  .admin-section .panel{
    padding: 12px;
    border-radius: 16px;
  }

  .review-row{
    align-items: stretch;
    gap: 10px;
    padding: 12px 0;
  }

  .file,
  .approve-category-select,
  .approve-subfolder-select,
  .move-select,
  .subfolder-select,
  .reject-reason,
  .admin-filter-select,
  .admin-filter-input,
  .action-msg{
    flex: 1 1 100%;
    min-width: 0;
  }

  .review-row .btn-primary,
  .review-row .btn-ghost{
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }
}

.submit-preview-actions{
  margin: 18px 0 22px;
}

.submit-preview-actions .panel{
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.submit-preview-actions .panel h3{
  margin: 0 0 8px;
}

#submitPreviewMsg{
  margin-top: 10px;
}

/* ===== 移动端适配 ===== */

img{
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea{
  font: inherit;
}

@media (max-width: 960px){
  .wrap{
    width: min(100% - 24px, 1120px);
  }

  .topbar .wrap{
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
  }

  .brand-logo{
    height: 24px;
  }

  .nav{
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
  }

  .search{
    width: 100%;
    max-width: none;
    order: 10;
    flex-wrap: wrap;
    gap: 8px;
  }

  #roleInput,
  #titleInput{
    flex: 1 1 100%;
    min-width: 0;
  }

  .search .btn-primary,
  .search .btn-ghost{
    flex: 1 1 calc(50% - 4px);
  }

  .hero{
    padding: 16px;
    border-radius: 18px;
  }

  .hero-title{
    font-size: 30px;
    line-height: 1.1;
  }

  .hero-sub{
    font-size: 14px;
    line-height: 1.7;
  }

  .hero-stats{
    flex-wrap: wrap;
  }

  .stat{
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
  }

  .category{
    padding: 14px 0 8px;
  }

  .category-title{
    font-size: 18px;
    margin: 8px 0 10px;
  }

  .card-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .card-body{
    padding: 12px 13px 14px;
  }

  .card-title{
    font-size: 16px;
  }

  .detail-head{
    padding: 18px 0 8px;
  }

  .detail-head h1{
    font-size: 26px;
    line-height: 1.2;
  }

  .detail-logo{
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    margin: 10px 0 12px;
  }

  .desc{
    font-size: 14px;
    line-height: 1.8;
  }

  .hero-download{
    display: flex;
    width: 100%;
    gap: 10px;
  }

  .hero-download > a,
  .hero-download > button{
    flex: 1 1 calc(50% - 5px);
    text-align: center;
    justify-content: center;
  }

  .role-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .role-item{
    padding: 10px;
  }

  .role-icon{
    width: 34px;
    height: 34px;
  }

  .role-name{
    font-size: 14px;
  }

  .role-ability{
    font-size: 13px;
    line-height: 1.45;
  }

  .submit-page{
    padding: 20px 0 30px;
  }

  .submit-title{
    font-size: 28px;
  }

  .submit-panel,
  .submit-side{
    padding: 18px;
    border-radius: 18px;
  }

  .panel-title{
    font-size: 18px;
    margin-bottom: 14px;
  }

  .review-row{
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }

  .review-row .file{
    width: 100%;
    flex: 1 1 100%;
  }

  .review-row .select,
  .review-row .reject-reason,
  .review-row .btn-primary,
  .review-row .btn-ghost,
  .review-row a.btn-ghost{
    width: 100%;
    min-width: 0;
  }

  .reject-reason{
    max-width: none;
  }

  .action-msg{
    width: 100%;
    min-width: 0;
  }

  .panel{
    padding: 14px;
    border-radius: 16px;
  }
}

@media (max-width: 640px){
  .wrap{
    width: calc(100% - 20px);
  }

  .topbar .wrap{
    padding: 8px 0;
  }

  .brand-logo{
    height: 22px;
  }

  .nav{
    justify-content: flex-start;
    font-size: 13px;
  }

  .search{
    gap: 8px;
  }

  .search input,
  .text-input,
  .file-input,
  .text-area,
  .select,
  .btn-primary,
  .btn-ghost{
    min-height: 44px;
  }

  .search .btn-primary,
  .search .btn-ghost{
    flex: 1 1 100%;
  }

  .hero{
    padding: 14px;
    margin: 14px 0 12px;
  }

  .hero-title{
    font-size: 24px;
  }

  .hero-kicker,
  .page-kicker{
    font-size: 11px;
    letter-spacing: .14em;
  }

  .hero-stats{
    gap: 8px;
  }

  .stat{
    flex: 1 1 100%;
  }

  .card-grid{
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card-cover{
    aspect-ratio: 16 / 10;
  }

  .category-title{
    font-size: 17px;
  }

  .subcategory-title{
    font-size: 11px;
    padding: 5px 9px;
  }

  .detail-head h1{
    font-size: 22px;
  }

  .detail-rating-stats,
  .detail-rating-form{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-logo{
    aspect-ratio: 4 / 3;
    border-radius: 14px;
  }

  .hero-download > a,
  .hero-download > button{
    flex: 1 1 100%;
    width: 100%;
  }

  .detail-rating-submit{
    grid-column: 1 / -1;
  }

  .role-grid{
    grid-template-columns: 1fr;
  }

  .role-item{
    border-radius: 12px;
  }

  .role-group h3{
    font-size: 16px;
  }

  .hd-section{
    margin: 20px 0 28px;
    padding-top: 14px;
  }

  .submit-title{
    font-size: 24px;
  }

  .submit-lead{
    font-size: 14px;
    line-height: 1.75;
  }

  .submit-panel,
  .submit-side{
    padding: 14px;
    border-radius: 16px;
  }

  .notice-box,
  .qr-card{
    padding: 14px;
    border-radius: 14px;
  }

  .qr-image{
    width: min(100%, 220px);
  }

  .review-row{
    padding: 12px 0;
  }

  .file > div:first-child{
    word-break: break-word;
  }
}

/* ===== 社区 / 评论区 ===== */

.community-wrap{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 320px;
  gap:18px;
  margin-top:28px;
  margin-bottom:28px;
}

.community-main,
.community-side{
  display:flex;
  flex-direction:column;
  gap:16px;
  min-width:0;
}

.community-main > .community-card:first-child{
  display: none;
}

.community-card{
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:16px;
  padding:18px;
  box-sizing:border-box;
}

.community-title{
  margin:0 0 14px;
  font-size:20px;
  line-height:1.3;
}

.community-form{
  margin-top:2px;
}

.stats-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:12px;
}

.stat-box{
  background:rgba(0,0,0,0.18);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:14px;
  padding:14px 12px;
}

.stat-label{
  font-size:13px;
  opacity:.78;
  line-height:1.4;
}

.stat-value{
  margin-top:8px;
  font-size:24px;
  font-weight:700;
  line-height:1.2;
}

.form-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.text-input,
.text-area,
.score-select{
  width:100%;
  box-sizing:border-box;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(0,0,0,0.18);
  color:inherit;
  border-radius:12px;
  padding:10px 12px;
  outline:none;
  font:inherit;
}

.text-input::placeholder,
.text-area::placeholder{
  color:rgba(255,255,255,0.42);
}

.text-input:focus,
.text-area:focus,
.score-select:focus{
  border-color:rgba(212,175,55,0.7);
  box-shadow:0 0 0 3px rgba(212,175,55,0.12);
}

.text-area{
  resize:vertical;
  min-height:120px;
}

.score-select{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
}

.community-editor{
  margin-top:12px;
}

.inline-check{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:12px;
  user-select:none;
}

.comment-form-actions,
.reply-actions,
.auth-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}

.comments-list{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.comment-item{
  background:rgba(0,0,0,0.16);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:14px;
  padding:14px;
}

.comment-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.comment-author-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.comment-avatar{
  width:42px;
  height:42px;
  border-radius:50%;
  object-fit:cover;
  flex:0 0 42px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.08);
}

.comment-avatar.fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  font-weight:700;
}

.comment-author{
  font-weight:700;
  line-height:1.3;
  word-break:break-all;
}

.comment-time{
  margin-top:4px;
  font-size:12px;
  opacity:.66;
  line-height:1.4;
}

.comment-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  flex-shrink:0;
}

.comment-action{
  padding:6px 10px;
  font-size:13px;
  line-height:1.2;
}

.comment-body{
  margin-top:12px;
  line-height:1.75;
  word-break:break-word;
  white-space:normal;
}

.reply-box{
  margin-top:12px;
}

.comment-replies{
  margin-top:14px;
  margin-left:14px;
  padding-left:14px;
  border-left:2px solid rgba(255,255,255,0.08);
  display:flex;
  flex-direction:column;
  gap:12px;
}

.auth-user-box{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.auth-meta{
  font-size:13px;
  opacity:.78;
  word-break:break-all;
}

.notify-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:12px;
}

.notify-item{
  background:rgba(0,0,0,0.16);
  border:1px solid rgba(255,255,255,0.06);
  border-radius:12px;
  padding:12px;
}

.notify-item.unread{
  border-color:rgba(212,175,55,0.55);
}

.notify-title{
  font-weight:700;
  line-height:1.4;
}

.notify-content{
  margin-top:6px;
  font-size:13px;
  line-height:1.6;
  opacity:.82;
}

.notify-time{
  margin-top:6px;
  font-size:12px;
  opacity:.62;
}

@media (max-width: 960px){
  .community-wrap{
    grid-template-columns:1fr;
  }

  .community-side{
    order:-1;
  }
}

@media (max-width: 720px){
  .stats-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .form-grid{
    grid-template-columns:1fr;
  }

  .comment-head{
    flex-direction:column;
    align-items:stretch;
  }

  .comment-actions{
    margin-top:2px;
  }
}

@media (max-width: 480px){
  .community-card{
    padding:14px;
    border-radius:14px;
  }

  .community-title{
    font-size:18px;
  }

  .stat-value{
    font-size:22px;
  }

  .comment-replies{
    margin-left:8px;
    padding-left:10px;
  }
}
.card-cover-wrap{
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
}

.card-cover{
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.25);
}

.card-cover img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 1;
}

@media (max-width: 820px){
  .topbar .wrap{
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
  }

  .brand{
    flex: 1 1 100%;
  }

  .mobile-search-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin-left:auto;
  }

  .search{
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .search.is-collapsed{
    display:none;
  }

  .search input{
    min-width: 0;
  }

  .search #roleInput,
  .search #excludeRoleInput,
  .search #titleInput{
    grid-column: 1 / -1;
  }

  .search .btn-primary,
  .search .btn-ghost{
    width: 100%;
  }

  .nav{
    flex: 1 1 100%;
    justify-content: space-between;
    margin-left: 0;
    gap: 8px;
  }

  .nav a{
    flex: 1 1 0;
    text-align: center;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
  }

  .hero{
    grid-template-columns: 1fr;
  }

  .hero-sub{
    max-width: none;
  }

  .hero-right{
    gap: 12px;
  }

  .sidenav{
    top: 70px;
  }

  .detail-rating-stats,
  .detail-rating-form{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-rating-submit{
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px){
  .wrap{
    width: calc(100% - 16px);
  }

  .topbar{
    position: sticky;
  }

  .topbar .wrap{
    padding: 8px 0 10px;
  }

  .brand-logo{
    height: 24px;
  }

  .mobile-search-toggle{
    width:auto;
    min-height:40px;
    padding:8px 12px;
    font-size:13px;
  }

  .search{
    grid-template-columns: 1fr;
  }

  .nav{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero{
    padding: 14px;
    border-radius: 18px;
  }

  .hero-title{
    font-size: 26px;
  }

  .hero-stats{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat{
    min-width: 0;
  }

  .panel,
  .submit-panel,
  .submit-side,
  .community-card{
    padding: 14px;
    border-radius: 16px;
  }

  .card-body{
    padding: 12px;
  }

  .card-sub{
    align-items: flex-start;
    flex-direction: column;
  }

  .card-author{
    white-space: normal;
  }

  .detail-head{
    padding-top: 16px;
  }

  .detail-head h1{
    font-size: 24px;
  }

  .detail-logo{
    aspect-ratio: 4 / 3;
  }

  .detail-rating-stats,
  .detail-rating-form,
  .stats-grid{
    grid-template-columns: 1fr;
  }

  .hero-download{
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-download > a,
  .hero-download > button{
    width: 100%;
    flex: 1 1 100%;
  }

  .role-grid{
    grid-template-columns: 1fr;
  }

  .role-item{
    padding: 10px;
  }

  .author-body,
  .submit-layout,
  .community-wrap{
    gap: 14px;
  }

  .home-bulk-actions,
  .home-workspace-counts{
    justify-content: flex-start;
  }

  .home-script-actions{
    width: 100%;
  }

  .home-script-actions .btn-primary,
  .home-script-actions .btn-ghost{
    width: 100%;
    text-align: center;
  }

  .sidenav{
    top: 64px;
    padding: 8px;
    border-radius: 14px;
  }

  .sidenav-link,
  .sidenav-cat{
    padding: 8px 10px;
    font-size: 13px;
  }

  .back-to-top-btn,
  .back-home-btn{
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

.card-fallback-overlay{
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(0,0,0,0.08);
  pointer-events: none;
}

.card-fallback-title{
  text-align: center;
  font-weight: 800;
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: 0.02em;
  white-space: normal;
  word-break: break-word;
  text-shadow:
    0 2px 4px rgba(0,0,0,0.9),
    0 0 10px rgba(0,0,0,0.6);
}

.card-fallback-title .char{
  display: inline-block;
}
.detail-logo-wrap{
  width: 100%;
  max-width: 860px;
  aspect-ratio: 21 / 9;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  margin: 16px 0 14px;
}

.detail-logo{
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.25);
}

.detail-logo img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 1;
}

.detail-fallback-overlay{
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background: rgba(0,0,0,0.10);
  pointer-events: none;
  text-align: center;
}

.detail-fallback-title{
  width: 100%;
  max-width: 100%;
  display: block;
  text-align: center;
  font-weight: 900;
  font-size: 100px;
  line-height: 1.08;
  letter-spacing: 0.01em;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  text-shadow:
    0 2px 4px rgba(0,0,0,0.95),
    0 0 12px rgba(0,0,0,0.65);
}

.detail-fallback-title .char{
  display: inline;
}

@media (max-width: 960px){
  .detail-fallback-title{
    font-size: 52px;
  }
}

@media (max-width: 640px){
  .detail-fallback-overlay{
    padding: 6px 12px;
  }

  .detail-fallback-title{
    font-size: 34px;
    line-height: 1.1;
  }
}
