:root {
  --bg-body: #050716;
  --bg-elevated: #0b0f25;
  --bg-elevated-soft: #101633;
  --border-soft: rgba(255, 255, 255, 0.06);
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, 0.16);
  --accent-gradient: linear-gradient(135deg, #4f8cff, #7c5cff);
  --text-main: #ffffff;
  --text-muted: #a2a8c6;
  --text-soft: #6a7193;
  --danger: #ff4b6a;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.55);
  --shadow-subtle: 0 10px 30px rgba(0, 0, 0, 0.35);
}

body.theme-light {
  --bg-body: #f3f4f8;
  --bg-elevated: #ffffff;
  --bg-elevated-soft: #f4f5fb;
  --border-soft: rgba(15, 23, 42, 0.08);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-gradient: linear-gradient(135deg, #2563eb, #4f46e5);
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-soft: #6b7280;
  --danger: #e11d48;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #141b3f 0, #050716 48%, #02030a 100%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body.theme-light {
  background: radial-gradient(circle at top, #e5edff 0, #f3f4f8 40%, #e5e7eb 100%);
}

body {
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: radial-gradient(circle at top, #101633 0, #050716 55%) rgba(5, 7, 22, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

body.theme-light .site-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background-image: var(--accent-gradient);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 30px rgba(79, 140, 255, 0.65);
  font-size: 14px;
  font-weight: 700;
}

.logo.small .logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  font-size: 12px;
}

.logo-text {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  position: relative;
  padding: 6px 10px;
  font-size: 14px;
  color: var(--text-soft);
  text-decoration: none;
  border-radius: 99px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary,
.btn-outline {
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}

.btn-primary {
  background-image: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-subtle);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.theme-light .btn-outline {
  border-color: rgba(15, 23, 42, 0.16);
}

body.theme-light .btn-outline:hover {
  background: rgba(15, 23, 42, 0.04);
}

.btn-outline.small {
  padding: 6px 12px;
  font-size: 12px;
}

/* Hero */
.hero {
  padding: 32px 0 20px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.6fr 1.1fr;
  gap: 32px;
  align-items: center;
}

.hero-text h1 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.2;
}

.hero-text p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.hero-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: radial-gradient(circle at top left, #141b3f 0, #050716 65%);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.theme-light .hero-search {
  background: linear-gradient(135deg, #e5edff, #f9fafb);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 7, 22, 0.8);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

body.theme-light .search-box input {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.5);
}

.search-box input::placeholder {
  color: var(--text-soft);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 140, 255, 0.5);
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 11px;
}

body.theme-light .tag {
  background: rgba(37, 99, 235, 0.06);
}

.hero-stats {
  display: grid;
  gap: 12px;
}

.stat-card {
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: var(--bg-elevated-soft);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-subtle);
}

.stat-number {
  font-size: 20px;
  font-weight: 600;
}

.stat-label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-soft);
}

/* Layout */
.content {
  padding-bottom: 40px;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-block {
  padding: 14px 14px 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-subtle);
}

.sidebar-title {
  margin: 0 0 10px;
  font-size: 14px;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.sidebar-toggle {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--text-soft);
  cursor: pointer;
}

