/* =============================================
   YabaiDict — Shared Stylesheet
   ============================================= */

/* ===== CSS VARIABLES (LIGHT) ===== */
:root {
  --bg: #FAFAF8;
  --white: #FFFFFF;
  --text: #1A1A1A;
  --text-mid: #555;
  --text-light: #888;
  --border: #E5E5E0;
  --border-light: #F0F0EC;
  --accent: #D1462F;
  --accent-bg: #FFF5F3;
  --teal: #0D9488;
  --teal-bg: #F0FDFA;
  --blue: #3B82F6;
  --blue-bg: #EFF6FF;
  --amber: #D97706;
  --amber-bg: #FFFBEB;
  --purple: #7C3AED;
  --purple-bg: #F5F3FF;
  --green: #16A34A;
  --green-bg: #F0FDF4;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --bg: #141414;
  --white: #1C1C1E;
  --text: #E8E8E8;
  --text-mid: #A0A0A0;
  --text-light: #6B6B6B;
  --border: #2C2C2E;
  --border-light: #232325;
  --accent: #FF6B56;
  --accent-bg: rgba(255,107,86,0.12);
  --teal: #2DD4BF;
  --teal-bg: rgba(45,212,191,0.10);
  --blue: #60A5FA;
  --blue-bg: rgba(96,165,250,0.10);
  --amber: #FBBF24;
  --amber-bg: rgba(251,191,36,0.10);
  --purple: #A78BFA;
  --purple-bg: rgba(167,139,250,0.10);
  --green: #4ADE80;
  --green-bg: rgba(74,222,128,0.10);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

/* ===== RESET ===== */
html { color-scheme: light dark; }
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); transition: background 0.3s, color 0.3s; }

body {
  font-family: 'Nunito', sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ===== MICRO DELIGHT ===== */
.cat-card, .rank-item, .new-card, .az-link {
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s, background 0.15s;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 50px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}

.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }
:root .theme-toggle .icon-sun { display: inline; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* ===== HEADER ===== */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-pixel {
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: 6px;
  image-rendering: pixelated;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-pixel svg { width: 18px; height: 18px; }

.logo-text {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-sub {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  margin-left: 6px;
}

nav {
  display: flex;
  gap: 24px;
  font-size: 14px;
  font-weight: 500;
  align-items: center;
  margin-left: auto;
  margin-right: 20px;
}

nav a {
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.15s;
}
nav a:hover { color: var(--accent); }

/* ===== HERO (TOP PAGE) ===== */
.hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: -40px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 12px;
  transform: rotate(-4deg) scale(1.15);
  opacity: 1;
}

.bg-word {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  border-radius: 10px;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: rgba(0,0,0,0.15);
  background: rgba(0,0,0,0.04);
  white-space: nowrap;
  user-select: none;
  transition: all 0.4s ease;
}

.bg-word:hover {
  color: var(--accent);
  background: var(--accent-bg);
  transform: scale(1.1);
  cursor: pointer;
}

.bg-word.pop-1 { color: rgba(209,70,47,0.22); background: rgba(209,70,47,0.07); }
.bg-word.pop-2 { color: rgba(13,148,136,0.22); background: rgba(13,148,136,0.07); }
.bg-word.pop-3 { color: rgba(124,58,237,0.22); background: rgba(124,58,237,0.07); }
.bg-word.pop-4 { color: rgba(59,130,246,0.22); background: rgba(59,130,246,0.07); }
.bg-word.pop-5 { color: rgba(217,119,6,0.22); background: rgba(217,119,6,0.07); }

.hero-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.45) 50%, rgba(250,250,248,0.9) 100%);
  transition: background 0.3s;
}

[data-theme="dark"] .hero-fade {
  background:
    radial-gradient(ellipse at center, rgba(20,20,20,0.75) 0%, rgba(20,20,20,0.4) 50%, rgba(20,20,20,0.9) 100%);
}

[data-theme="dark"] .hero { background: var(--white); }

