:root {
  --accent: #ff6b35;
  --accent-dark: #e55a2b;
  --accent-light: #fff1e9;
  --accent-secondary: #4ecdc4;
  --bg: #ffffff;
  --bg-alt: #fafbfc;
  --bg-section: #f8f9fb;
  --text: #1a1d23;
  --text-light: #525866;
  --text-muted: #8a90a0;
  --border: #e6e8ef;
  --border-light: #f1f3f8;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.06);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --max-w: 1200px;
  --max-w-content: 820px;
  --header-h: 72px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --trans: 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--accent); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm {
  width: 100%;
  max-width: var(--max-w-content);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 16px; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 14px; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); margin-bottom: 12px; }
h4 { font-size: 1.1rem; margin-bottom: 10px; }

p { margin-bottom: 16px; color: var(--text-light); }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  flex-shrink: 0;
  min-width: 0;
}
.logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(255,107,53,0.3);
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-light);
  transition: all var(--trans);
}
.main-nav a:hover, .main-nav a.active {
  color: var(--accent);
  background: var(--accent-light);
}
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 320px;
}
.header-search form { width: 100%; position: relative; }
.header-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-alt);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--trans);
  outline: none;
}
.header-search input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}
.header-search::before {
  content: '🔍';
  position: absolute;
  margin-left: 14px;
  z-index: 1;
  font-size: 0.85rem;
  opacity: 0.5;
  pointer-events: none;
}
.header-search { position: relative; }
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  place-items: center;
  font-size: 1.2rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 6px 16px rgba(255,107,53,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255,107,53,0.35);
  color: #fff;
}
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.btn-sm { padding: 8px 14px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-danger {
  background: #fee2e2;
  color: var(--error);
}
.btn-danger:hover { background: #fecaca; color: var(--error); }
.btn-block { width: 100%; }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 100px 0 120px;
  overflow: hidden;
  background:
    url('../images/hero-bg.jpg') center/cover no-repeat;
  background-color: transparent;
}
.hero::before,
.hero::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.hero > .container {
  position: relative;
  z-index: 1;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  margin-bottom: 20px;
  line-height: 1.1;
  text-align: center;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.1rem;
  margin-bottom: 32px;
  max-width: 600px;
  color: var(--text-light);
  text-align: center;
}
.hero-search {
  width: 100%;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  gap: 10px;
  background: #fff;
  padding: 8px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
}
.hero-search form { flex: 1; min-width: 0; display: flex; }
.hero-search input {
  flex: 1;
  width: 100%;
  padding: 14px 18px;
  border: none;
  background: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  min-width: 0;
}
.hero-search input::placeholder { color: var(--text-muted); }
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
}
.hero-stat-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.hero-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.hero-visual {
  position: relative;
  height: 460px;
  max-width: 100%;
}
.hero-card {
  position: absolute;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  border: 1px solid var(--border-light);
  width: auto;
  min-width: 0;
}
.hero-card-1 {
  top: 0;
  left: 0;
  right: 40px;
  max-width: calc(100% - 40px);
  transform: rotate(-4deg);
}
.hero-card-2 {
  bottom: 0;
  right: 0;
  left: 40px;
  max-width: calc(100% - 40px);
  transform: rotate(3deg);
}
.pun-float {
  background: linear-gradient(135deg, var(--accent-light), #fff);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  border-left: 4px solid var(--accent);
  font-weight: 600;
}
.pun-float:last-child { margin-bottom: 0; }

/* ===== Section ===== */
.section {
  padding: 72px 0;
}
.section-alt { background: var(--bg-section); }
.section-head {
  margin-bottom: 48px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-bottom: 12px;
}
.section-head p {
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-light);
}

/* ===== Article Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.card-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, var(--accent-light), var(--bg-section));
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-img img { transform: scale(1.06); }
.card-img-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--accent-light), #fff5ed);
}
.card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}
.card-meta .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-muted);
}
.card-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
  line-height: 1.35;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-excerpt {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 18px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
}

/* ===== Related cards (detail page) ===== */
.card-grid-related {
  gap: 24px;
}
.card-grid-related .card-body {
  padding: 20px;
}
.card-grid-related .card-excerpt {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  font-size: 0.9rem;
}