.sidebar-toggle:hover {
  color: var(--text-main);
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-btn {
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.category-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-text {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Main list */
.main-list {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.list-header h2 {
  margin: 0;
  font-size: 18px;
}

.sort-select {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #050716;
  color: var(--text-main);
  font-size: 12px;
  outline: none;
}

body.theme-light .sort-select {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.6);
}

.sort-select:focus {
  border-color: var(--accent);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.app-card {
  position: relative;
  padding: 12px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at top left, #151c42 0, #050716 60%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    border-color 0.12s ease;
}

body.theme-light .app-card {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(79, 140, 255, 0.7);
}

.app-header {
  display: flex;
  gap: 10px;
}

.app-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  flex-shrink: 0;
  border-radius: 14px;
  background: radial-gradient(circle at top, #ffffff 0, #d3d7f2 40%, #7c5cff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #1c1144;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.26),
    0 16px 30px rgba(0, 0, 0, 0.9);
}

.app-icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  display: block;
}

.app-meta {
  min-width: 0;
}

.app-title {
  margin: 0;
  font-size: 14px;
}

.app-category {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 2px;
}

.app-body {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-soft);
}

.badge.highlight {
  background: var(--accent-soft);
  color: var(--accent);
}

.download-btn {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  background-image: var(--accent-gradient);
  border: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
}

body.theme-light .download-btn {
  background-image: none;
  background-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.download-btn span {
  font-size: 12px;
}

.download-btn:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

body.theme-light .download-btn:hover {
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
}

.rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-soft);
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star {
  width: 14px;
  height: 14px;
  display: inline-block;
  position: relative;
}

.star::before {
  content: "★";
  position: absolute;
  inset: 0;
  font-size: 14px;
  line-height: 14px;
  color: #e5e7eb; /* empty star */
}

.star--full::before {
  color: #facc15; /* full star */
}

.star--half::before {
  background: linear-gradient(to right, #facc15 0 50%, #e5e7eb 50% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.empty-state {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--text-muted);
}

/* Ad containers */
.ad-slot {
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-soft);
  font-size: 11px;
  padding: 10px;
  text-align: center;
  margin: 10px 0;
}

.ad-slot.inline {
  margin: 8px 0;
}

.ad-slot span {
  opacity: 0.9;
}

body.theme-light .ad-slot {
  border-color: rgba(148, 163, 184, 0.7);
  background: rgba(249, 250, 251, 0.9);
}

.detail-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
}

.detail-link:hover {
  text-decoration: underline;
}

/* Detail page */
.detail-page {
  padding-bottom: 40px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text-main);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) 260px;
  gap: 20px;
  align-items: flex-start;
}

