:root {
  --primary: #0088cc;
  --primary-hover: #0077b3;
  --text: #111;
  --text-2: #555;
  --text-3: #999;
  --line: #eee;
  --bg: #f5f5f5;
  --card: #fff;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --container: 1200px;
  --header-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; border: 0; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid #ececec;
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  color: var(--primary) !important;
}
.logo:hover { color: var(--primary) !important; }
.logo-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}
.logo-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.logo-text b {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.logo-text em {
  font-style: normal;
  font-size: 15px;
  font-weight: 700;
}
.nav-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-main::-webkit-scrollbar { display: none; }
.nav-main a {
  flex: 0 0 auto;
  padding: 8px 9px;
  color: #333;
  font-size: 15px;
  border-radius: 4px;
  white-space: nowrap;
}
.nav-main a:hover,
.nav-main a.active { color: var(--primary); }
.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #666;
  font-size: 13px;
}
.theme-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #666;
}
.theme-toggle:hover { background: #f3f3f3; color: var(--primary); }
.auth-links { display: flex; align-items: center; gap: 6px; color: #666; }
.auth-links a:hover { color: var(--primary); }
.auth-links .sep { color: #ddd; }
.btn-publish {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff !important;
  font-size: 13px;
}
.btn-publish:hover { background: var(--primary-hover); color: #fff !important; }
.btn-publish svg { width: 14px; height: 14px; }

/* Breadcrumb */
.breadcrumb {
  padding: 14px 0 10px;
  color: var(--text-3);
  font-size: 13px;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; color: #ccc; }

/* Layout */
.page-body { padding-bottom: 48px; }
.layout-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 16px 18px; }

/* Home hero */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) 220px minmax(260px, 300px);
  gap: 16px;
  margin: 16px 0 20px;
  align-items: stretch;
  grid-template-rows: 340px;
}
.hero-carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  height: 100%;
  min-height: 0;
}
.hero-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.hero-slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  color: inherit;
}
.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  image-rendering: auto;
}
.hero-slide .cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 56px 18px 18px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.42);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 0;
  padding: 0 0 3px;
}
.hero-nav:hover { background: rgba(0,136,204,.9); }
.hero-prev { left: 12px; }
.hero-next { right: 12px; }
.hero-dots {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 6px;
  z-index: 3;
}
.hero-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  padding: 0;
  border: 0;
  background: rgba(255,255,255,.45);
  cursor: pointer;
}
.hero-dots button.on { background: #fff; }
.hero-banners {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero-banner {
  flex: 1;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 132px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
}
.hero-banner.b1 {
  background: linear-gradient(135deg, #1e88e5 0%, #0d47a1 100%);
}
.hero-banner.b2 {
  background: linear-gradient(135deg, #263238 0%, #111 70%);
}
.hero-banner .tag {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 11px;
  opacity: .85;
}
.hero-banner strong { font-size: 18px; line-height: 1.3; }
.hero-banner span { font-size: 12px; opacity: .8; margin-top: 4px; }

/* Rank widget */
.rank-card {
  padding: 8px 14px 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.rank-list {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.rank-tabs {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.rank-tabs button {
  padding: 10px 2px 12px;
  color: #666;
  font-size: 15px;
  position: relative;
}
.rank-tabs button.active { color: var(--primary); font-weight: 600; }
.rank-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.rank-list li { padding: 7px 0; }
.rank-list li + li { border-top: 1px solid #f3f3f3; }
.rank-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.rank-item .thumb {
  width: 64px; height: 48px;
  border-radius: 4px;
  overflow: hidden;
  background: #eaeaea;
}
.rank-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-item .t {
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rank-item .time { margin-top: 4px; color: var(--text-3); font-size: 12px; }

/* Feed */
.feed-card { padding: 0 18px; }
.feed-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.feed-tabs::-webkit-scrollbar { display: none; }
.feed-tabs a {
  flex: 0 0 auto;
  padding: 14px 12px;
  color: #555;
  font-size: 15px;
  position: relative;
}
.feed-tabs a.active { color: var(--primary); font-weight: 600; }
.feed-tabs a.active::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 0;
  height: 2px;
  background: var(--primary);
}
.article-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
}
.article-row:last-child { border-bottom: 0; }
.article-thumb {
  position: relative;
  width: 220px;
  height: 146px;
  border-radius: 6px;
  overflow: hidden;
  background: #e8e8e8;
}
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-tag {
  position: absolute;
  top: 8px; left: 8px;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 12px;
}
.article-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 2px 0;
}
.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: #111;
}
.article-body h3:hover { color: var(--primary); }
.article-body .excerpt {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-meta {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 13px;
}
.article-meta .avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
}
.article-meta .author { color: #666; }
.article-meta .dot::before { content: "·"; margin: 0 2px; color: #ccc; }

/* List page */
.list-title {
  padding: 18px 18px 8px;
  font-size: 26px;
  font-weight: 700;
}
.list-card .article-row { padding: 18px; border-bottom: 1px solid #f0f0f0; }
.list-card .article-row:last-child { border-bottom: 0; }

.side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 16px 10px;
}
.side-title::before {
  content: "";
  width: 3px; height: 14px;
  border-radius: 2px;
  background: var(--primary);
}

.hot-top {
  position: relative;
  margin: 0 12px 12px;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #222;
}
.hot-top img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.hot-top .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 30%, rgba(0,0,0,.78));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
  color: #fff;
}
.hot-top .badge {
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 3px;
  background: #ff5a7a;
  font-size: 11px;
  font-weight: 700;
}
.hot-top .ht { font-size: 15px; font-weight: 600; line-height: 1.4; }


.hot-list { padding: 4px 12px 12px; }
.hot-list li { padding: 10px 0; border-top: 1px solid #f3f3f3; }
.hot-row {
  display: grid;
  grid-template-columns: auto 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.hot-row .rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.hot-row .rank.r2 { color: #ff7a45; }
.hot-row .rank.r3 { color: #faad14; }
.hot-row .thumb {
  width: 56px; height: 42px;
  border-radius: 4px;
  overflow: hidden;
  background: #eee;
}
.hot-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.hot-row .t {
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-row .views {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Detail */
.detail-main { padding: 22px 28px 28px; }
.detail-main h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 14px;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 22px;
}
.detail-meta .author { color: var(--primary); }
.detail-meta .cat {
  padding: 1px 8px;
  border-radius: 3px;
  background: #f0f7fb;
  color: var(--primary);
}
.detail-content {
  font-size: 16px;
  line-height: 1.9;
  color: #222;
}
.detail-content p { margin-bottom: 18px; }
.detail-content figure {
  margin: 22px 0;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f3f3;
}
.detail-content figure img {
  width: 100%;
  height: auto;
  background: transparent;
}
.detail-content figcaption {
  padding: 8px 10px;
  background: #fafafa;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}

.author-bar {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.author-bar .who {
  display: flex;
  align-items: center;
  gap: 10px;
}
.author-bar .who img {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #ddd;
}
.author-bar .who .name { font-weight: 600; }
.author-bar .who .badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  background: #e8f5ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 500;
}
.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #888;
  font-size: 13px;
}
.action-row .act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.action-row .act:hover { color: var(--primary); }
.share-icons { display: flex; gap: 8px; margin-left: 6px; }
.share-icons span {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #f2f2f2;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #666;
}

.author-card { overflow: hidden; margin-bottom: 16px; }
.author-cover {
  height: 90px;
  background: center/cover no-repeat url("https://picsum.photos/seed/beachms/600/200");
}
.author-card .body { padding: 0 16px 16px; text-align: center; margin-top: -28px; }
.author-card .av {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 3px solid #fff;
  margin: 0 auto 8px;
  background: #eee;
  object-fit: cover;
}
.author-card .name {
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.author-card .name .v {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  display: grid;
  place-items: center;
}
.author-card .bio {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
}
.author-stats {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 14px 0;
  color: #666;
  font-size: 12px;
}
.author-stats strong {
  display: block;
  font-size: 16px;
  color: #111;
  margin-bottom: 2px;
}
.author-btns {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
}
.btn-follow {
  height: 36px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
}
.btn-follow:hover { background: var(--primary-hover); color: #fff; }
.btn-msg {
  height: 36px;
  border-radius: 4px;
  border: 1px solid #dce8f0;
  color: var(--primary);
  display: grid;
  place-items: center;
}
.recent-card { padding-bottom: 8px; }
.recent-list { padding: 0 16px 12px; }
.recent-list li { padding: 10px 0; border-top: 1px solid #f3f3f3; }
.recent-list a {
  display: flex;
  gap: 8px;
  color: #333;
  font-size: 14px;
  line-height: 1.5;
}
.recent-list a::before {
  content: "›";
  color: #bbb;
  flex: 0 0 auto;
}
.recent-list a:hover { color: var(--primary); }

/* Footer (no contact) */
.site-footer {
  background: #fff;
  border-top: 1px solid #ececec;
  padding: 22px 0;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}
.site-footer .links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
}
.site-footer .links a { color: #666; }
.site-footer .links a:hover { color: var(--primary); }

/* Dark toggle (light-only preview default) */
body.dark {
  --bg: #121212;
  --card: #1e1e1e;
  --text: #eaeaea;
  --text-2: #aaa;
  --text-3: #777;
  --line: #2a2a2a;
}
body.dark .site-header,
body.dark .site-footer { background: #1a1a1a; border-color: #2a2a2a; }
body.dark .nav-main a { color: #ddd; }
body.dark .article-body h3 { color: #f0f0f0; }
body.dark .detail-content { color: #ddd; }

@media (max-width: 1100px) {
  .home-hero {
    grid-template-columns: 1fr 260px;
    grid-template-rows: 280px;
  }
  .hero-banners { display: none; }
  .layout-2col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .home-hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .hero-slide { aspect-ratio: 16 / 9; height: auto; }
  .rank-card { height: auto; max-height: none; }
  .article-row { grid-template-columns: 120px 1fr; gap: 12px; }
  .article-thumb { width: 120px; height: 90px; }
  .article-body h3 { font-size: 16px; }
  .article-body .excerpt { display: none; }
  .nav-main { display: none; }
  .detail-main { padding: 16px; }
  .detail-main h1 { font-size: 22px; }
}

/* PHP site extras */
.search-mini {
  display: flex;
  align-items: center;
  height: 32px;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  transition: border-color .15s ease;
}
.search-mini:focus-within { border-color: var(--primary); }
.search-mini input {
  width: 140px;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0 4px 0 10px;
  font-size: 13px;
  outline: none;
  background: transparent;
  min-width: 0;
}
.search-mini-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: #999;
  cursor: pointer;
  transition: color .15s ease;
}
.search-mini-btn:hover { color: var(--primary); }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.breadcrumb li:not(:last-child)::after {
  content: ">";
  margin: 0 6px;
  color: #ccc;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb [aria-current="page"] span { color: #666; }
.empty-tip { padding: 28px 18px; color: var(--text-3); }
.pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 18px 18px 24px;
  margin-top: 4px;
  border-top: 1px solid #f0f0f0;
}
.pagination a,
.pagination span.ellipsis,
.pagination span.page-nav {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid #e8e8e8;
  background: #fff;
  color: #555;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
}
.pagination span.ellipsis {
  border: 0;
  background: transparent;
  color: #999;
  min-width: 20px;
  padding: 0 2px;
  pointer-events: none;
}
.pagination a.page-nav,
.pagination span.page-nav {
  min-width: auto;
}
.pagination span.page-nav.disabled {
  color: #bbb;
  background: #f7f7f7;
  border-color: #eee;
  cursor: default;
}
.pagination a.thisclass,
.pagination a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.detail-content img { border-radius: 6px; margin: 12px 0; }
.hot-list { padding: 4px 12px 12px; }
/* carousel fix */
.hero-carousel { position: relative; z-index: 1; }
.hero-slide { z-index: 0 !important; pointer-events: none !important; }
.hero-slide.is-active { z-index: 1 !important; pointer-events: auto !important; }
.hero-nav, .hero-dots { z-index: 6 !important; pointer-events: auto !important; }
.hero-nav {
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,.55);
  font-size: 28px;
}