[data-theme="dark"] .bg-word { color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); }
[data-theme="dark"] .bg-word.pop-1 { color: rgba(255,107,86,0.25); background: rgba(255,107,86,0.08); }
[data-theme="dark"] .bg-word.pop-2 { color: rgba(45,212,191,0.25); background: rgba(45,212,191,0.08); }
[data-theme="dark"] .bg-word.pop-3 { color: rgba(167,139,250,0.25); background: rgba(167,139,250,0.08); }
[data-theme="dark"] .bg-word.pop-4 { color: rgba(96,165,250,0.25); background: rgba(96,165,250,0.08); }
[data-theme="dark"] .bg-word.pop-5 { color: rgba(251,191,36,0.25); background: rgba(251,191,36,0.08); }

[data-theme="dark"] .search-input {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .native-badge {
  background: rgba(45,212,191,0.08);
  border-color: rgba(45,212,191,0.2);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 0 auto;
  padding: 64px 24px 56px;
}

.hero-mascot {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: #B2F6F9;
  border-radius: 12px;
  image-rendering: pixelated;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.hero-ja-label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.hero h1 {
  font-family: 'Nunito', sans-serif;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  color: var(--text);
  line-height: 1.3;
}

.h1-sub {
  color: var(--accent);
  font-style: italic;
  font-size: 28px;
  font-weight: 600;
}

.hero p {
  color: var(--text-mid);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--text-light);
}

.hero-stats .stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: block;
  font-family: 'IBM Plex Mono', monospace;
}

/* ===== SEARCH ===== */
.search-wrap {
  max-width: 560px;
  margin: 16px auto 0;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 16px;
  font-family: 'Nunito', sans-serif;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--text);
}

.search-input::placeholder { color: var(--text-light); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(209,70,47,0.08);
}

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

/* ===== SEARCH RESULTS DROPDOWN ===== */
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 50;
  text-align: left;
}

.search-results.active { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg); }

.search-result-word {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.search-result-reading {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  flex-shrink: 0;
}

.search-result-excerpt {
  font-size: 12px;
  color: var(--text-light);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-excerpt mark {
  background: var(--accent-bg);
  color: var(--accent);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

.search-no-results {
  padding: 16px 18px;
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
}

.search-hint {
  margin-top: 10px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-light);
}

.search-hint span {
  display: inline-block;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 20px;
  margin: 2px 3px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.search-hint span:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.native-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 18px;
  background: var(--teal-bg);
  color: var(--teal);
  border: 1px solid #B2DFDB;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
.main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Nunito', sans-serif;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .px-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  image-rendering: pixelated;
}

.see-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.see-all:hover { text-decoration: underline; }

.see-all-btn {
  display: inline-block;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.see-all-btn:hover { background: var(--accent); color: #fff; }

.entry-count { font-size: 14px; color: var(--text-light); font-weight: 500; }

/* ===== CATEGORIES ===== */
.categories {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 48px;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}

.cat-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.cat-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  image-rendering: pixelated;
}

.cat-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.cat-count { font-size: 12px; color: var(--text-light); font-family: 'IBM Plex Mono', monospace; }

/* ===== TWO COLUMN LAYOUT ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ===== RANKING LIST ===== */
.rank-list {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}

.rank-item:last-child { border-bottom: none; }
.rank-item:hover { background: var(--bg); }

.rank-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-num { color: var(--accent); font-size: 16px; }
.rank-item:nth-child(2) .rank-num { color: var(--amber); }
.rank-item:nth-child(3) .rank-num { color: var(--teal); }

.rank-word {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 17px;
}

.rank-reading { font-size: 12px; color: var(--text-light); margin-left: 4px; }

.rank-desc {
  font-size: 13px;
  color: var(--text-mid);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-formality {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.f-casual { background: var(--accent-bg); color: var(--accent); }
.f-mid { background: var(--amber-bg); color: var(--amber); }
.f-flex { background: var(--teal-bg); color: var(--teal); }

/* ===== NEW ENTRIES ===== */
.new-list { display: flex; flex-direction: column; gap: 10px; }

.new-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 14px;
}

.new-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.new-card-word {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 17px;
  min-width: 80px;
}

.new-card-meta { flex: 1; }
.new-card-desc { font-size: 13px; color: var(--text-mid); line-height: 1.5; }
.new-card-tags { display: flex; gap: 6px; margin-top: 4px; }

.tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-light);
  border: 1px solid var(--border-light);
}

.tag-era { background: var(--purple-bg); color: var(--purple); border-color: transparent; }
.tag-cat { background: var(--blue-bg); color: var(--blue); border-color: transparent; }

.new-card-date {
  font-size: 11px;
  color: var(--text-light);
  font-family: 'IBM Plex Mono', monospace;
  flex-shrink: 0;
}

/* ===== ABOUT ===== */
.about-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 48px;
}

.about-section h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-section p {
  color: var(--text-mid);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 12px;
}

.about-section p:last-child { margin-bottom: 0; }

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

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

.about-point { text-align: center; padding: 16px; }

.about-point-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  image-rendering: pixelated;
}

