/* ============================================
   수익링크 모음 - 모바일 퍼스트 스타일
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-primary: #4f46e5;
  --color-primary-light: #eef2ff;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-accent: #f97316;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* --- Header --- */
.header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  padding: 40px 0 32px;
  text-align: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  margin-top: 6px;
  font-size: 0.875rem;
  opacity: 0.85;
  font-weight: 400;
}

.header .disclosure {
  margin: 10px auto 0;
  max-width: 680px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #ffffff;
  opacity: 0.95;
}

/* --- Category Nav --- */
.category-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.category-scroll {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.category-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.category-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* --- Search Bar --- */
.search-bar {
  padding: 12px 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.search-bar input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--color-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* --- Main / Link Grid --- */
.main {
  padding: 20px 0 40px;
}

.link-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* --- Link Card --- */
.link-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  border: 1px solid var(--color-border);
}

.link-card:hover,
.link-card:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.link-card-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--color-bg);
  display: block;
}

.link-card-body {
  padding: 14px 16px;
}

.link-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-card-desc {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.link-card-badge {
  font-size: 0.6875rem;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.badge-coupang     { background: #fff0e6; color: #e65100; }
.badge-amazon      { background: #fff5cc; color: #b8860b; }
.badge-naver       { background: #e8faf0; color: #03c75a; }
.badge-11st        { background: #ffebee; color: #d32f2f; }
.badge-gmarket     { background: #e3f2fd; color: #1976d2; }
.badge-auction     { background: #fce4ec; color: #c62828; }
.badge-interpark   { background: #f3e5f5; color: #7b1fa2; }
.badge-wemakeprice { background: #fbe9e7; color: #e64a19; }
.badge-tmon        { background: #fff3e0; color: #ff6f00; }
.badge-other       { background: #eef2ff; color: #4f46e5; }

.link-card-arrow {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 24px 0 0;
}

.page-btn {
  min-width: 44px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.page-btn:hover {
  border-color: var(--color-primary);
}

.page-btn.active,
.page-btn:disabled {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  cursor: default;
}

.page-info {
  width: 100%;
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary);
  font-size: 1rem;
}

/* --- Footer --- */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 24px 0 32px;
  text-align: center;
}

.disclosure {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.copyright {
  font-size: 0.6875rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
}

/* ============================================
   Tablet 이상 반응형
   ============================================ */
@media (min-width: 600px) {
  .link-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .logo {
    font-size: 1.75rem;
  }

  .header {
    padding: 52px 0 40px;
  }
}

@media (min-width: 900px) {
  .link-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .container {
    padding: 0 24px;
  }
}

/* --- Loading Skeleton --- */
.skeleton {
  animation: shimmer 1.5s infinite;
  background: linear-gradient(90deg, var(--color-border) 25%, #f1f5f9 50%, var(--color-border) 75%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16/10;
}

.skeleton-title {
  height: 16px;
  width: 80%;
  margin: 14px 16px 0;
  border-radius: 4px;
}

.skeleton-desc {
  height: 12px;
  width: 60%;
  margin: 8px 16px 14px;
  border-radius: 4px;
}
