* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.5;
}

/* Header */
header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .logo {
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
  color: #1d1d1f;
  letter-spacing: -0.5px;
}

header .logo span {
  color: #2563eb;
}

.header-icon {
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  color: #1d1d1f;
}

.header-icon svg {
  stroke: #1d1d1f;
}

.header-icon:hover {
  opacity: 1;
}

.lang-btn {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.lang-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1d1d1f;
}

.section-header .view-all {
  color: #2563eb;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

/* Featured */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

@media (max-width: 700px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

.featured-card {
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
  overflow: hidden;
}

.featured-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.08;
  z-index: 0;
}

.featured-card:nth-child(1) { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.featured-card:nth-child(2) { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); }
.featured-card:nth-child(3) { background: linear-gradient(135deg, #f3f4f6, #e5e7eb); }
.featured-card:nth-child(4) { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }

.featured-card:hover {
  transform: translateY(-2px);
}

.featured-card > * {
  position: relative;
  z-index: 1;
}

.featured-badge {
  display: inline-block;
  background: rgba(0,0,0,0.06);
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
}

.featured-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1d1d1f;
}

.featured-card .desc {
  font-size: 13px;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #6b7280;
}

.featured-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.featured-stats svg {
  stroke: #6b7280;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #2563eb;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  width: fit-content;
  transition: background 0.2s;
}

.btn-download:hover {
  background: #1d4ed8;
}

/* App grid */
.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 40px;
}

.app-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.app-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.app-card .badge {
  margin-bottom: 8px;
}

.card-body {
  display: flex;
  gap: 14px;
}

.card-icon {
  flex-shrink: 0;
  width: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-img {
  border-radius: 10px;
  object-fit: cover;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.card-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 2px;
}

.card-content .version {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 6px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
}

.card-meta .rating {
  font-size: 12px;
  color: #f59e0b;
}

.card-meta .visits {
  font-size: 12px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-meta .visits svg {
  stroke: #9ca3af;
}

.app-status {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
}

.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-mod {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-premium {
  background: #fef3c7;
  color: #b45309;
}

.badge-full {
  background: #d1fae5;
  color: #047857;
}

.badge-gog {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Detail page */
.detail-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #6b7280;
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 16px;
  transition: color 0.2s;
}

.back-link:hover {
  color: #1d1d1f;
}

.detail-top {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.detail-top .detail-icon {
  flex-shrink: 0;
  display: flex;
}

.detail-meta svg {
  vertical-align: middle;
  stroke: #9ca3af;
}

.detail-top h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 4px;
}

.detail-top .tagline {
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 16px;
}

.detail-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-section {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.detail-section h2 {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 12px;
}

.detail-section p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.7;
}

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.features-list li {
  list-style: none;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
}

.mod-features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mod-features-list li {
  list-style: none;
  padding: 6px 14px;
  background: #dbeafe;
  color: #2563eb;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.loading {
  text-align: center;
  padding: 48px;
  color: #9ca3af;
}

/* Menu panel */
.menu-panel {
  display: none;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 8px 24px;
  gap: 4px;
  flex-direction: column;
}

.menu-panel.open {
  display: flex;
}

.menu-panel a {
  color: #6b7280;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

.menu-panel a:hover {
  background: #f3f4f6;
  color: #1d1d1f;
}

/* Search section */
.search-section {
  display: none;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

.search-section.open {
  display: block;
}

.search-box {
  position: relative;
  max-width: 480px;
}

.search-box input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border-radius: 12px;
  border: none;
  background: #f3f4f6;
  color: #1d1d1f;
  font-size: 16px;
  outline: none;
}

.search-box input::placeholder {
  color: #9ca3af;
}

.search-box-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  display: flex;
}

.search-results {
  margin-top: 12px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.search-result:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.search-result-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.search-result-name {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
}

.search-result-cat {
  font-size: 12px;
  color: #9ca3af;
}

.search-empty {
  color: #9ca3af;
  padding: 16px 0;
  font-size: 14px;
}

/* Settings */
.settings-label {
  font-size: 15px;
  font-weight: 600;
  color: #1d1d1f;
  margin-bottom: 12px;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #d1d5db;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.theme-btn:hover {
  border-color: #2563eb;
}

.theme-icon {
  display: flex;
  color: #6b7280;
}

/* Footer */
footer {
  border-top: 1px solid #e0e0e0;
  padding: 32px 24px;
  text-align: center;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

footer .footer-links a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

footer .footer-links a:hover {
  color: #1d1d1f;
}

footer .copyright {
  color: #9ca3af;
  font-size: 12px;
}

/* Dark mode */
[data-theme="dark"] body {
  background: #0d0d0d;
  color: #e0e0e0;
}

[data-theme="dark"] header {
  background: #111;
  border-color: #1f1f1f;
}

[data-theme="dark"] header .logo {
  color: #fff;
}

[data-theme="dark"] header .logo span {
  color: #60a5fa;
}

[data-theme="dark"] .header-icon {
  color: #e0e0e0;
}

[data-theme="dark"] .header-icon svg {
  stroke: #e0e0e0;
}

[data-theme="dark"] .section-header h2 {
  color: #fff;
}

[data-theme="dark"] .app-card {
  background: #1a1a1a;
  box-shadow: none;
}

[data-theme="dark"] .app-card:hover {
  background: #222;
  box-shadow: none;
}

[data-theme="dark"] .card-content h3 {
  color: #fff;
}

[data-theme="dark"] .card-content .version {
  color: #666;
}

[data-theme="dark"] .card-meta .visits {
  color: #888;
}

[data-theme="dark"] .card-meta .visits svg {
  stroke: #888;
}

[data-theme="dark"] .app-status {
  color: #60a5fa;
}

[data-theme="dark"] .badge-mod {
  background: rgba(59,130,246,0.2);
  color: #60a5fa;
}

[data-theme="dark"] .badge-premium {
  background: rgba(245,158,11,0.2);
  color: #fbbf24;
}

[data-theme="dark"] .badge-full {
  background: rgba(16,185,129,0.2);
  color: #34d399;
}

[data-theme="dark"] .badge-gog {
  background: rgba(59,130,246,0.2);
  color: #60a5fa;
}

[data-theme="dark"] .detail-top {
  background: #1a1a1a;
  box-shadow: none;
}

[data-theme="dark"] .detail-top h1 {
  color: #fff;
}

[data-theme="dark"] .detail-top .tagline {
  color: #888;
}

[data-theme="dark"] .detail-meta {
  color: #888;
}

[data-theme="dark"] .detail-meta svg {
  stroke: #888;
}

[data-theme="dark"] .back-link {
  color: #888;
}

[data-theme="dark"] .back-link:hover {
  color: #fff;
}

[data-theme="dark"] .detail-section {
  background: #1a1a1a;
  box-shadow: none;
}

[data-theme="dark"] .detail-section h2 {
  color: #fff;
}

[data-theme="dark"] .detail-section p {
  color: #aaa;
}

[data-theme="dark"] .features-list li {
  background: #222;
  color: #ccc;
}

[data-theme="dark"] .mod-features-list li {
  background: rgba(96,165,250,0.1);
  color: #60a5fa;
}

[data-theme="dark"] .loading {
  color: #666;
}

[data-theme="dark"] .menu-panel {
  background: #111;
  border-color: #1f1f1f;
}

[data-theme="dark"] .menu-panel a {
  color: #888;
}

[data-theme="dark"] .menu-panel a:hover {
  background: #1a1a1a;
  color: #fff;
}

[data-theme="dark"] .search-section {
  border-color: #1f1f1f;
}

[data-theme="dark"] .search-box input {
  background: #222;
  color: #fff;
}

[data-theme="dark"] .search-box input::placeholder {
  color: #555;
}

[data-theme="dark"] .search-box-icon {
  color: #555;
}

[data-theme="dark"] .search-result {
  background: #1a1a1a;
  box-shadow: none;
}

[data-theme="dark"] .search-result:hover {
  background: #222;
}

[data-theme="dark"] .search-result-name {
  color: #fff;
}

[data-theme="dark"] .search-result-cat {
  color: #888;
}

[data-theme="dark"] .search-empty {
  color: #555;
}

[data-theme="dark"] footer {
  border-color: #1f1f1f;
}

[data-theme="dark"] footer .footer-links a {
  color: #666;
}

[data-theme="dark"] footer .footer-links a:hover {
  color: #fff;
}

[data-theme="dark"] footer .copyright {
  color: #444;
}

[data-theme="dark"] .featured-card:nth-child(1) { background: linear-gradient(135deg, #0f172a, #1e3a5f); }
[data-theme="dark"] .featured-card:nth-child(2) { background: linear-gradient(135deg, #0a1628, #1a2d4a); }
[data-theme="dark"] .featured-card:nth-child(3) { background: linear-gradient(135deg, #111827, #1f2937); }
[data-theme="dark"] .featured-card:nth-child(4) { background: linear-gradient(135deg, #0d1b2a, #1b2838); }

[data-theme="dark"] .featured-badge {
  background: rgba(255,255,255,0.1);
  color: #ccc;
}

[data-theme="dark"] .featured-card h3 {
  color: #fff;
}

[data-theme="dark"] .featured-card .desc {
  color: rgba(255,255,255,0.7);
}

[data-theme="dark"] .featured-stats {
  color: rgba(255,255,255,0.6);
}

[data-theme="dark"] .featured-stats svg {
  stroke: rgba(255,255,255,0.6);
}

[data-theme="dark"] .lang-btn {
  border-color: #333;
  color: #888;
}

[data-theme="dark"] .lang-btn:hover {
  border-color: #60a5fa;
  color: #60a5fa;
}

[data-theme="dark"] .lang-btn.active {
  background: #60a5fa;
  border-color: #60a5fa;
  color: #fff;
}

[data-theme="dark"] .theme-btn {
  background: #222;
  color: #e0e0e0;
  border-color: #333;
}

[data-theme="dark"] .theme-btn:hover {
  border-color: #60a5fa;
}

/* Suggest form */
.suggest-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #1d1d1f;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2563eb;
}

.form-group textarea {
  resize: vertical;
}

.suggest-msg {
  font-size: 14px;
  font-weight: 600;
  padding: 4px 0;
}

.suggest-msg.success {
  color: #059669;
}

.suggest-msg.error {
  color: #dc2626;
}

[data-theme="dark"] .form-group label {
  color: #9ca3af;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
  background: #222;
  border-color: #333;
  color: #e0e0e0;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] .form-group textarea:focus {
  border-color: #60a5fa;
}

[data-theme="dark"] .suggest-msg.success {
  color: #34d399;
}

[data-theme="dark"] .suggest-msg.error {
  color: #f87171;
}
