/* ── KLAS Forum Styles ── */

/* ══════════════════════════════════════
   KLAS Header — 2026 Edition
   ══════════════════════════════════════ */
.klas-header {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid rgba(228,230,234,0.7);
  height: 60px;
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: top 0.32s cubic-bezier(0.4,0,0.2,1),
              opacity 0.32s cubic-bezier(0.4,0,0.2,1),
              background 0.2s;
  will-change: top, opacity;
  contain: layout;
}
.klas-header.header--hidden {
  top: -70px;
  opacity: 0;
  pointer-events: none;
}
/* Push content below fixed header */
body.klas-has-header { padding-top: 60px !important; }
/* WordPress admin bar offset */
body.admin-bar .klas-header { top: 32px; }
body.admin-bar .klas-header.header--hidden { top: calc(-70px + 32px); }
body.admin-bar.klas-has-header { padding-top: 60px !important; }
@media (max-width: 782px) {
  body.admin-bar .klas-header { top: 46px; }
  body.admin-bar .klas-header.header--hidden { top: calc(-70px + 46px); }
  body.admin-bar.klas-has-header { padding-top: 60px !important; }
}
[data-theme="dark"] .klas-header {
  background: rgba(26,29,36,0.88);
  border-bottom-color: rgba(42,45,53,0.7);
}

.header-inner {
  display: flex;
  align-items: center;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

/* Logo */
.header-logo {
  display: flex; align-items: center;
  text-decoration: none; flex-shrink: 0;
  margin-right: auto;
}
.header-logo svg {
  height: 15px; width: auto; display: block;
  color: var(--text-1);
  transition: opacity 0.15s;
}
.header-logo:hover svg { opacity: 0.7; }

/* Nav — editorial, no pill backgrounds */
.header-nav {
  display: flex; align-items: center; gap: 0;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-link {
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.025em;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
  position: relative;
}
.nav-link:hover { color: var(--text-1); }
.nav-link.active {
  color: var(--text-1);
  font-weight: 600;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 13px; right: 13px;
  height: 2px;
  background: var(--text-1);
  border-radius: 1px;
}

/* Right controls */
.header-right {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto; flex-shrink: 0;
}

/* Icon buttons — cart AND dark mode, identical */
/* !important needed to override Astra's dynamic button CSS */
.header-icon-btn {
  width: 32px !important; height: 32px !important;
  border: none !important; background: none !important;
  background-color: transparent !important;
  outline: none !important;
  color: var(--text-3) !important;
  display: flex !important; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: color 0.15s;
  padding: 0 !important; text-decoration: none;
  position: relative; border-radius: 6px !important;
  -webkit-appearance: none; appearance: none;
  box-shadow: none !important;
  min-width: unset !important; min-height: unset !important;
  font-size: unset !important; font-weight: unset !important;
  letter-spacing: unset !important; text-transform: unset !important;
}
.header-icon-btn:hover { color: var(--text-1) !important; background: none !important; background-color: transparent !important; }
.header-icon-btn svg,
.header-icon-btn i { pointer-events: none; }
.header-icon-btn svg { width: 17px !important; height: 17px !important; }
.header-icon-btn i { font-size: 17px !important; line-height: 1; }

/* Cart badge */
.cart-count {
  position: absolute; top: 1px; right: 1px;
  min-width: 13px; height: 13px;
  background: var(--blue); color: #fff;
  font-size: 8px; font-weight: 700;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 2px; line-height: 1;
  box-sizing: border-box;
}

/* Tier badge */
.header-badge {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--blue-light); color: var(--blue);
  white-space: nowrap;
}

/* Avatar */
.header-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue); color: #fff !important;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; cursor: pointer;
  flex-shrink: 0; text-decoration: none !important;
  transition: opacity 0.15s;
  margin-left: 6px;
}
.header-avatar:hover { opacity: 0.85; }