.about-point-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.about-point-desc { font-size: 13px; color: var(--text-light); line-height: 1.5; }

/* ===== BROWSE A-Z ===== */
.az-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 48px; }

.az-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-mid);
  background: var(--white);
  border: 1px solid var(--border);
}

.az-link:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.az-link.has-entries { color: var(--text); font-weight: 700; }

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}

footer a { color: var(--text-mid); text-decoration: none; }
footer a:hover { color: var(--accent); }

.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

/* =============================================
   ENTRY PAGE STYLES
   ============================================= */

/* ===== BREADCRUMB ===== */
.breadcrumb {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 24px;
  font-size: 12px;
  color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ===== ENTRY PAGE LAYOUT ===== */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
}

/* ===== ENTRY HEADER ===== */
.entry-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.entry-kanji {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.entry-info { flex: 1; padding-top: 4px; }

.entry-title {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 2px;
}

.entry-reading {
  font-size: 14px;
  color: var(--text-light);
  font-family: 'IBM Plex Mono', monospace;
  margin-bottom: 2px;
}

.entry-romaji {
  font-size: 13px;
  color: var(--text-mid);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.word-highlight {
  background: var(--accent-bg);
  color: var(--accent);
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}

.entry-tags { display: flex; flex-direction: column; gap: 8px; }
.tag-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.tag-casual { background: var(--accent-bg); color: var(--accent); border-color: #f0d0ca; }
.tag-category { background: var(--blue-bg); color: var(--blue); border-color: #c8ddfb; }

.freq {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: var(--teal-bg);
  color: var(--teal);
  border: 1px solid #b2e0db;
}

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.dot.off { background: #b2e0db; }
.freq-end { font-size: 10px; opacity: 0.7; }

/* ===== DEFINITION ===== */
.definition { margin-bottom: 32px; }

.definition p { font-size: 16px; line-height: 1.8; color: var(--text); }

.meaning-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.meaning-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid;
}

.meaning-box.positive { background: var(--teal-bg); border-color: #c8e8e5; }
.meaning-box.negative { background: var(--accent-bg); border-color: #f0d0ca; }

.meaning-box-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.meaning-box.positive .meaning-box-label { color: var(--teal); }
.meaning-box.negative .meaning-box-label { color: var(--accent); }

.meaning-box p { font-size: 13px; line-height: 1.6; color: var(--text); }

/* ===== ENTRY SECTIONS ===== */
.section { margin-bottom: 32px; }

.entry-section-title {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.px-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  image-rendering: pixelated;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

/* ===== EXAMPLES ===== */
.example {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}

.example:hover { border-color: var(--text-light); }

.example-jp {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 2px;
}

.example-jp mark {
  background: var(--amber-bg);
  color: var(--amber);
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 700;
}

.example-en { font-size: 14px; color: var(--text-mid); }

.example-context {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  font-style: italic;
}

.example-label {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.label-positive { background: var(--teal-bg); color: var(--teal); }
.label-negative { background: var(--accent-bg); color: var(--accent); }
.label-neutral { background: var(--blue-bg); color: var(--blue); }
.label-both { background: var(--purple-bg); color: var(--purple); }

/* ===== VARIATIONS ===== */
.var-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.var-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.var-table tr:last-child td { border-bottom: none; }

.var-table .var-word {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 18px;
  width: 100px;
}

.var-table .var-reading {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-light);
  width: 80px;
}

.var-table .var-desc { color: var(--text-mid); font-size: 13px; }

/* ===== RELATED ===== */
.related-list { display: flex; flex-wrap: wrap; gap: 8px; }

.related-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: all 0.15s;
  cursor: pointer;
}

.related-chip:hover { border-color: var(--accent); background: var(--accent-bg); }

/* ===== RELATED COLUMNS ===== */
.related-columns { display: flex; flex-direction: column; gap: 10px; }

.related-column-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.related-column-card:hover {
  border-color: var(--green);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.related-column-date { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.related-column-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.related-column-summary { font-size: 13px; color: var(--text-mid); line-height: 1.5; }

/* ===== RELATED ENTRIES (in columns) ===== */
.related-entries { display: flex; flex-direction: column; gap: 8px; }

.related-entry-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.related-entry-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.related-entry-word {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.related-entry-reading {
  font-size: 13px;
  color: var(--text-mid);
  flex-shrink: 0;
}

.related-entry-summary {
  font-size: 13px;
  color: var(--text-light);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-chip-kanji {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 18px;
}

.related-chip-text { font-size: 12px; color: var(--text-light); }

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 16px; }

.sidebar-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar-box-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-light);
  margin-bottom: 12px;
}

.native-take { font-size: 14px; line-height: 1.7; color: var(--text); }
.native-take p { margin-bottom: 10px; }
.native-take .author { font-size: 11px; color: var(--text-light); font-style: italic; }

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.score-row:last-child { border-bottom: none; }
.score-label { color: var(--text-mid); }

.score-bar {
  width: 80px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.score-fill { height: 100%; border-radius: 2px; }

.note-box {
  background: var(--amber-bg);
  border: 1px solid #f0deb3;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.note-box strong {
  display: block;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--amber);
  margin-bottom: 4px;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}

.nav-link:hover { border-color: var(--text-light); }
.nav-link.next { flex-direction: row-reverse; text-align: right; }

.nav-link-label { font-size: 11px; color: var(--text-light); }
.nav-link-word { font-size: 15px; font-weight: 600; }
.nav-link-kanji {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-light);
}

/* ===== ABOUT PAGE ===== */
.about-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.about-page-title {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.about-block {
  margin-bottom: 32px;
}

.about-block h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.about-block p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-mid);
  margin-bottom: 10px;
}

.about-block p:last-child { margin-bottom: 0; }

.about-list {
  list-style: none;
  padding: 0;
}

.about-list li {
  position: relative;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.about-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.about-page .about-grid {
  margin-bottom: 32px;
}

.about-contact {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--text);
  margin-top: 8px;
}

.contact-email svg {
  color: var(--text-light);
  flex-shrink: 0;
}

/* ===== 404 PAGE ===== */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 48px 24px;
}

.error-page-inner {
  text-align: center;
  max-width: 480px;
}

.error-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 96px;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  margin-bottom: 8px;
}

.error-title {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
}

.error-desc {
  font-size: 15px;
  color: var(--text-mid);
  margin-bottom: 28px;
  line-height: 1.6;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.error-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
}

.error-btn.primary {
  background: var(--accent);
  color: #fff;
}

.error-btn.primary:hover {
  opacity: 0.9;
}

.error-btn.secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}

.error-btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* =============================================
   COLUMN PAGE STYLES
   ============================================= */

/* ===== COLUMN ARTICLE ===== */
.column-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ===== LEGAL PAGES ===== */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.legal-page h1 { font-size: 28px; margin-bottom: 4px; }
.legal-page h2 { font-size: 18px; margin-top: 32px; margin-bottom: 8px; color: var(--text); }
.legal-page p { font-size: 15px; line-height: 1.8; color: var(--text-mid); margin-bottom: 12px; }
.legal-page ul { font-size: 15px; line-height: 1.8; color: var(--text-mid); padding-left: 24px; margin-bottom: 12px; }
.legal-page a { color: var(--accent); text-decoration: underline; }
.legal-updated { font-size: 13px; color: var(--text-light); margin-bottom: 24px; }
.data-processors-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.data-processors-table th,
.data-processors-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-processors-table th { font-weight: 600; color: var(--text); }
.data-processors-table td { color: var(--text-mid); }

.column-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.column-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.column-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--green-bg);
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.column-title {
  font-family: 'Nunito', sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.3px;
  margin-bottom: 12px;
  color: var(--text);
}

.column-summary {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-mid);
  margin-bottom: 16px;
}

