/* ===============================
   ベースカラー（ダーク／ライト）
   =============================== */
:root {
  color-scheme: dark light;
  /* 初期値はダーク寄り */
  --bg:        #0f1115;
  --card:      #161a1f;
  --text:      #f5f5ff;
  --muted:     #a9b1c7;
  --accent:    #9b87ff;
  --chip:      #202632;
  --border:    #303646;
}

/* data-theme="light" のときだけライト色 */
:root[data-theme="light"] {
  --bg:        #f4f5fb;
  --card:      #ffffff;
  --text:      #17151f;
  --muted:     #6c6b7a;
  --accent:    #7b5cff;
  --chip:      #ece9ff;
  --border:    #d5d6e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI",
        Roboto, "Noto Sans JP", "Noto Sans Khmer", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ヘッダー */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 14px;
}
.brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand .logo{
  margin:0;
  font-size:20px;
  font-weight:800;
  letter-spacing:.2px;
}
.theme{
  border:0;
  background:transparent;
  color:var(--muted);
  font-size:22px;
  cursor:pointer;
}
.searchbar{
  display:flex;
  gap:8px;
  margin-top:6px;
}
.searchbar input{
  flex:1;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text);
}
.searchbar input::placeholder{
  color:var(--muted);
}
.searchbar button{
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--chip);
  color:var(--text);
  cursor:pointer;
  white-space:nowrap;
}

/* おすすめカード */
.chip-card {
  margin-top: 10px;
}

/* おすすめチップ */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.chips button {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

/* 本文 */
main .section {
  margin: 10px auto;
  max-width: 960px;
  padding: 0 14px 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
}

.row {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}
.row:hover {
  border-color: var(--accent);
}

.pos {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.pill {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--border);
  font-size: 12px;
}

.back {
  display: inline-block;
  margin: 10px 0 14px;
  color: var(--accent);
  cursor: pointer;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

/* フッター */
footer {
  border-top: 1px solid var(--border);
  margin-top: 18px;
}
.footer-nav {
  font-size: 14px;
}

.footer-nav a {
  margin-right: 10px;
  color: var(--accent);
}

.footer-nav a.is-active {
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
}
small {
  color: var(--muted);
}

/* AdSense 未充填時に自動で畳む */
.ad-slot {
  margin: 8px 0;
  background: transparent;
}
.ad-slot[hidden] {
  display: none !important;
}
.ad-slot .adsbygoogle {
  display: block;
  background: transparent !important; /* ★白背景を消す */
}
.ad-slot .adsbygoogle[data-ad-status="unfilled"] {
  display: none;
}

@media (max-width: 600px) {
  .brand .logo {
    font-size: 18px;
  }
  main .section {
    padding: 0 10px 16px;
  }
}

/* 例文ブロック（詳細画面） */
.examples {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.example-item { }

.example-line {
  line-height: 1.5;
}

.ex-no {
  font-weight: 600;
  margin-right: 4px;
}

.example-km {
  color: var(--muted);
}

/* 汎用の薄いテキスト（説明など） */
.muted {
  color: var(--muted);
  font-size: 14px;
}

/* お問い合わせフォーム */
.contact-form {
  max-width: 640px;
  margin: 0 auto;
}
.contact-form label {
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.contact-form textarea {
  resize: vertical;
}
.contact-form button {
  margin-top: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.contact-form button:hover {
  opacity: .9;
}
.contact-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

/* 日本語学習ミニガイド */

.kana-section-title {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.kana-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0.75rem;
}

.kana-cell {
  flex: 0 0 calc(20% - 8px); /* 1行に最大5つ並ぶイメージ */
  min-width: 70px;
  padding: 6px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

[data-theme="light"] .kana-cell {
  background: rgba(0, 0, 0, 0.03);
}

.kana-jp {
  display: block;
  font-size: 1.2rem;
  line-height: 1.2;
}

.kana-ro {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  line-height: 1.2;
}

.kana-km {
  display: block;
  font-size: 0.85rem;
  line-height: 1.2;
}
