:root {
  --bg: #0a0b10;
  --bg-gradient: linear-gradient(135deg, #0a0b10 0%, #12131c 100%);
  --surface: #15161f;
  --surface-2: #1c1d2b;
  --card: #1a1b28;
  --card-hover: #22243a;
  --border: #252740;
  --border-light: #2e3050;
  --text: #eaecf5;
  --text-secondary: #7f83a0;
  --text-tertiary: #555872;
  --accent: #7c6cf0;
  --accent-light: #a8a0f8;
  --accent-glow: rgba(124, 108, 240, 0.15);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.35);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Light Mode ── */
body.light {
  --bg: #f5f6fa;
  --bg-gradient: linear-gradient(135deg, #f5f6fa 0%, #e8eaf0 100%);
  --surface: #ffffff;
  --surface-2: #f0f1f5;
  --card: #ffffff;
  --card-hover: #f8f9fc;
  --border: #d8dae5;
  --border-light: #c8cad5;
  --text: #1a1a2e;
  --text-secondary: #555872;
  --text-tertiary: #7f83a0;
  --accent: #6c5ce7;
  --accent-light: #7c6cf0;
  --accent-glow: rgba(108, 92, 231, 0.12);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

body.light .header {
  background: rgba(245, 246, 250, 0.85);
}

body.light .modal-overlay {
  background: rgba(0, 0, 0, 0.4);
}

/* ── Force View ── */
body.force-mobile .section-grid {
  grid-template-columns: 1fr !important;
}

body.force-desktop .section-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* ── Header Controls ── */
.header-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ctrl-btn {
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  line-height: 1;
}

.ctrl-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-light);
  color: var(--text);
}

.ctrl-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

html { scroll-behavior: smooth; }

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

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 16, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent), #e84393);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 8px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 50px 10px 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

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

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  pointer-events: none;
}

.header-stat {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Hero ── */
.hero {
  background: var(--bg-gradient);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  position: relative;
}

.hero-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 520px;
}

.hero-desc strong {
  color: var(--accent-light);
  font-weight: 700;
}

/* ── Categories ── */
.categories {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-btn {
  padding: 7px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cat-emoji {
  font-size: 0.9rem;
}

.cat-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-light);
  color: var(--text);
}

.cat-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* ── Main ── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 24px 60px;
}