.detail-main {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-header {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.detail-icon {
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  flex-shrink: 0;
  border-radius: 20px;
  background: radial-gradient(circle at top, #ffffff 0, #d3d7f2 40%, #7c5cff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #1c1144;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3),
    0 18px 38px rgba(0, 0, 0, 0.95);
}

.detail-icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  display: block;
}

.detail-header-text h1 {
  margin: 2px 0 4px;
  font-size: 22px;
}

.detail-meta {
  display: flex;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
}

.detail-rating-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
}

.detail-rating-sub {
  font-size: 12px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.store-links {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 26px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 32px;
  border-radius: 999px;
  font-size: 18px;
  text-decoration: none;
  border: none;
  color: #ffffff;
  background: #10b981;
  transition: background 0.12s ease, border-color 0.12s ease,
    transform 0.12s ease, box-shadow 0.12s ease;
  width: 100%;
}

.store-btn span {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.store-btn::before {
  content: "";
  width: 26px;
  height: 26px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.store-btn:hover {
  background: #0f9f73;
  transform: translateY(-1px);
  box-shadow: var(--shadow-subtle);
}

.store-btn--google {
  background: #01875f;
}

.store-btn--google::before {
  background-image: url("https://www.gstatic.com/android/market_images/web/favicon_v3.ico");
}

.store-btn--apple {
  background: #303030;
}

.store-btn--apple::before {
  background-image: url("https://www.apple.com/favicon.ico");
}

.store-btn--apk {
  background: linear-gradient(135deg, #ff8a33 0%, #e65100 100%);
  box-shadow: 0 4px 20px rgba(230, 81, 0, 0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  position: relative;
  animation: apk-btn-glow 2.5s ease-in-out infinite;
}

.store-btn--apk::before {
  content: "";
  width: 24px;
  height: 24px;
  background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
}

@keyframes apk-btn-glow {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(230, 81, 0, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 8px 32px rgba(230, 81, 0, 0.6);
    transform: scale(1.06);
  }
}

.store-btn--apk:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(230, 81, 0, 0.5);
  background: linear-gradient(135deg, #ff9a4d 0%, #ff6d00 100%);
  animation: none;
}

.store-btn--apk:active {
  transform: translateY(-2px) scale(1);
  box-shadow: 0 4px 16px rgba(230, 81, 0, 0.45);
}

body.theme-light .store-btn--apk {
  box-shadow: 0 4px 20px rgba(230, 81, 0, 0.4);
}

body.theme-light .store-btn--apk:hover {
  box-shadow: 0 12px 30px rgba(230, 81, 0, 0.45);
}

body.theme-light .store-btn--apk:active {
  box-shadow: 0 4px 14px rgba(230, 81, 0, 0.35);
}

body.theme-light .store-btn--google:hover {
  background: #027a56;
}

body.theme-light .store-btn--apple:hover {
  background: #111827;
}

.detail-section {
  margin-top: 10px;
}

.detail-section h2 {
  margin: 0 0 6px;
  font-size: 15px;
}

.detail-section p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.detail-list {
  margin: 0;
  padding-left: 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.detail-gallery-section {
  margin-top: 16px;
}

/* Swiper gallery: full image, no letterboxing */
.detail-gallery.swiper {
  margin-top: 8px;
  height: 300px;
  overflow: hidden;
}

.detail-gallery .swiper-wrapper {
  align-items: stretch;
}

.detail-gallery .swiper-slide {
  width: auto;
  height: 100%;
  flex-shrink: 0;
}

.detail-gallery .detail-gallery-img,
.detail-gallery .swiper-slide img {
  height: 100%;
  width: auto;
  max-width: none;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  display: block;
}

.detail-note {
  font-size: 12px;
  color: var(--text-soft);
}

.recommended-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recommended-list .app-card {
  padding: 10px;
}

.recommended-list .app-title {
  font-size: 13px;
}

.recommended-list .app-body {
  font-size: 12px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.recommended-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.recommended-grid .app-card {
  cursor: pointer;
}

.recommended-grid .app-title {
  font-size: 13px;
}

.recommended-grid .app-body {
  font-size: 12px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

/* News list (topics page) */
.news-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 720px) {
  .news-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.news-item {
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-elevated-soft);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.news-item:hover {
  box-shadow: var(--shadow-soft);
  border-color: rgba(79, 140, 255, 0.25);
}

.news-item-image-wrap {
  display: block;
  overflow: hidden;
  line-height: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
}

.news-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.news-item-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
}

.news-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(79, 140, 255, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
}

.news-date {
  font-size: 12px;
}

.news-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

.news-title-link {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.15s ease;
}

.news-title-link:hover {
  color: var(--accent);
}

.news-summary {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item .detail-link {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
}

/* News detail page */
.news-detail-main {
  margin: 20px auto 0;
  padding: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  max-width: 1200px;
  overflow: hidden;
}

.news-detail-image-wrap {
  overflow: hidden;
  background: var(--bg-elevated-soft);
  width: 100%;
  aspect-ratio: 16 / 9;
}

.news-detail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.news-detail-header {
  padding: 24px 24px 0;
}

.news-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.news-detail-title {
  margin: 0 0 20px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.news-detail-body {
  padding: 0 24px 24px;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.8;
}

.news-detail-body p {
  margin: 0 0 1em;
}

.news-detail-body p:last-child {
  margin-bottom: 0;
}

.news-detail-body h2 {
  margin: 18px 0 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.news-detail-body h2:first-child {
  margin-top: 0;
}

.news-detail-actions {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.15);
}

body.theme-light .news-detail-actions {
  background: rgba(15, 23, 42, 0.04);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
}

.page-btn {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-soft);
  cursor: pointer;
}

.page-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-soft);
}

.page-info {
  margin-left: auto;
  color: var(--text-soft);
}

/* Ad containers */
.ad-slot {
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-soft);
  font-size: 11px;
  padding: 10px;
  text-align: center;
  margin: 10px 0;
}

.ad-slot.inline {
  margin: 8px 0;
}

.ad-slot span {
  opacity: 0.9;
}

/* Extra info section on home */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.info-card {
  padding: 14px 14px 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-subtle);
}

.info-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.info-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 18px 0 22px;
  background: radial-gradient(circle at bottom, #101633 0, #050716 60%);
}

body.theme-light .site-footer {
  border-top-color: rgba(15, 23, 42, 0.06);
  background: #f9fafb;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-text {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-soft);
  max-width: 420px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text-main);
}

.disclaimer-section {
  padding: 0 0 18px;
}

.disclaimer-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-subtle);
}

.disclaimer-title {
  margin: 0;
  font-size: 15px;
  color: var(--text-main);
}

.disclaimer-subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.6;
}

.disclaimer-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
}

.disclaimer-list li + li {
  margin-top: 6px;
}

@media (min-width: 960px) {
  .disclaimer-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
    align-items: start;
  }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    flex-direction: row;
    overflow-x: auto;
  }

  .sidebar-block {
    min-width: 220px;
  }

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

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

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .main-nav {
    display: none;
  }

  .detail-gallery.swiper {
    min-height: 220px;
  }

  .hero {
    padding-top: 22px;
  }

  .hero-text h1 {
    font-size: 24px;
  }

  .hero-search {
    padding: 10px;
  }

  .app-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .recommended-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .store-btn {
    justify-content: center;
  }
}


