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

:root {
  --background: #ffffff;
  --foreground: #171717;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Navbar */
.navbar { background: white; color: #333; padding: 1rem 0; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.navbar-logo { display: flex; align-items: center; text-decoration: none; color: #333; }
.navbar-logo img { height: 2rem; width: auto; }
.navbar-logo span { font-size: 2rem; font-weight: bold; margin-left: 0.5rem; line-height: 2rem; }
.navbar-links { display: flex; gap: 1rem; align-items: center; }
.navbar-links a, .navbar-links button { color: #333; text-decoration: none; background: none; border: none; cursor: pointer; font-size: 1rem; }
.navbar-links a:hover, .navbar-links button:hover { color: #CD1818; }
.navbar-user { color: #333; font-weight: 500; }

@media (max-width: 768px) {
  .navbar { padding: 0.7rem 0; }
  .navbar-logo img { height: 1.4rem; }
  .navbar-logo span { font-size: 1.4rem; }
  .navbar-links a, .navbar-links button { font-size: 0.875rem; }
}

/* Banner Carousel */
.banner { position: relative; width: 100%; padding-top: 43.28%; overflow: hidden; margin-bottom: 1.5rem; }
.banner-slides { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.banner-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.5s; }
.banner-slide.active { opacity: 1; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: white; border: none; width: 2.5rem; height: 2.5rem; border-radius: 9999px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; line-height: 1; z-index: 10; }
.banner-btn:hover { background: rgba(0,0,0,0.7); }
.banner-btn.prev { left: 1rem; }
.banner-btn.next { right: 1rem; }
.banner-dots { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.5rem; z-index: 10; }
.banner-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: rgba(255,255,255,0.5); border: none; cursor: pointer; transition: background 0.3s; }
.banner-dot.active { background: white; }

@media (max-width: 768px) {
  .banner { padding: 0 2px !important; margin-top: -10px !important; height: auto !important; box-sizing: border-box !important; }
  .banner-slides { position: relative !important; height: auto !important; }
  .banner-slide { position: relative !important; height: auto !important; opacity: 1 !important; display: none !important; }
  .banner-slide.active { display: block !important; }
  .banner-slide img { height: auto !important; object-fit: contain !important; aspect-ratio: 16/9 !important; }
  .banner-btn { display: none !important; }
  .banner-dots { position: relative !important; bottom: auto !important; left: auto !important; transform: none !important; justify-content: center !important; padding: 0.25rem 0 !important; margin-top: -15px !important; background: #ffffff !important; }
  .banner-dot { background: #999 !important; width: 0.5rem !important; height: 0.5rem !important; }
  .banner-dot.active { background: #8B0000 !important; }
}

/* Category Cards */
.categories { margin-bottom: 2rem; }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 768px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .category-grid { grid-template-columns: 1fr; } }

.category-card { display: block; border-radius: 0.5rem; padding: 1rem; text-decoration: none; color: #1f2937; transition: opacity 0.2s; }
.category-card:hover { opacity: 0.9; }
.category-card.t0 { background: linear-gradient(135deg, #d4af37, #f4e4a6, #d4af37); }
.category-card.tools { background: linear-gradient(135deg, #e8d78a, #faf5e6, #e8d78a); }
.category-card.tdx { background: linear-gradient(135deg, #d4af37, #f4e4a6, #d4af37); }
.category-card.auto { background: linear-gradient(135deg, #e8d78a, #faf5e6, #e8d78a); }
.category-card-content { display: flex; align-items: center; gap: 0.75rem; }
.category-card-content .icon { font-size: 1.5rem; }
.category-card h3 { font-weight: bold; }
.category-card p { font-size: 0.875rem; color: #4b5563; }

/* Section Header */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.section-header h2 { font-size: 1.25rem; font-weight: bold; }
.filter-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn { padding: 0.25rem 0.75rem; border-radius: 0.25rem; font-size: 0.875rem; border: none; cursor: pointer; background: #e5e7eb; color: #374151; }
.filter-btn.active { background: #CD1818; color: white; }

/* Software Grid */
.software-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

@media (max-width: 1024px) { .software-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .software-grid { grid-template-columns: 1fr; } }

.software-card { border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); transition: box-shadow 0.2s; }
.software-card:hover { box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.software-card-link { text-decoration: none; color: inherit; }
.software-card-header { display: flex; align-items: center; margin-bottom: 0.75rem; cursor: pointer; }
.software-icon { width: 3rem; height: 3rem; border-radius: 0.25rem; object-fit: contain; border: 1px solid #e5e7eb; }
.software-icon-placeholder { width: 3rem; height: 3rem; background: #dbeafe; border-radius: 0.25rem; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.software-info { margin-left: 0.75rem; }
.software-info h3 { font-weight: bold; }
.software-info span { font-size: 0.875rem; color: #6b7280; }
.software-desc { color: #4b5563; font-size: 0.875rem; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.download-btn { width: 100%; background: #CD1818; color: white; padding: 0.5rem; border: none; border-radius: 0.25rem; cursor: pointer; font-size: 1rem; }
.download-btn:hover { background: #FD1818; }

/* Empty State */
.empty-state { text-align: center; padding: 2.5rem; color: #6b7280; }

/* Guest Notice */
.guest-notice { margin-top: 2rem; padding: 1rem; background: #f3f4f6; border-radius: 0.25rem; text-align: center; }
.guest-notice a { color: #CD1818; text-decoration: none; }
.guest-notice a:hover { text-decoration: underline; }

/* Loading */
.loading { text-align: center; padding: 2.5rem; }

/* Main Content */
.main-content { padding-top: 1rem; padding-bottom: 1rem; }
@media (max-width: 768px) {
  .main-content { padding-top: 0; padding-bottom: 0; }
  .categories { margin-top: -10px; }
}

/* Strategy Section */
.strategy-section { margin-top: 2rem; padding: 1.5rem; background: #f9fafb; border-radius: 0.5rem; }
.strategy-section h2 { font-size: 1.25rem; font-weight: bold; margin-bottom: 1rem; color: #1f2937; }

.table-container { overflow-x: auto; }

.strategy-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.strategy-table th { background: white; color: #333; padding: 0.75rem; text-align: left; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-radius: 0.25rem; }

.strategy-table td { padding: 0.75rem; border-bottom: 1px solid #e5e7eb; color: #374151; }

.strategy-table tr:hover { background: #f9fafb; }

.strategy-table .positive { color: #dc2626; font-weight: 600; }
.strategy-table .negative { color: #16a34a; font-weight: 600; }

.strategy-table a { color: #000; text-decoration: none; }
.strategy-table a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .strategy-section { margin-top: 1rem; padding: 1rem; }
  .strategy-table th, .strategy-table td { padding: 0.5rem; font-size: 0.75rem; }
}

/* Chart Container */
.chart-container { position: relative; width: 100%; }
.chart-wrapper { position: relative; height: 400px; width: 100%; }

@media (max-width: 768px) {
  .chart-wrapper { height: 350px; }
  .mobile-hint { display: inline !important; }
}
