/* ============================================================
   模板：社区（独立模板 · 社交动态流）
   布局：渐变顶栏 + 三栏（图标导航+数据卡 | 发布器+动态流 | 活跃之星+话题）
   ============================================================ */
body.theme-community {
  --p: #7c3aed;
  --p-dark: #6d28d9;
  --p-light: #ede9fe;
  --ink: #2e1065;
  --muted: #8b7bb8;
  --line: #e9e2f8;
  --bg: #faf5ff;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 2px 6px rgba(124, 58, 237, 0.06), 0 8px 24px rgba(124, 58, 237, 0.08);
}

body.theme-community .ct-wrap { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* ---------- 渐变顶栏 ---------- */
body.theme-community .ct-header {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(120deg, #4c1d95 0%, #7c3aed 55%, #c026d3 100%);
  box-shadow: 0 3px 14px rgba(109, 40, 217, 0.35);
}
body.theme-community .ct-bar { display: flex; align-items: center; gap: 16px; height: 56px; }
body.theme-community .ct-logo {
  display: flex; align-items: center; gap: 9px; color: #fff;
  font-size: 18px; font-weight: 700; text-decoration: none; letter-spacing: 1px;
}
body.theme-community .ct-logo img { width: 30px; height: 30px; border-radius: 50%; }
body.theme-community .ct-logo em {
  font-style: normal; font-size: 11px; background: rgba(255, 255, 255, 0.2);
  padding: 2px 9px; border-radius: 999px; letter-spacing: 2px; margin-left: 2px;
}
body.theme-community .ct-nav { display: flex; gap: 2px; }
body.theme-community .ct-nav a {
  color: #e9d5ff; text-decoration: none; font-size: 13.5px; padding: 6px 11px; border-radius: 999px;
}
body.theme-community .ct-nav a:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
body.theme-community .ct-search { display: flex; margin-left: auto; }
body.theme-community .ct-search input {
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff; padding: 6px 14px; border-radius: 999px 0 0 999px; width: 180px; font-size: 13px;
}
body.theme-community .ct-search input::placeholder { color: #d8b4fe; }
body.theme-community .ct-search input:focus { outline: none; background: #fff; color: #2e1065; }
body.theme-community .ct-search button {
  border: none; background: #f0abfc; color: #4c1d95; font-weight: 700;
  padding: 0 13px; border-radius: 0 999px 999px 0; cursor: pointer;
}
body.theme-community .ct-search button:hover { background: #f5d0fe; }
body.theme-community .ct-admin { color: #fde047; text-decoration: none; font-size: 13px; white-space: nowrap; }
body.theme-community .ct-login {
  background: #fff; color: #6d28d9; border: none; font-weight: 700; font-size: 13px;
  padding: 7px 15px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
body.theme-community .ct-login:hover { background: #f5d0fe; }
body.theme-community #p-user-chip b { color: #fff; }
body.theme-community #p-user-chip .p-logout { color: #e9d5ff; }

body.theme-community .ct-main { background: var(--bg); padding: 20px 0 56px; min-height: 60vh; }

/* ---------- 三栏 ---------- */
body.theme-community .ct-cols { display: grid; grid-template-columns: 195px 1fr 280px; gap: 18px; align-items: start; }

/* 左栏：图标导航 + 社区数据 */
body.theme-community .ct-icons {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow); position: sticky; top: 74px;
}
body.theme-community .ct-icons a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: #5b21b6; text-decoration: none; font-size: 14px; font-weight: 500;
}
body.theme-community .ct-icons a span { font-size: 19px; }
body.theme-community .ct-icons a:hover { background: var(--p-light); }
body.theme-community .ct-icons a.on { background: linear-gradient(120deg, #7c3aed, #a855f7); color: #fff; }
body.theme-community .ct-my-stats {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-top: 14px; box-shadow: var(--shadow);
}
body.theme-community .ct-my-stats h3 { font-size: 13.5px; color: var(--ink); margin-bottom: 10px; }
body.theme-community .ct-my-stats div {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 2px; border-bottom: 1px dashed var(--line); font-size: 12.5px;
}
body.theme-community .ct-my-stats div:last-child { border-bottom: none; }
body.theme-community .ct-my-stats b {
  font-size: 19px; font-weight: 800;
  background: linear-gradient(90deg, #7c3aed, #d946ef);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
body.theme-community .ct-my-stats span { color: var(--muted); }

/* 中栏：欢迎横幅 */
body.theme-community .ct-banner {
  background: linear-gradient(115deg, #7c3aed 0%, #a855f7 50%, #d946ef 100%);
  border-radius: var(--radius); color: #fff; padding: 24px 26px; margin-bottom: 16px;
  box-shadow: 0 10px 28px rgba(168, 85, 247, 0.3); position: relative; overflow: hidden;
}
body.theme-community .ct-banner::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 65%); border-radius: 50%;
}
body.theme-community .ct-banner h2 { font-size: 21px; margin-bottom: 6px; }
body.theme-community .ct-banner p { font-size: 13px; opacity: .92; }

/* 发布器 */
body.theme-community .ct-composer {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
body.theme-community .ct-composer-head { display: flex; gap: 12px; align-items: center; }
body.theme-community .ct-composer-head input {
  flex: 1; border: none; background: var(--bg); border-radius: 999px;
  padding: 11px 18px; font-size: 14px; color: var(--ink);
}
body.theme-community .ct-composer-head input:focus { outline: 2px solid #d8b4fe; }
body.theme-community .ct-me-ava { width: 40px; height: 40px; font-size: 15px; flex-shrink: 0; }
body.theme-community .ct-composer-foot {
  display: flex; justify-content: space-between; align-items: center; margin-top: 11px;
  padding-left: 52px;
}
body.theme-community .ct-tip { color: var(--muted); font-size: 12px; }
body.theme-community .ct-publish-btn {
  border: none; background: linear-gradient(120deg, #7c3aed, #d946ef); color: #fff;
  padding: 8px 22px; border-radius: 999px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.35);
}
body.theme-community .ct-publish-btn:hover { filter: brightness(1.08); }

/* 动态流 */
body.theme-community .ct-feed {
  display: flex; gap: 13px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 13px; box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
body.theme-community .ct-feed:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(124, 58, 237, 0.13); }
body.theme-community .ct-ava-lg { width: 44px; height: 44px; font-size: 16px; flex-shrink: 0; }
body.theme-community .ct-feed-body { flex: 1; min-width: 0; }
body.theme-community .ct-feed-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
body.theme-community .ct-feed-head b { color: var(--ink); font-size: 14.5px; }
body.theme-community .ct-vip {
  font-style: normal; background: linear-gradient(90deg, #7c3aed, #d946ef); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
}
body.theme-community .ct-feed-head time { color: var(--muted); font-size: 12px; margin-left: auto; }
body.theme-community .ct-feed-text { color: #3b3054; font-size: 14.5px; line-height: 1.75; word-break: break-word; }
body.theme-community .ct-feed-imgs { display: grid; gap: 6px; margin-top: 10px; }
body.theme-community .ct-feed-imgs.n1 { grid-template-columns: minmax(0, 380px); }
body.theme-community .ct-feed-imgs.n2 { grid-template-columns: repeat(2, minmax(0, 200px)); }
body.theme-community .ct-feed-imgs.n3 { grid-template-columns: repeat(3, minmax(0, 150px)); }
body.theme-community .ct-feed-imgs img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line);
}
body.theme-community .ct-feed-acts {
  display: flex; gap: 6px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line);
}
body.theme-community .ct-feed-acts button {
  border: none; background: transparent; color: var(--muted); font-size: 13px;
  padding: 5px 14px; border-radius: 999px; cursor: pointer; transition: all .12s;
}
body.theme-community .ct-feed-acts button:hover { background: var(--p-light); color: var(--p-dark); }
body.theme-community .ct-feed-acts button.liked { color: #d946ef; font-weight: 700; }
body.theme-community .feed-comments { background: #faf5ff; border-radius: 12px; }
body.theme-community .ct-empty {
  text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 46px 0; margin-bottom: 13px;
}

/* 右栏：活跃之星 + 话题 */
body.theme-community .ct-right { position: sticky; top: 74px; }
body.theme-community .ct-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
body.theme-community .ct-card h3 {
  font-size: 14px; color: var(--ink); margin-bottom: 11px;
  padding-bottom: 8px; border-bottom: 2px solid var(--p-light);
}
body.theme-community .ct-user { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
body.theme-community .ct-user .p-avatar { width: 34px; height: 34px; font-size: 13px; flex-shrink: 0; }
body.theme-community .ct-user span { flex: 1; min-width: 0; }
body.theme-community .ct-user b { display: block; color: var(--ink); font-size: 13.5px; }
body.theme-community .ct-user em { font-style: normal; color: var(--muted); font-size: 11.5px; }
body.theme-community .ct-medal {
  width: 20px; height: 20px; border-radius: 50%; background: #e9d5ff; color: #6b21a8;
  font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  font-style: normal; flex-shrink: 0;
}
body.theme-community .ct-medal.m1 { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #78350f; }
body.theme-community .ct-medal.m2 { background: linear-gradient(135deg, #94a3b8, #cbd5e1); color: #1e293b; }
body.theme-community .ct-medal.m3 { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; }
body.theme-community .ct-topics a {
  display: flex; align-items: center; gap: 7px; padding: 8px 4px;
  color: #4c1d95; text-decoration: none; font-size: 13.5px; border-bottom: 1px dashed var(--line);
}
body.theme-community .ct-topics a:last-child { border-bottom: none; }
body.theme-community .ct-topics a span { color: #d946ef; font-weight: 800; }
body.theme-community .ct-topics a em { font-style: normal; color: var(--muted); font-size: 11.5px; margin-left: auto; white-space: nowrap; }
body.theme-community .ct-topics a:hover { color: #d946ef; }

/* 频道页搜索条 */
body.theme-community .channel-search { margin-bottom: 14px; }

/* 页脚 */
body.theme-community .ct-footer {
  background: #2e1065; color: #d8b4fe; padding: 20px 0; font-size: 13px;
}
body.theme-community .ct-footer .ct-wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
body.theme-community .ct-footer a { color: #e9d5ff; text-decoration: none; margin-left: 14px; }
body.theme-community .ct-footer a:hover { color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  body.theme-community .ct-cols { grid-template-columns: 1fr; }
  body.theme-community .ct-left, body.theme-community .ct-right { position: static; }
  body.theme-community .ct-icons { display: flex; overflow-x: auto; }
  body.theme-community .ct-icons a { white-space: nowrap; }
  body.theme-community .ct-nav { display: none; }
}
@media (max-width: 640px) {
  body.theme-community .ct-search { display: none; }
  body.theme-community .ct-feed-imgs.n2, body.theme-community .ct-feed-imgs.n3 { grid-template-columns: repeat(2, 1fr); }
}