/* ===== Article Page ===== */
.article-hero {
  padding: 60px 0 40px;
}
.article-category {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 16px;
}
.article-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--accent-dark);
  padding: 20px 28px;
  background: linear-gradient(135deg, var(--accent-light), #fff5ed);
  border: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(255,107,53,0.15);
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.article-cover {
  margin: 40px 0 48px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 8;
  background: var(--bg-section);
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-cover-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 5rem;
  background: linear-gradient(135deg, var(--accent-light), #fff5ed);
}
.article-content {
  max-width: var(--max-w-content);
  margin: 0 auto;
}
.article-content h1,
.article-content h2,
.article-content h3 {
  margin-top: 36px;
  margin-bottom: 14px;
}
.article-content h1:first-child,
.article-content h2:first-child,
.article-content h3:first-child { margin-top: 0; }
.article-content h2 {
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--accent-light), #fff);
  border: 2px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent-dark);
  font-size: clamp(1.3rem, 2.8vw, 1.7rem);
  box-shadow: var(--shadow-sm);
}
.article-content p {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #374151;
}
.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-weight: 600;
  transition: all var(--trans);
  word-break: break-word;
}
.article-content a:hover {
  color: var(--accent-dark);
  text-decoration-thickness: 2px;
  background: var(--accent-light);
  border-radius: 3px;
  padding: 0 2px;
  margin: 0 -2px;
}

/* ===== Pun Box ===== */
  .pun-box {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 14px !important;
    gap: 10px !important;
    margin: 16px 0 !important;
    min-height: auto !important;
    height: auto !important;
  }
.pun-box::before {
  display: none;
}
  .pun-box:hover {
    transform: none !important; /* Disable hover lift on mobile */
  }

 .pun-text {
    flex: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    text-align: left !important;
  }
  .pun-copy-btn {
    position: static !important; /* Remove absolute positioning */
    transform: none !important;
    flex-shrink: 0 !important;
    width: auto !important;
    min-width: auto !important;
    padding: 6px 12px !important;
    font-size: 0.75rem !important;
    margin: 0 !important;
    align-self: center !important;
  }
.pun-copy-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-50%) scale(1.04);
}
.pun-copy-btn.copied {
  background: var(--success);
}

/* ===== Related Articles ===== */
.related-section {
  margin-top: 80px;
  padding-top: 56px;
  border-top: 1px solid var(--border-light);
}