/* Login button */
.header-login-btn {
  font-size: 12.5px; font-weight: 500;
  color: var(--text-1) !important; text-decoration: none !important;
  padding: 5px 13px; border-radius: 7px;
  border: 0.5px solid var(--border); background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.header-login-btn:hover { border-color: var(--text-3); background: var(--bg); }

/* ── Footer ── */
.klas-footer { background: var(--surface); border-top: none; padding: 0 0 28px; margin-top: 0; }
.footer-inner { max-width: 1160px; margin: 0 auto 40px; padding: 0 40px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; border-top: 0.5px solid var(--border); padding-top: 48px; box-sizing: border-box; }
.footer-logo { display: flex; align-items: center; margin-bottom: 12px; }
.footer-logo svg { height: 16px; width: auto; display: block; color: var(--text-1); }
.footer-tagline { font-size: 13px; color: var(--text-2); line-height: 1.55; max-width: 220px; margin-bottom: 16px; }
.footer-social { display: flex; gap: 8px; }
.social-btn { width: 28px; height: 28px; border: none; background: none; display: flex; align-items: center; justify-content: center; color: var(--text-3) !important; text-decoration: none !important; transition: color .15s; padding: 0; }
.social-btn:hover { color: var(--text-1) !important; }
.social-btn i { font-size: 18px; }
.footer-col-title { font-size: 12px; font-weight: 700; color: var(--text-1); margin-bottom: 12px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-link { font-size: 13px; color: var(--text-2) !important; text-decoration: none !important; transition: color .15s; }
.footer-link:hover { color: var(--blue) !important; }
.footer-bottom { max-width: 1160px; margin: 0 auto; padding: 20px 40px 0; border-top: 0.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; box-sizing: border-box; }
.footer-copy { font-size: 12px; color: var(--text-3); }
.footer-legal { display: flex; gap: 16px; }
.footer-legal a { font-size: 12px; color: var(--text-3) !important; text-decoration: none !important; }
.footer-legal a:hover { color: var(--text-2) !important; }

/* ── Hide Hostinger / third-party injected UI elements ── */
#bottomBar,
#hostinger-reach-widget,
.hostinger-reach-widget,
#ast-scroll-top { display: none !important; }

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .header-nav .nav-link { display: none; }
  .header-nav .nav-link.active { display: flex; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; }
}
:root {
  --blue:       #0057FF;
  --blue-light: #EEF3FF;
  --blue-dark:  #0A2D6E;
  --blue-soft:  #60B3FF;
  --text-1:     #111318;
  --text-2:     #5A6070;
  --text-3:     #9DA3AE;
  --border:     #E4E6EA;
  --surface:    #FFFFFF;
  --bg:         #F3F4F6;
  --beige:      #F4F1EC;
  --r: 14px; --r-sm: 8px; --r-pill: 999px;
  --shadow-hover: 0 4px 20px rgba(0,87,255,.08), 0 1px 4px rgba(0,0,0,.05);
  --sidebar-w: 220px;
}

[data-theme="dark"] {
  --text-1: #F0F1F3; --text-2: #9DA3AE; --text-3: #9DA3AE;
  --border: #2A2D35; --surface: #1A1D24; --bg: #111318; --beige: #1A1C16;
  --blue: #60B3FF;
  --blue-light: rgba(96,179,255,0.12);
  --blue-dark: #93C8FF;
}

/* ── Global body font (covers all pages using header.php / footer.php) ── */
body {
  font-family: 'Inter', 'PingFang TC', 'Microsoft JhengHei', -apple-system, BlinkMacSystemFont, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

/* ── Forum page body ── */
.klas-forum-page {
  background: var(--bg);
  min-height: 100vh;
  font-family: inherit;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
.klas-forum-page > *:last-child {
  margin-bottom: 0 !important;
}

/* ── Hide Astra/bbPress default elements ── */
.bbp-forum-title,
.bbp-forum-content,
.entry-header .entry-title,
.ast-single-post-order .entry-header,
h1.bbp-forum-title,
.bbp-breadcrumb,
.forum-description,
.entry-header { display: none !important; }

/* ── Hide Astra original header (replaced by KLAS header) ── */
.site-header,
.ast-site-header-wrap,
#masthead { display: none !important; }

/* ── Hide bbPress next/prev forum navigation ── */
.bbp-forum-pagination,
.bbp-forum-pagination-count,
.forum-nav-links,
div.bbp-template-notice.info { display: none !important; }

/* ── Hide Astra post navigation (NEXT/PREV) ── */
nav.navigation.post-navigation,
.post-navigation {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
}

/* ── Remove Astra container padding on bbPress only ── */
.bbpress .ast-container,
.bbpress .site-content .ast-container,
.bbpress #content .ast-container { max-width: 100% !important; padding: 0 !important; }

.bbpress .entry-content { padding: 0 !important; margin: 0 !important; }
.bbpress .ast-article-single { padding: 0 !important; }

/* ── Remove Astra #primary padding on bbPress ── */
.bbpress .ast-separate-container #primary,
.forum .ast-separate-container #primary,
.bbpress #primary,
.forum #primary { padding: 0 !important; margin: 0 !important; }

/* ── WooCommerce: restore content padding, align with KLAS header ── */
.woocommerce .ast-container,
.woocommerce-page .ast-container {
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
}

.woocommerce #primary,
.woocommerce-page #primary {
  padding: 32px 0 !important;
}

/* WooCommerce inner container — align with KLAS header (override Astra max-width:none) */
body.woocommerce .ast-woocommerce-container,
body.woocommerce-page .ast-woocommerce-container {
  max-width: 1180px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box !important;
}

/* WooCommerce description + tabs padding */
.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .woocommerce-tabs .panel,
.woocommerce div.product .woocommerce-product-details__short-description,
.woocommerce .entry-summary {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.woocommerce-tabs ul.tabs,
.woocommerce-tabs ul.tabs li { padding-left: 0 !important; }

/* Fix description text not inheriting container padding */
.woocommerce div.product .woocommerce-tabs #tab-description {
  padding: 24px 0 48px !important;
}

/* ── bbPress pagination → KLAS style ── */
.bbp-pagination,
.bbp-pagination-count { display: none; }

/* ── Hide bbPress default text ── */
.bbp-forum-content > p:first-of-type,
.bbp-template-notice,
.bbp-body > p,
p.bbp-forum-content { display: none; }

/* ── Hide "Viewing X topics" ── */
.bbp-pagination-count,
.topic-count-text,
div.bbp-topic-count { display: none; }

/* ── Make tags lowercase ── */
.klas-tag { text-transform: none !important; }

/* ── New topic button fix ── */
.klas-sidebar a.klas-new-post-btn,
.klas-sidebar a.klas-new-post-btn:link,
.klas-sidebar a.klas-new-post-btn:visited,
.klas-sidebar a.klas-new-post-btn:hover,
.klas-sidebar a.klas-new-post-btn:focus,
button.klas-new-post-btn {
  color: #fff !important;
  text-decoration: none !important;
  font-family: 'Inter', sans-serif !important;
}
.klas-sidebar a.klas-new-post-btn i,
button.klas-new-post-btn i { color: #fff !important; }

/* ══════════════════════════════════════
   BENTO 2026 — 新設計
══════════════════════════════════════ */
.kf-bento-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 72px 40px 0;
  box-sizing: border-box;
}
.kf-bento {
  display: grid;
  grid-template-columns: 1fr 1fr 220px;
  grid-template-rows: auto auto;
  gap: 12px;
  margin-bottom: 24px;
}

/* ── Base tile ── */
.kf-tile {
  border-radius: 16px;
  padding: 22px 24px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  will-change: transform;
  contain: layout style;
}
.kf-tile:hover { transform: translateY(-2px); }

/* ── Tile label ── */
.kf-tile-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-2);
  margin-bottom: 14px;
}
.kf-tile-label i { font-size: 13px; }

