/* KakologInfo — Claude Design「5ちゃんねる過去ログ検索UI」を静的CSS化したもの。
   トークンとコンポーネントの値はデザイン原本（KakologSearch.dc.html）に一致させている。 */

:root {
  --background: #f2f2f5;
  --foreground: #1d1d1f;
  --card: #ffffff;
  --primary: #0071e3;
  --primary-hover: #0077ed;
  --muted-foreground: #86868b;
  --quiet: #6e6e73;
  --border: rgba(0, 0, 0, 0.06);
  --input: rgba(0, 0, 0, 0.04);
  --ring: #0071e3;
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: #0058b0;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
  border-radius: 6px;
}

::selection {
  background: rgba(0, 113, 227, 0.18);
}

input,
select,
button,
textarea {
  font: inherit;
}

select {
  appearance: none;
}

button {
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 60ms !important;
  }
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 auto;
  width: 100%;
  max-width: 1140px;
  padding: 12px 12px 4px;
  color: #fff;
}

.header-bar {
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #000000c2;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: inherit;
}

.brand:hover {
  color: inherit;
  opacity: .85;
}

.brand-icon {
  width: 15px;
  height: 15px;
}

.brand-text {
  display: grid;
  line-height: 1.2;
}

.brand-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.tabs-list {
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px;
  font-size: 12.5px;
}

.tabs-trigger {
  height: 26px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}

.tabs-trigger:hover {
  color: #fff;
}

.tabs-trigger.active {
  background: #fff;
  color: var(--foreground);
  font-weight: 500;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background-color .15s ease, transform .15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(.95);
}

.icon-btn.active {
  background: rgba(255, 255, 255, 0.15);
}

.gear-icon {
  width: 15px;
  height: 15px;
}

.star {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.star.on {
  color: #ffb100;
}

.menu-btn {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.burger {
  display: grid;
  gap: 4px;
  width: 17px;
}

.bar {
  height: 1.6px;
  width: 100%;
  background: #fff;
  border-radius: 9999px;
  transition: transform .2s ease, opacity .2s ease;
}

.menu-open #barTop {
  transform: translateY(5.6px) rotate(45deg);
}

.menu-open #barMid {
  opacity: 0;
}

.menu-open #barBot {
  transform: translateY(-5.6px) rotate(-45deg);
}

.desktop-only {
  display: grid;
}

.mobile-only {
  display: none;
}

@media (max-width: 639px) {
  .tabs-list {
    display: none;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: grid;
  }
}

.mobile-menu {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .25s ease-out, opacity .25s ease-out;
}

.mobile-menu.open {
  max-height: 360px;
  opacity: 1;
}

.dropdown-menu {
  margin-top: 6px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: var(--radius);
  font-size: 13.5px;
  background-color: #2f2f2f;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.8);
  text-align: left;
  transition: background-color .15s ease, color .15s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dropdown-item.active {
  background: #fff;
  color: var(--foreground);
  font-weight: 500;
}

.dropdown-sep {
  height: 1px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- ポップオーバー（設定） ---------- */
.popover {
  background: #fff;
  color: var(--foreground);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--border), 0 8px 28px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  margin-top: 6px;
}

.popover-head {
  padding: 0 14px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popover-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.link-quiet {
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--muted-foreground);
  transition: color .15s ease;
}

.link-quiet:hover {
  color: var(--foreground);
}

.settings-body {
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12.5px;
}

.ng-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ng-head h3 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
}

.ng-count {
  font-size: 11px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* ---------- 共通部品 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
}

.card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 11.5px;
  color: var(--muted-foreground);
}

.sep {
  height: 1px;
  background: var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.btn:active {
  transform: scale(.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  flex-shrink: 0;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07);
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.03);
}

.btn-outline.active {
  background: #1d1d1f;
  color: #fff;
  box-shadow: none;
}

.btn-outline.ellipsis {
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
  min-width: 0;
  padding: 0 4px;
  font-size: 12px;
  pointer-events: none;
}

.btn-outline:disabled {
  pointer-events: none;
  background: rgba(255, 255, 255, 0.6);
  color: #c7c7cc;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--input);
  transition: background-color .15s ease, box-shadow .15s ease;
  flex: 1;
}

.input-wrapper:focus-within {
  background: #fff;
  box-shadow: 0 0 0 2px var(--ring);
}

.input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--foreground);
}

.input::placeholder {
  color: #a1a1a6;
}

.search-icon {
  width: 15px;
  height: 15px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.clear-btn {
  border: 0;
  background: none;
  flex-shrink: 0;
  color: var(--muted-foreground);
  font-size: 13px;
  transition: color .15s ease;
}

.clear-btn:hover {
  color: var(--foreground);
}

.select-box {
  position: relative;
}

.select-trigger {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--input);
  font-size: 12.5px;
  color: var(--foreground);
  max-width: 220px;
  transition: background-color .15s ease;
}

