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

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #f0f0f0;
  --border-hover: #e0e0e0;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --accent: #1a1a1a;
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w: 1200px;
}

html { font-size: 15px; scroll-padding-top: 60px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.sp-hide { }

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

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.pro-btn {
  padding: .35rem .85rem;
  font-size: .75rem;
  font-weight: 600;
  font-family: var(--font);
  background: var(--text);
  color: #fff;
  border-radius: 6px;
  letter-spacing: .02em;
  transition: opacity .2s;
}

.pro-btn:hover { opacity: .8; }

.pro-btn.pro-active {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--text);
  cursor: default;
  font-size: .7rem;
}

.pro-btn.pro-active:hover { opacity: 1; }

/* ── Search ── */
.search-box {
  position: relative;
  width: 260px;
}

.search-box input {
  width: 100%;
  padding: .45rem .9rem .45rem 2.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .83rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
}

.search-box input:focus { border-color: #ccc; }
.search-box input::placeholder { color: var(--text-muted); }

.search-box svg {
  position: absolute;
  left: .65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ── Hero ── */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 1rem;
  text-align: center;
}

.hero-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: .5rem;
}

.hero-sub {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.hero-actions {
  display: flex;
  gap: .6rem;
  justify-content: center;
}

.hero-cta-primary {
  padding: .5rem 1.4rem;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .87rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity .2s;
}

.hero-cta-primary:hover { opacity: .85; }

.hero-cta-secondary {
  padding: .5rem 1.4rem;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .87rem;
  font-weight: 600;
  transition: border-color .2s;
}

.hero-cta-secondary:hover { border-color: var(--text); }

/* ── Category Description ── */
.category-desc {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .35rem;
  line-height: 1.6;
}

/* ── Category Section ── */
.category-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 0;
}

.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.category-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

.category-more {
  font-size: .8rem;
  color: var(--text-muted);
  transition: color .2s;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

.category-more:hover { color: var(--text); }

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.grid-home {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s, transform .25s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 28px rgba(0,0,0,.06);
  transform: translateY(-3px);
}

.card-preview {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.card-body {
  padding: .7rem 1rem .85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.card-title {
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-desc {
  display: none;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}

.tech-badge {
  font-size: .6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .12rem .4rem;
  border-radius: 4px;
  background: #f3f3f3;
  color: var(--text-muted);
}

.premium-badge {
  font-size: .55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .12rem .4rem;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
}

/* ── Category Page Header ── */
.page-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 2rem 0;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.page-header p {
  color: var(--text-muted);
  font-size: .87rem;
  margin-top: .25rem;
}

.page-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* ── Detail Page ── */
.detail-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.detail-header {
  margin-bottom: 1.75rem;
}

.detail-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .35rem;
}

.detail-header p {
  color: var(--text-muted);
  font-size: .87rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  transition: color .2s;
}

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

/* Preview */
.detail-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
  position: relative;
}

/* ── Copy All Button ── */
.copy-all-wrap {
  margin-bottom: 1.5rem;
}

.copy-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .7rem;
  font-size: .87rem;
  font-weight: 600;
  font-family: var(--font);
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity .2s;
}

.copy-all-btn:hover { opacity: .85; }

.copy-all-btn.copied {
  background: #16a34a;
}

/* Code Blocks */
.code-section {
  margin-bottom: 1rem;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .9rem;
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

.code-label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .6rem;
  font-size: .72rem;
  font-weight: 500;
  font-family: var(--font);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}

.copy-btn:hover {
  border-color: #ccc;
  color: var(--text-secondary);
}

.copy-btn.copied {
  border-color: #86efac;
  color: #16a34a;
  background: #f0fdf4;
}

.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: .9rem 1rem;
  overflow-x: auto;
}

.code-block pre {
  font-family: var(--mono);
  font-size: .8rem;
  line-height: 1.7;
  white-space: pre;
  margin: 0;
}