/* ── Announce tile (col 1, rowspan 2) ── */
.kf-announce {
  grid-column: 1/2; grid-row: 1/3;
  background: linear-gradient(145deg, #0057FF 0%, #1A3FBF 60%, #0A2D6E 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 230px;
  position: relative; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,87,255,.25);
}
.kf-announce-content { position: relative; z-index: 1; }
.kf-announce-footer {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: rgba(255,255,255,.55);
  padding-top: 14px; margin-top: 16px;
  border-top: 0.5px solid rgba(255,255,255,.15);
}
.kf-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.18);
  border: 0.5px solid rgba(255,255,255,.25);
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  padding: 4px 12px; border-radius: 999px;
  color: rgba(255,255,255,.9); margin-bottom: 16px; width: fit-content;
}
.kf-announce-title {
  font-size: 20px; font-weight: 800; color: #fff;
  letter-spacing: -.4px; line-height: 1.3; margin-bottom: 10px;
}
.kf-announce-body {
  font-size: 13.5px; color: rgba(255,255,255,.72);
  line-height: 1.65;
}

/* ── Rules tile (col 2, row 1) ── */
.kf-rules {
  grid-column: 2/3; grid-row: 1/2;
  background: var(--surface);
  border: 0.5px solid var(--border);
}
.kf-rule-list { display: flex; flex-direction: column; gap: 10px; }
.kf-rule-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-2); line-height: 1.5;
}
.kf-rule-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue); flex-shrink: 0; margin-top: 5px;
}