.select-trigger:hover {
  background: rgba(0, 0, 0, 0.07);
}

.select-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.textarea {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.045);
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--foreground);
  outline: none;
  resize: vertical;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 2px var(--ring);
}

.textarea::placeholder {
  color: #a1a1a6;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 9999px;
  font-size: 11.5px;
  background: rgba(0, 0, 0, 0.045);
  color: var(--foreground);
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.badge:hover {
  background: rgba(0, 0, 0, 0.08);
}

.badge:active {
  transform: scale(.95);
}

.badge.active {
  background: #1d1d1f;
  color: #fff;
}

/* ---------- レイアウト ---------- */
.main {
  flex: 1;
  margin: 0 auto;
  width: 100%;
  max-width: 1140px;
  padding: 12px;
  display: grid;
  gap: 12px;
  align-items: start;
  grid-template-columns: 1fr;
}

.main.with-rail {
  grid-template-columns: 1fr 312px;
}

@media (max-width: 1023px) {
  .main.with-rail {
    grid-template-columns: 1fr;
  }
}

.main-col {
  min-width: 0;
  display: grid;
  gap: 10px;
}

/* タブごとのビュー内も同じ間隔で区切る（検索カード・件数行・結果・ページャ） */
#viewList,
#viewFavs,
#viewWords,
#viewAbout {
  display: grid;
  gap: 10px;
}

/* display 指定が hidden 属性に勝ってしまわないように */
[hidden] {
  display: none !important;
}

.rail {
  display: grid;
  gap: 10px;
}

/* ---------- 検索フォーム・フィルタ ---------- */
.search-form {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filters {
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.push-right {
  margin-left: auto;
}

.quick-boards {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.scope-line {
  padding: 0 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--quiet);
  font-variant-numeric: tabular-nums;
}

.scope {
  color: var(--foreground);
}

.notice {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #fff8e6;
  box-shadow: 0 0 0 1px rgba(200, 150, 0, 0.25);
  font-size: 12.5px;
  line-height: 1.7;
}

.notice.error {
  background: #fdecec;
  box-shadow: 0 0 0 1px rgba(200, 40, 40, 0.25);
}

/* ---------- 検索結果 ---------- */
.row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.055);
  transition: background-color .15s ease;
}

.row:last-child {
  border-bottom: 0;
}

.row:hover {
  background: rgba(0, 0, 0, 0.018);
}

.row-link {
  min-width: 0;
  flex: 1;
  display: block;
  transition: opacity .15s ease;
}

.row-link:active {
  opacity: .7;
}

.row-title {
  display: block;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--primary);
  overflow-wrap: anywhere;
}

.row-title .hl {
  background: rgba(255, 204, 0, 0.34);
  border-radius: 3px;
}

.row-res {
  color: var(--quiet);
}

.row-meta {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  font-size: 11px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.row-board {
  color: var(--quiet);
}

.fav-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background-color .15s ease, transform .15s ease;
}

.fav-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.fav-btn:active {
  transform: scale(.9);
}

.fav-btn .fs {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.2);
}

.fav-btn .fs.on {
  color: #ffb100;
}

.empty {
  padding: 40px 16px;
  text-align: center;
}

.empty-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
}

.empty-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.7;
}

.welcome {
  padding: 44px 16px;
  text-align: center;
}

.welcome-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.welcome-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted-foreground);
  line-height: 1.8;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}

/* ---------- ホットワード（初版非表示。CSSは温存） ---------- */
.hotwords {
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: baseline;
}

.rail-words {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: baseline;
  line-height: 1.3;
}

.rail-word {
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--foreground);
  transition: color .15s ease, transform .15s ease;
}

.rail-word:hover {
  color: var(--primary);
}

.rail-word:active {
  transform: scale(.95);
}

/* ---------- About ---------- */
.about-body {
  padding: 16px 14px;
  display: grid;
  gap: 20px;

}

.about-lead {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
}

.about-sec {
  display: grid;
  gap: 6px;
}

.about-sec h3 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
}

.syntax-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 12.5px;
  line-height: 1.7;
}

.syntax-grid code {
  color: var(--quiet);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat {
  color: var(--muted-foreground);
}

.stat-val {
  display: block;
  color: var(--foreground);
}

.about-contact {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--quiet);
}

/* ---------- フッター ---------- */
.footer {
  margin: 0 auto;
  width: 100%;
  max-width: 1140px;
  padding: 24px 16px;
  font-size: 11px;
  color: var(--muted-foreground);
  line-height: 1.7;
  text-align: center;
}