.column-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-light);
}

.column-author {
  font-weight: 600;
  color: var(--text-mid);
}

.column-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

/* ===== COLUMN BODY (Markdown) ===== */
.column-body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}

.column-body p {
  margin-bottom: 1.5em;
}

.column-body h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-top: 2.5em;
  margin-bottom: 0.8em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--text);
  color: var(--text);
}

.column-body h3 {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.6em;
  color: var(--text);
}

.column-body strong {
  font-weight: 700;
  color: var(--text);
}

.column-body em {
  font-style: italic;
}

.column-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.column-body a:hover {
  text-decoration-thickness: 2px;
}

.column-body ul,
.column-body ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}

.column-body li {
  margin-bottom: 0.5em;
  line-height: 1.75;
}

.column-body blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-mid);
}

.column-body blockquote p {
  margin-bottom: 0.5em;
}

.column-body blockquote p:last-child {
  margin-bottom: 0;
}

.column-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
}

.column-body pre {
  margin: 1.5em 0;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.column-body pre code {
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.column-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* ===== COLUMN BACK LINK ===== */
.column-back {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.column-back a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.15s;
}

.column-back a:hover {
  color: var(--accent);
}

/* ===== COLUMNS INDEX PAGE ===== */
.columns-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.columns-page-title {
  font-family: 'Nunito', sans-serif;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.columns-page-desc {
  font-size: 15px;
  color: var(--text-mid);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.columns-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.column-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.2s;
}

.column-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.column-card-inner {
  padding: 24px;
}

.column-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.column-card-title {
  font-family: 'Nunito', sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text);
}

.column-card-summary {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-mid);
  margin-bottom: 12px;
}

.column-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-light);
}