/* ── Online tile (col 3, rowspan 2) ── */
.kf-online {
  grid-column: 3/4; grid-row: 1/3;
  background: #0A0B0F;
  border: 0.5px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.kf-online::before {
  content: '';
  position: absolute;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,87,255,.25) 0%, transparent 70%);
  bottom: -40px; left: -40px;
  pointer-events: none;
}
.kf-label-light { color: rgba(255,255,255,.70) !important; }
.kf-online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #60B3FF;
  box-shadow: 0 0 0 3px rgba(96,179,255,.2);
  display: inline-block; flex-shrink: 0;
  animation: kf-pulse 2s ease-in-out infinite;
}
@keyframes kf-pulse {
  0%,100%{box-shadow:0 0 0 3px rgba(96,179,255,.2)}
  50%{box-shadow:0 0 0 6px rgba(96,179,255,.08)}
}
.kf-online-num {
  font-size: 56px; font-weight: 900; color: #fff;
  letter-spacing: -3px; line-height: 1;
  position: relative; z-index: 1;
}
.kf-online-sub {
  font-size: 12px; color: rgba(255,255,255,.65);
  position: relative; z-index: 1;
  margin-top: 4px;
}

/* ── News tile (col 2, row 2) ── */
.kf-news {
  grid-column: 2/3; grid-row: 2/3;
  background: #F4F1EC;
  border: 0.5px solid rgba(0,0,0,.06);
}
.kf-news-list { display: flex; flex-direction: column; gap: 12px; }
.kf-news-item {
  display: flex; align-items: flex-start; gap: 10px;
}
.kf-news-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3); flex-shrink: 0; margin-top: 5px;
}
.kf-news-dot.active { background: var(--blue); }
.kf-news-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.kf-news-time { font-size: 10px; color: var(--text-3); margin-top: 3px; }

/* ── Upgrade hint (sidebar) ── */
.kf-upgrade-hint {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-3);
  margin-top: 10px; padding: 8px 10px;
  background: var(--bg); border-radius: var(--r-sm);
  border: 0.5px solid var(--border);
}
.kf-upgrade-hint i { font-size: 13px; color: var(--text-3); }

/* ── Main content header ── */
.kf-main {}
.kf-main-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 20px; gap: 12px;
}
.kf-main-title { font-size: 18px; font-weight: 700; color: var(--text-1); letter-spacing: -.3px; }
.kf-main-count { font-size: 12px; color: var(--text-2); margin-top: 3px; }