/* Syntax Highlight Colors */
.code-block pre { color: #383a42; }
.code-block .hl-tag { color: #e45649; }
.code-block .hl-attr { color: #986801; }
.code-block .hl-string { color: #50a14f; }
.code-block .hl-prop { color: #4078f2; }
.code-block .hl-value { color: #986801; }
.code-block .hl-selector { color: #e45649; }
.code-block .hl-keyword { color: #a626a4; }
.code-block .hl-func { color: #4078f2; }
.code-block .hl-comment { color: #a0a1a7; font-style: italic; }
.code-block .hl-number { color: #986801; }
.code-block .hl-punctuation { color: #383a42; }

/* ── Related ── */
.related-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

/* ── Pro Banner ── */
.pro-banner {
  max-width: var(--max-w);
  margin: 3rem auto 0;
  padding: 0 2rem;
}

.pro-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 2.5rem;
  background: #1a1a1a;
  border-radius: var(--radius);
  color: #fff;
}

.pro-banner-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .3rem;
}

.pro-banner-desc {
  font-size: .8rem;
  color: rgba(255,255,255,.55);
  line-height: 1.6;
}

.pro-banner-btn {
  flex-shrink: 0;
  padding: .55rem 1.4rem;
  background: #fff;
  color: #1a1a1a;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  transition: opacity .2s;
}

.pro-banner-btn:hover { opacity: .85; }

/* ── Pro Inline ── */
.pro-inline {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 2rem 0;
}

.pro-inline-inner {
  padding: 1rem 1.25rem;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .8rem;
  color: var(--text-muted);
}

.pro-inline-inner a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 640px) {
  .pro-banner-inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.5rem;
  }
}

/* ── Footer ── */
.footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.footer-inner {
  font-size: .78rem;
  color: var(--text-muted);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand { max-width: 280px; }

.footer-logo {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .35rem;
}

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

.footer-nav { display: flex; gap: 3rem; }

.footer-col {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.footer-col-title {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-secondary);
  margin-bottom: .25rem;
}

.footer-col a {
  font-size: .78rem;
  color: var(--text-muted);
  transition: color .2s;
}

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

.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: .72rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .footer-top { flex-direction: column; gap: 1.5rem; }
  .footer-nav { gap: 1.5rem; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .grid, .page-grid { grid-template-columns: 1fr; }
  .grid-home { grid-template-columns: 1fr; }
  .grid-home .card:nth-child(n+4) { display: none; }
  .header-inner { padding: 0 1rem; }
  .category-section { padding: 2rem 1rem 0; }
  .page-header { padding: 1.5rem 1rem 0; }
  .page-grid { padding: 1rem; }
  .search-box { width: 140px; }
  .detail-container { padding: 1.5rem 1rem; }
  .hero { padding: 1rem 1rem .75rem; }
  .hero-title { font-size: 1.15rem; }
  .hero-sub { font-size: .82rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .sp-hide { display: none; }
}

/* ── Pro Lock ── */
.pro-lock {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: #fafafa;
}

.pro-lock-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pro-lock-inner svg { color: var(--text-muted); flex-shrink: 0; }
.pro-lock-title { font-size: .87rem; font-weight: 600; margin-bottom: .15rem; }
.pro-lock-desc { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }

.pro-lock-btn {
  margin-left: auto;
  flex-shrink: 0;
  padding: .45rem 1.1rem;
  font-size: .8rem;
  font-weight: 600;
  font-family: var(--font);
  background: var(--text);
  color: #fff;
  border-radius: 7px;
  transition: opacity .2s;
}

.pro-lock-btn:hover { opacity: .8; }

/* ── Pricing Page ── */
.pricing-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.pricing-header { text-align: center; margin-bottom: 2.5rem; }
.pricing-header h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .4rem; }
.pricing-header p { color: var(--text-muted); font-size: .9rem; }

.pricing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.pricing-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem 1.5rem; display: flex; flex-direction: column; }
.pricing-card.featured { border-color: var(--text); }
.pricing-plan { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .75rem; }
.pricing-price { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: 1.5rem; }
.pricing-price span { font-size: .85rem; font-weight: 500; color: var(--text-muted); }
.pricing-features { list-style: none; flex: 1; margin-bottom: 1.5rem; }
.pricing-features li { font-size: .83rem; color: var(--text-secondary); padding: .4rem 0; padding-left: 1.2rem; position: relative; }
.pricing-features li::before { content: ''; position: absolute; left: 0; top: .7rem; width: 6px; height: 6px; border-radius: 50%; background: #ccc; }
.pricing-card.featured .pricing-features li::before { background: var(--text); }
.pricing-current { font-size: .82rem; color: var(--text-muted); text-align: center; padding: .55rem; border: 1px solid var(--border); border-radius: 7px; }
.pricing-cta { width: 100%; padding: .65rem; font-size: .87rem; font-weight: 600; font-family: var(--font); background: var(--text); color: #fff; border: none; border-radius: 7px; cursor: pointer; transition: opacity .2s; }
.pricing-cta:hover { opacity: .85; }
.pricing-active { font-size: .82rem; font-weight: 600; color: var(--text); text-align: center; padding: .55rem; border: 1.5px solid var(--text); border-radius: 7px; }

@media (max-width: 640px) {
  .pricing-cards { grid-template-columns: 1fr; }
  .pricing-container { padding: 2rem 1rem; }
  .pro-lock-inner { flex-direction: column; text-align: center; }
  .pro-lock-btn { margin-left: 0; }
}

/* ── Utility ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: .87rem;
}