.column-card-author {
  font-weight: 600;
  color: var(--text-mid);
}

.column-card-date {
  font-family: 'IBM Plex Mono', monospace;
}

.columns-empty {
  font-size: 15px;
  color: var(--text-light);
  text-align: center;
  padding: 48px 24px;
}

/* ===== COLUMNS SECTION ON TOP PAGE ===== */
.column-list-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
}

.column-item-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.column-item-top:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.column-item-top-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-light);
  flex-shrink: 0;
  padding-top: 3px;
}

.column-item-top-body {
  flex: 1;
  min-width: 0;
}

.column-item-top-title {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 4px;
}

.column-item-top-summary {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =============================================
   AD SLOT STYLES
   ============================================= */

.ad-slot {
  display: none; /* AdSense承認後に削除 */
  margin: 32px 0;
  text-align: center;
  overflow: hidden;
}

/* バナー広告（セクション間） */
.ad-banner {
  max-width: 728px;
  margin-left: auto;
  margin-right: auto;
  min-height: 90px;
}

/* レクタングル広告（サイドバー） */
.ad-rectangle {
  margin: 20px 0;
}

.ad-rectangle ins {
  max-width: 300px;
  min-height: 250px;
}

/* 記事中広告 */
.ad-in-article {
  margin: 40px 0;
  padding: 24px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

/* Amazon広告 */
.ad-amazon {
  margin: 32px 0;
}

.ad-amazon-inner {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow: hidden;
}

.ad-amazon-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 12px;
}

/* サイドバー内広告のsticky */
.sidebar .ad-rectangle,
.sidebar .ad-amazon {
  position: sticky;
  top: 80px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .page { grid-template-columns: 1fr; }
  .entry-kanji { font-size: 40px; }
  .entry-title { font-size: 22px; }
  .meaning-split { grid-template-columns: 1fr; }
  .bottom-nav { flex-direction: column; }
}

@media (max-width: 600px) {
  .hero-inner { padding: 40px 20px 36px; }
  .hero h1 { font-size: 26px; }
  .hero-stats { gap: 20px; }
  .hero-stats .stat-num { font-size: 18px; }
  .categories { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat-card { padding: 14px 10px; }
  .cat-icon { width: 32px; height: 32px; }
  .footer-inner { flex-direction: column; gap: 12px; }
  .header-inner nav { display: none; }
  .column-title { font-size: 24px; }
  .column-summary { font-size: 15px; }
  .column-body { font-size: 15px; }
  .column-body h2 { font-size: 19px; }
  .column-item-top { flex-direction: column; gap: 6px; }
  .ad-banner { min-height: 50px; }
  .ad-slot { margin: 24px 0; }
  .sidebar .ad-rectangle,
  .sidebar .ad-amazon { position: static; }
}