/* ── Dark mode ── */
[data-theme="dark"] .kf-rules {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .kf-tile-label { color: var(--text-3) !important; }
[data-theme="dark"] .kf-rule-item { color: var(--text-3) !important; }
[data-theme="dark"] .kf-news {
  background: #1E2028 !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .kf-news-text { color: var(--text-3) !important; }
[data-theme="dark"] .kf-online { background: #0A0B0F !important; }
[data-theme="dark"] .kf-announce-body { color: rgba(255,255,255,.72) !important; }
[data-theme="dark"] .kf-main-title { color: #F0F1F3 !important; }
[data-theme="dark"] .kf-upgrade-hint { background: rgba(255,255,255,.04) !important; border-color: var(--border) !important; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .kf-bento-wrap { padding: 20px 20px 0; }
  .kf-bento { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .kf-announce { grid-column: 1/3; grid-row: 1/2; min-height: 180px; }
  .kf-rules   { grid-column: 1/2; grid-row: 2/3; }
  .kf-online  { grid-column: 2/3; grid-row: 2/3; }
  .kf-news    { grid-column: 1/3; grid-row: 3/4; }
}
@media (max-width: 560px) {
  .kf-bento { grid-template-columns: 1fr; }
  .kf-announce,.kf-rules,.kf-online,.kf-news { grid-column: 1/2; grid-row: auto; }
  .kf-online { min-height: 120px; }
}

/* ── Page shell ── */
.klas-page-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  align-items: start;
  gap: 20px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 72px 40px 128px;
  box-sizing: border-box;
  align-items: start;
}

/* ── Sidebar ── */
.klas-sidebar {
  position: sticky;
  top: 80px; /* 60px header + 20px breathing room */
  align-self: start;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r);
  padding: 20px 14px;
}
.klas-sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 0.5px solid var(--border); }
.klas-sidebar-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.klas-sidebar-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.klas-sidebar-tier { font-size: 11px; color: var(--blue); font-weight: 500; margin-top: 1px; }
.klas-sidebar-label { font-size: 10px; font-weight: 600; color: var(--text-3); letter-spacing: .7px; text-transform: uppercase; margin-bottom: 6px; padding: 0 6px; }
.klas-sidebar-section { margin-bottom: 18px; }
.klas-sidebar-btn { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; color: var(--text-1); cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; transition: background .15s; }
.klas-sidebar-btn:hover { background: var(--bg); }
.klas-sidebar-btn.active { background: var(--blue-light); color: var(--blue); }
.klas-new-post-btn { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; padding: 10px; border-radius: var(--r-sm); background: var(--blue); color: #fff; font-size: 13px; font-weight: 600; border: none; cursor: pointer; margin-top: 4px; transition: background .15s; text-decoration: none; }
.klas-new-post-btn:hover { background: #0047D9; color: #fff; }

/* ── Sort bar ── */
.kf-sort-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.kf-sort-label {
  font-size: 12px; color: var(--text-3); white-space: nowrap;
}
.kf-sort-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.kf-sort-chip {
  font-size: 11px; font-weight: 500;
  padding: 4px 11px; border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2);
  text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.kf-sort-chip:hover { background: var(--blue-light); color: var(--blue); border-color: var(--blue); }
.kf-sort-chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Topic cards — fixed 172px, 3-col ── */
.klas-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.klas-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r);
  padding: 14px 14px 12px;
  height: 172px;               /* fixed — matches community.html */
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  transition: box-shadow .2s, border-color .2s;
  will-change: box-shadow;
}
.klas-card:hover { border-color: rgba(0,87,255,.25); box-shadow: var(--shadow-hover); }
.klas-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 9px; min-height: 22px; overflow: hidden;
}
.klas-author-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.klas-avatar { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.av-dark  { background: #0A2D6E; color: #60B3FF; }
.av-mid   { background: #0057FF; color: #fff; }
.av-light { background: #EEF3FF; color: #0057FF; }
.klas-author-name { font-size: 11px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.klas-badge { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); white-space: nowrap; flex-shrink: 0; line-height: 1.6; }
.badge-pro  { color: #3B82F6; border: 1px solid #93C5FD; }
.badge-adv  { color: #0057FF; border: 1px solid #0057FF; }
.badge-free { color: #93B4FF; border: 1px solid #C7D7FF; }
/* Title fills remaining space, 2-line clamp */
.klas-card-title {
  font-size: 13px; font-weight: 700; color: var(--text-1);
  line-height: 1.42; letter-spacing: -.1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; flex: 1;
}
.klas-card-divider { height: 0.5px; background: var(--border); margin: 9px 0 8px; flex-shrink: 0; }
/* Footer row: tag left · meta right */
.klas-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-shrink: 0;
}
.klas-tag { font-size: 10px; font-weight: 500; padding: 1px 7px; border-radius: var(--r-pill); background: var(--bg); color: var(--text-2); border: 0.5px solid var(--border); white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; text-transform: none; }
.klas-meta-item { font-size: 10px; color: var(--text-3); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.klas-meta-item i { font-size: 12px; }
.klas-share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--text-3); line-height: 1; transition: color .15s;
  margin-left: 2px;
}
.klas-share-btn:hover { color: var(--blue); }
.klas-share-btn i { font-size: 12px; }

/* Pagination info — hidden */
.kf-pagi-info { display: none; }
.kf-pagi-btns { display: flex; gap: 4px; }

/* ── Pagination ── */
.klas-pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 0 24px; }
.klas-page-btn { min-width: 20px; height: 20px; width: 20px; padding: 0; border-radius: 5px; border: 1px solid #E4E6EA; background: #F3F4F6; font-size: 10px; font-weight: 500; color: #9DA3AE; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s; text-decoration: none; }
.klas-page-btn:hover:not(.disabled) { background: #E9EAEC; }
.klas-page-btn.current { background: var(--blue); color: #fff; border-color: var(--blue); }
.klas-page-btn.disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.klas-page-btn i { font-size: 10px; color: #9DA3AE; }

/* ── Freebie dialog ── */
.klas-dialog-overlay {
  display: flex;
  visibility: hidden;
  opacity: 0;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 9999;
  align-items: center; justify-content: center;
  transition: opacity .2s ease, visibility .2s ease;
}
.klas-dialog-overlay.open {
  visibility: visible;
  opacity: 1;
}
.klas-dialog-box {
  background: var(--surface); border-radius: 16px; padding: 32px 28px;
  max-width: 400px; width: 90%; text-align: center;
  transform: translateY(12px) scale(.97);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
  will-change: transform;
}
.klas-dialog-overlay.open .klas-dialog-box {
  transform: translateY(0) scale(1);
}
.klas-dialog-icon { font-size: 36px; color: var(--blue); margin-bottom: 12px; }
.klas-dialog-title { font-size: 18px; font-weight: 700; color: var(--text-1); margin-bottom: 8px; }
.klas-dialog-desc { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-bottom: 24px; }
.klas-dialog-upgrade { display: block; width: 100%; box-sizing: border-box; padding: 11px; background: var(--blue); color: #fff; border: none; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 10px; text-decoration: none; text-align: center; }
.klas-dialog-upgrade:hover { background: #0047D9; }
.klas-dialog-cancel { display: block; width: 100%; padding: 10px; background: none; border: 0.5px solid var(--border); border-radius: var(--r-sm); font-size: 14px; color: var(--text-2); cursor: pointer; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .klas-page-shell { grid-template-columns: 1fr; padding: 16px 20px 32px; }
  .klas-sidebar { position: static; }
  .klas-bento { grid-template-columns: 1fr 1fr; }
  .klas-tile-announce { grid-column: 1/3; }
  .klas-tile-notice { grid-column: 1/2; }
  .klas-tile-news { grid-column: 2/3; }
  .klas-tile-online { grid-column: 1/3; min-height: auto; }
  .klas-cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .klas-bento { grid-template-columns: 1fr; }
  .klas-tile-announce, .klas-tile-notice, .klas-tile-news, .klas-tile-online { grid-column: 1/2; }
  .klas-cards-grid { grid-template-columns: 1fr; }
  .klas-card { height: auto; min-height: 148px; }
}
/* ── Dark mode forum overrides ── */
[data-theme="dark"] .klas-tile-news { background: #1E2028 !important; border-color: #2A2D35 !important; }
[data-theme="dark"] .klas-tile-online { background: #1E2028 !important; border: 0.5px solid #3A3F50 !important; }
[data-theme="dark"] .klas-sidebar-btn.active { background: rgba(96,179,255,0.12) !important; color: #60B3FF !important; }
[data-theme="dark"] .news-time { color: #9DA3AE !important; }
[data-theme="dark"] .klas-sidebar-label { color: #9DA3AE !important; }
[data-theme="dark"] .klas-sidebar { background: #1A1D24 !important; border-color: #2A2D35 !important; }
[data-theme="dark"] .klas-card { background: #1A1D24 !important; border-color: #2A2D35 !important; }
[data-theme="dark"] .klas-card:hover { border-color: rgba(96,179,255,0.25) !important; }
[data-theme="dark"] .kf-sort-chip { background: var(--surface) !important; border-color: var(--border) !important; color: var(--text-3) !important; }
[data-theme="dark"] .kf-sort-chip.active { background: var(--blue) !important; color: #fff !important; }
[data-theme="dark"] .klas-tag { background: rgba(255,255,255,.04) !important; border-color: var(--border) !important; }

/* ── Force white text on CTA (override style.css a { color: var(--klas-blue) !important }) ── */
html body .klas-sidebar a.klas-new-post-btn,
html body .klas-sidebar a.klas-new-post-btn:link,
html body .klas-sidebar a.klas-new-post-btn:visited,
html body .klas-sidebar a.klas-new-post-btn:hover,
html body .klas-sidebar a.klas-new-post-btn:focus,
html body button.klas-new-post-btn {
  color: #ffffff !important;
}