/* ===== Author Card ===== */
.author-card {
  margin-top: 56px;
  padding: 28px;
  background: linear-gradient(135deg, var(--accent-light), #fff);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 24px;
  align-items: flex-start;
  box-shadow: 0 4px 16px rgba(255,107,53,0.08);
}
.author-avatar {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(255,107,53,0.2);
  background: var(--bg-section);
}
.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.author-info { flex: 1; min-width: 0; }
.author-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.author-role {
  font-size: 0.9rem;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 12px;
}
.author-bio {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-light);
  margin-bottom: 16px;
}
.author-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== Share Card ===== */
.share-card {
  margin-top: 32px;
  padding: 28px;
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.share-head {
  margin-bottom: 20px;
  text-align: center;
}
.share-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.share-sub {
  font-size: 0.95rem;
  color: var(--text-light);
  margin: 0;
}
.share-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  transition: all var(--trans);
  border: none;
  text-decoration: none;
  line-height: 1.3;
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  color: #fff;
}
.share-btn span { font-size: 1rem; }
.share-fb { background: #1877f2; }
.share-fb:hover { background: #166fe5; }
.share-x { background: #000; }
.share-x:hover { background: #1a1a1a; }
.share-pin { background: #e60023; }
.share-pin:hover { background: #cc001f; }
.share-tg { background: #0088cc; }
.share-tg:hover { background: #0077b3; }
.share-wa { background: #25d366; }
.share-wa:hover { background: #20bd5b; }
.share-li { background: #0a66c2; }
.share-li:hover { background: #0958ab; }
.share-copy { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }
.share-copy:hover { background: linear-gradient(135deg, var(--accent-dark), var(--accent)); }
.share-copy.copied { background: var(--success); }

/* ===== Content + Sidebar layout (home, puns, detail) ===== */
.content-sidebar-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: flex-start;
}
.content-sidebar-layout .main-content {
  min-width: 0;
}
.content-sidebar-layout .sidebar {
  min-width: 0;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

/* ===== Sidebar widgets ===== */
.sidebar-widget {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.sidebar-widget:last-child { margin-bottom: 0; }
.sidebar-widget-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sidebar-post-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-post-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.sidebar-post-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-light), var(--bg-section));
  display: block;
}
.sidebar-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.sidebar-post-thumb:hover img {
  transform: scale(1.08);
}
.sidebar-post-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: linear-gradient(135deg, var(--accent-light), #fff5ed);
}
.sidebar-post-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-post-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  transition: color var(--trans);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-post-title:hover {
  color: var(--accent);
}
.sidebar-post-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-post-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* ===== Detail page layout ===== */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: flex-start;
}
.detail-main {
  min-width: 0;
  width: 100%;
}
.detail-sidebar {
  min-width: 0;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
/* ===== Search Page ===== */
.page-header {
  padding: 60px 0 40px;
}
.page-header.small { padding: 32px 0; }
.search-result-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.search-result-count strong { color: var(--accent); }
.no-results {
  text-align: center;
  padding: 80px 20px;
  background: var(--bg-section);
  border-radius: var(--radius-lg);
}
.no-results-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 56px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--trans);
}
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pagination .dots { border: none; background: none; }

/* ===== Footer ===== */
.site-footer {
  background: var(--text);
  color: #c7cbd6;
  padding: 64px 0 24px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand .logo { color: #fff; margin-bottom: 16px; }
.footer-brand p {
  color: #9097a7;
  font-size: 0.95rem;
  line-height: 1.7;
}
.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 20px;
}
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  color: #9097a7;
  font-size: 0.9rem;
  transition: color var(--trans);
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: #6b7280;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text);
}
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: all var(--trans);
  outline: none;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-help {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.form-error {
  background: #fee2e2;
  color: var(--error);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.form-success {
  background: #dcfce7;
  color: var(--success);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ===== About / Legal Pages ===== */
.legal-content {
  max-width: var(--max-w-content);
  margin: 0 auto;
}
.legal-content p { font-size: 1rem; line-height: 1.8; }
.legal-content h2 { margin-top: 32px; }
.legal-content h3 { margin-top: 24px; }

/* ===== 404 ===== */
.error-page {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 80px 20px;
}
.error-code {
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.05em;
}
.error-title { font-size: clamp(1.5rem, 3vw, 2rem); margin: 20px 0 12px; }
.error-desc { margin-bottom: 32px; color: var(--text-light); }

/* ===== Admin Panel ===== */
.admin-layout {
  min-height: 100vh;
  background: #f5f7fb;
  display: flex;
  flex-direction: column;
}
.admin-header {
  background: #111827;
  color: #fff;
  padding: 14px 0;
  border-bottom: 1px solid #1f2937;
}
.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.admin-logo {
  font-weight: 900;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.admin-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: #d1d5db;
  transition: all var(--trans);
}
.admin-nav a:hover, .admin-nav a.active {
  color: #fff;
  background: #1f2937;
}
.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
.admin-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}
.admin-body {
  flex: 1;
  padding: 40px 0;
}
.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.page-title {
  font-size: 1.75rem;
  margin: 0;
}

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
}
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.green .stat-value { color: var(--success); }
.stat-card.blue .stat-value { color: #3b82f6; }

/* Tables */
.table-wrap {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}
.data-table th {
  background: #f9fafb;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }
.data-table .title-cell {
  max-width: 300px;
  font-weight: 600;
}
.data-table .title-cell a { color: var(--text); }
.data-table .title-cell a:hover { color: var(--accent); }
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-published { background: #dcfce7; color: #166534; }
.badge-draft { background: #fef3c7; color: #92400e; }
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

/* Editor */
.editor-wrap {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.editor-toolbar {
  display: flex;
  gap: 4px;
  padding: 12px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}
.editor-toolbar button {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--trans);
}
.editor-toolbar button:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.editor-toolbar button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.editor-toolbar .toolbar-sep {
  width: 1px;
  background: var(--border);
  margin: 6px 8px;
}
.editor-toolbar .toolbar-image-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  color: #fff;
  border-color: transparent;
}
.editor-toolbar .toolbar-image-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #44a08d, #4ecdc4);
  color: #fff;
  border-color: transparent;
}
.editor-textarea {
  width: 100%;
  min-height: 500px;
  padding: 20px;
  border: none;
  outline: none;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.95rem;
  line-height: 1.7;
  resize: vertical;
  background: #fff;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-grid .full { grid-column: 1 / -1; }

/* SEO Checklist */
.seo-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid var(--border-light);
}
.seo-box h4 { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.seo-score {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}
.seo-check-list { display: flex; flex-direction: column; gap: 8px; }
.seo-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-light);
}
.seo-check-item .tick {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  font-weight: 900;
  color: #fff;
}
.seo-check-item.pass .tick { background: var(--success); }
.seo-check-item.fail .tick { background: var(--error); }

/* Preview modal */
.preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  padding: 30px 20px;
  overflow-y: auto;
}
.preview-modal.show { display: block; }
.preview-modal-inner {
  max-width: var(--max-w-content);
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
}
.preview-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 700;
  transition: all var(--trans);
}
.preview-modal-close:hover { background: var(--border); }

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(ellipse at top left, rgba(255,107,53,0.15), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(78,205,196,0.15), transparent 50%),
    #f5f7fb;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo .logo { justify-content: center; margin-bottom: 12px; }
.login-card h1 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
}

/* Delete confirm form */
.inline-form { display: inline; }

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { height: 360px; max-width: 500px; width: 100%; margin: 0 auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .content-sidebar-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .content-sidebar-layout .sidebar {
    position: static;
    order: 2;
  }
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .detail-sidebar {
    position: static;
    order: 2;
  }
}

@media (max-width: 768px) {
  .site-header { box-shadow: 0 1px 0 var(--border-light); }
  .header-inner { gap: 12px; height: 64px; }
  :root { --header-h: 64px; }
  .logo { font-size: 1.25rem; gap: 8px; }
  .logo-icon { width: 32px; height: 32px; font-size: 1rem; }
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: 12px 16px; }
  .nav-toggle { display: grid; flex-shrink: 0; }
  .header-search { max-width: none; }
  .header-search, .header-search form { display: none; }
  .main-nav.open ~ .header-search,
  .main-nav.open ~ .header-search form { display: none; }
  .hero { padding: 48px 0 64px; }
  .hero-search { flex-direction: column; padding: 10px; }
  .hero-search .btn { width: 100%; }
  .hero-search input { padding: 12px 14px; font-size: 0.95rem; }
  .hero-stats { gap: 16px; flex-wrap: wrap; }
  .hero-visual { height: 340px; }
  .hero-card { padding: 16px 18px; }
  .hero-card-1 {
    left: 0;
    right: 20%;
    max-width: 80%;
    transform: rotate(-2deg);
  }
  .hero-card-2 {
    right: 0;
    left: 20%;
    max-width: 80%;
    transform: rotate(2deg);
  }
  .pun-float {
    padding: 12px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  .section { padding: 48px 0; }
  
  /* === CONCISE PUN BOX FOR MOBILE === */
  .pun-box {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    margin: 12px 0 !important;
    min-height: auto !important;
    height: auto !important;
  }
  .pun-text {
    flex: 1 !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }
  .pun-copy-btn {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    flex-shrink: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
    align-self: center !important;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .article-hero { padding: 32px 0 20px; }
  .author-card {
    flex-direction: column;
    text-align: center;
    padding: 24px;
    gap: 16px;
  }
  .author-avatar {
    margin: 0 auto;
    width: 88px;
    height: 88px;
  }
  .author-links {
    justify-content: center;
  }
  .share-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  .share-btn {
    font-size: 0.8rem;
    padding: 9px 10px;
  }
  .data-table-wrap { overflow-x: auto; }
  .data-table th:nth-child(3),
  .data-table td:nth-child(3) { display: none; }
  .preview-modal-inner { padding: 24px; }
}

@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero-visual { height: 320px; }
  .hero-card-1 {
    left: 0;
    right: 12%;
    max-width: 88%;
    transform: rotate(-1.5deg);
  }
  .hero-card-2 {
    right: 0;
    left: 12%;
    max-width: 88%;
    transform: rotate(1.5deg);
  }
  .pun-float {
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 0.88rem;
    line-height: 1.4;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-col h4 { margin-bottom: 14px; font-size: 0.95rem; }
  .footer-col li { margin-bottom: 8px; }
  .footer-col a { font-size: 0.85rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  /* Pun box styles are already handled in the 768px block */
  .page-title-row { flex-direction: column; align-items: flex-start; }
  .admin-nav { display: none; }
  .data-table th:nth-child(2),
  .data-table td:nth-child(2),
  .data-table th:nth-child(5),
  .data-table td:nth-child(5) { display: table-cell; }
}

@media (max-width: 400px) {
  .container, .container-sm { padding: 0 14px; }
  .hero-stat-num { font-size: 1.6rem; }
  .btn { padding: 10px 18px; font-size: 0.9rem; }
  .pun-text { font-size: 0.95rem; }
  .logo { font-size: 1.1rem; gap: 6px; }
  .logo-icon { width: 30px; height: 30px; border-radius: 8px; }
  .nav-toggle { width: 36px; height: 36px; font-size: 1rem; }
  .hero-visual { height: 300px; }
  .hero-card-1 { right: 8%; max-width: 92%; }
  .hero-card-2 { left: 8%; max-width: 92%; }
  .pun-float { font-size: 0.84rem; padding: 9px 11px; }
  .footer-grid { gap: 20px; }
  .footer-col h4 { font-size: 0.9rem; }
  .footer-col a { font-size: 0.82rem; }
}