.tool-count {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ── Grid container ── */
.grid {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ── Category sections ── */
.category-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.section-emoji {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.section-count {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-tertiary);
  padding: 2px 9px;
  border-radius: 10px;
  margin-left: 2px;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

/* ── Card ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  background: var(--card-hover);
  border-color: var(--border-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card:hover .card-accent {
  opacity: 1;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.card-icon img {
  display: block;
  border-radius: 3px;
}

.card-icon-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.card-url {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-top: 1px;
}

.card-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: var(--transition);
}

/* ── Empty ── */
.empty {
  display: none;
  text-align: center;
  padding: 80px 20px;
}

.empty.visible {
  display: block;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.empty-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-hint {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 20px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 28px;
}

.footer-top {
  display: flex;
  gap: 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.footer-company {
  flex-shrink: 0;
  min-width: 200px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  text-decoration: none;
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 40px;
  flex: 1;
}

.footer-col {
  flex: 1;
  min-width: 140px;
}

.footer-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--accent-light);
}

/* Footer affiliates */
.footer-affiliates {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.affiliate-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.affiliate-select {
  padding: 8px 32px 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237f83a0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 200px;
  transition: var(--transition);
}

.affiliate-select:hover {
  border-color: var(--accent);
}

.affiliate-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.affiliate-select option {
  background: var(--surface);
  color: var(--text);
}

.footer-bottom {
  padding-top: 20px;
  text-align: center;
}

.footer-biz {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.footer-sep {
  margin: 0 8px;
  opacity: 0.4;
}

.footer-addr {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.footer-bank {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  opacity: 0.7;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
}

/* ── Floating Kakao Chat ── */
.floating-kakao {
  position: fixed;
  bottom: 82px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fee500;
  color: #3c1e1e;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 51;
  transition: transform 0.2s, box-shadow 0.2s;
}
.floating-kakao:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

/* ── Scroll to top ── */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: var(--transition);
  z-index: 50;
  backdrop-filter: blur(8px);
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }
  .search-wrap { max-width: 100%; order: 3; flex-basis: 100%; }
  .header-stat { display: none; }
  .hero-inner { padding: 32px 20px 28px; }
  .hero-title { font-size: 1.5rem; }
  .hero-desc { font-size: 0.9rem; }
  .categories { padding: 16px 20px 8px; }
  .main { padding: 8px 20px 48px; }
  .section-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
  .footer-top { flex-direction: column; gap: 28px; }
  .footer-links { flex-wrap: wrap; gap: 24px; }
  .footer-company { min-width: auto; }
}

/* ── Sub Nav ── */
.sub-nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.sub-nav-inner {
  display: flex;
  gap: 8px;
  padding: 12px 0 4px;
  flex-wrap: wrap;
}
.sub-nav-btn {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.sub-nav-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text);
}

/* ── Toolbar sort ── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 16px;
}
.sort-select {
  padding: 6px 28px 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237f83a0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.sort-select:hover { border-color: var(--accent); }

/* ── Card extras ── */
.badge-new {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #00b894;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  z-index: 2;
}
.card-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-tertiary);
  cursor: pointer;
  z-index: 2;
  transition: var(--transition);
  line-height: 1;
  padding: 2px;
}
.card-fav.active { color: #fdcb6e; }
.card-fav:hover { transform: scale(1.2); }
.badge-new + .card-fav { right: 52px; }

.card-meta {
  display: flex;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
}
.card-rating { color: #fdcb6e; }
.card-clicks { color: var(--text-tertiary); }
.card-contributor {
  font-size: 0.7rem;
  color: var(--accent);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-contributor::before {
  content: '👤';
  font-size: 0.75rem;
}
.detail-contributor {
  color: var(--accent);
  font-weight: 600;
}
.detail-contributor::before {
  content: '👤 ';
}

.card[data-tool-id] { cursor: pointer; }

/* ── Detail modal stars ── */
.detail-stars { display: inline-flex; gap: 2px; }
.detail-star {
  font-size: 1.3rem;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s;
}
.detail-star:hover,
.detail-star.active { color: #fdcb6e; }

/* ── Auth UI ── */
.auth-login-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.auth-login-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.auth-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.auth-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-logout-btn {
  padding: 5px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
}
.auth-logout-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* ── Register Modal ── */
.register-modal {
  max-width: 420px;
}
.register-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  white-space: normal;
}
.register-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.register-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.register-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.register-input {
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}
.register-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.register-error {
  font-size: 0.8rem;
  color: #e74c3c;
  min-height: 1.2em;
}
.register-submit {
  padding: 12px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.register-submit:hover { opacity: 0.9; }
.register-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Login prompt modal ── */
.login-prompt-modal {
  max-width: 380px;
}

/* ── Card preview (blur for non-auth) ── */
.card-preview .card-desc,
.card-preview .card-tags,
.card-preview .card-url {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}
.card-preview {
  cursor: pointer;
}
.card-preview:hover {
  transform: none;
  box-shadow: none;
}

/* ── Contribute Page ── */
.contribute-main {
  max-width: 800px;
}

.contribute-section {
  margin-bottom: 40px;
}

.contribute-section-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.contribute-section-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.contribute-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

@media (max-width: 600px) {
  .contribute-form-grid {
    grid-template-columns: 1fr;
  }
}

.contribute-login-required .empty {
  display: block;
  padding: 80px 20px;
  text-align: center;
}

.contribute-loading,
.contribute-empty {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  padding: 24px 0;
}

.contribute-item {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: var(--transition);
}

.contribute-item:hover {
  border-color: var(--border-light);
}

.contribute-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.contribute-item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.contribute-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
}

.status-pending {
  background: rgba(253, 203, 110, 0.15);
  color: #fdcb6e;
}

.status-approved {
  background: rgba(0, 184, 148, 0.15);
  color: #00b894;
}

.status-rejected {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.contribute-item-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.contribute-item-meta {
  display: flex;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.contribute-item-url {
  color: var(--accent-light);
  text-decoration: none;
}

.contribute-item-url:hover {
  text-decoration: underline;
}

.contribute-rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: var(--transition);
}

.contribute-rank-item:hover {
  border-color: var(--border-light);
}

.contribute-rank-medal {
  font-size: 1.2rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.contribute-rank-name {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
}

.contribute-rank-count {
  font-size: 0.78rem;
  color: var(--accent-light);
  font-weight: 500;
}

.contribute-link {
  background: var(--accent-glow);
  color: var(--accent-light);
  border-color: var(--accent);
  text-decoration: none;
}

.contribute-link:hover {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 480px) {
  .section-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.3rem; }
  .search-kbd { display: none; }
}

/* ══════════════════════════════════════ */
/* ── Mypage ── */
/* ══════════════════════════════════════ */

.mypage-main {
  max-width: 800px;
}

.mypage-section {
  margin-bottom: 32px;
}

.mypage-section-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.mypage-section-title {
  font-size: 1.05rem;
  font-weight: 700;
}

/* Profile Card */
.mypage-profile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.mypage-profile-top {
  display: flex;
  align-items: center;
  gap: 20px;
}

.mypage-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mypage-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mypage-avatar-placeholder {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
}

.mypage-profile-info {
  flex: 1;
  min-width: 0;
}

.mypage-profile-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.mypage-profile-email {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.mypage-profile-meta {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.mypage-sep {
  margin: 0 6px;
}

/* Edit Form */
.mypage-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

/* Stats */
.mypage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.mypage-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.mypage-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-light);
}

.mypage-stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ══════════════════════════════════════ */
/* ── Admin (in mypage) ── */
/* ══════════════════════════════════════ */

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-tab-btn {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.admin-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.mypage-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.mypage-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.admin-form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-form-row .register-input {
  flex: 1;
  min-width: 140px;
}

.admin-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.admin-output {
  width: 100%;
  min-height: 120px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent-light);
  font-family: 'Consolas', monospace;
  font-size: 0.8rem;
  resize: vertical;
  margin-bottom: 12px;
}

.admin-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-btn-sm {
  padding: 8px 16px;
  font-size: 0.78rem;
}

.admin-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-top: 12px;
  display: none;
}

.admin-msg-success {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success, #00b894);
  display: block;
}

.admin-msg-info {
  background: rgba(124, 108, 240, 0.15);
  color: var(--accent-light);
  display: block;
}

/* Admin list */
.admin-list {
  list-style: none;
}

.admin-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.admin-list-item:last-child {
  border-bottom: none;
}

.admin-list-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.admin-list-info {
  flex: 1;
  min-width: 0;
}

.admin-list-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-list-url {
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.admin-list-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.admin-empty {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px;
}

/* Admin tool cards */
.admin-tool-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.admin-tool-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-tool-card-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-tool-card-cat {
  font-size: 0.72rem;
  color: var(--accent-light);
}

.admin-tool-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.admin-tool-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.admin-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-light);
  margin: 16px 0 8px;
}

.admin-tool-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.admin-table th,
.admin-table td {
  padding: 8px 6px;
  text-align: left;
}

.admin-table thead tr {
  border-bottom: 2px solid var(--border);
}

.admin-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.admin-table td:first-child {
  color: var(--text-secondary);
}

/* Admin chart */
.admin-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding-top: 12px;
}

.admin-chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.admin-chart-val {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.admin-chart-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 4px;
}

.admin-chart-label {
  font-size: 0.6rem;
  color: var(--text-tertiary);
}

/* Admin top list */
.admin-top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.admin-top-num {
  font-size: 0.72rem;
  color: var(--text-secondary);
  width: 20px;
}

.admin-top-name {
  flex: 1;
  font-size: 0.82rem;
}

.admin-top-val {
  font-size: 0.78rem;
  color: var(--accent-light);
}

/* Suggestion tags */
.admin-sug-tags {
  font-size: 0.7rem;
  margin-top: 4px;
}

.admin-sug-tag {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
}

/* Mypage link in header */
.mypage-link {
  background: var(--accent-glow);
  color: var(--accent-light);
  border-color: var(--accent);
  text-decoration: none;
}

.mypage-link:hover {
  background: var(--accent);
  color: #fff;
}

/* Admin search */
.admin-search-wrap {
  margin-bottom: 16px;
}

.admin-search-wrap .register-input {
  width: 100%;
}

/* Contributor badge */
.admin-contributor-badge {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--accent);
  margin-top: 4px;
}

.admin-contributor-badge::before {
  content: '👤 ';
}

/* Suggestion warning */
.admin-sug-warning {
  font-size: 0.7rem;
  color: #fdcb6e;
  background: rgba(253, 203, 110, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  margin-top: 6px;
}

.admin-sug-warning::before {
  content: '⚠ ';
}

/* Suggestion card highlight for pending */
.admin-sug-card {
  border-left: 3px solid transparent;
}

/* Settings Success Message */
.register-success {
  color: var(--success);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

/* AI Generate Button */
.btn-ai-generate {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-ai-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-ai-generate:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 600px) {
  .admin-tabs {
    gap: 4px;
  }
  .admin-tab-btn {
    padding: 8px 12px;
    font-size: 0.78rem;
  }
  .mypage-profile-top {
    flex-direction: column;
    text-align: center;
  }
}
