@charset "utf-8";

:root{
  /* Light theme */
  --bg:#f6f7fb;
  --card:#ffffff;
  --card2:#ffffff;
  --line:rgba(15,23,42,.12);
  --text:rgba(15,23,42,.92);
  --muted:rgba(15,23,42,.62);

  --accent:#2563eb;   /* primary */
  --accent2:#14b8a6;  /* teal */

  --ok:#16a34a;
  --warn:#f59e0b;
  --err:#ef4444;

  --regist:#ff5460;

  --shadow: 0 10px 28px rgba(15,23,42,.08);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans JP", Arial, sans-serif;
  background:
    radial-gradient(900px 700px at 15% 0%, rgba(37,99,235,.10) 0%, rgba(246,247,251,0) 55%),
    radial-gradient(900px 700px at 85% 10%, rgba(20,184,166,.08) 0%, rgba(246,247,251,0) 60%),
    var(--bg);
  color:var(--text);
}

a{color:inherit;text-decoration:none}
a:hover{opacity:.92}


/* Auto link 他 */
a.autolink,
.table td a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a.autolink:hover,
.table td a:hover {
  opacity: 1;
}
.wrap{max-width:1100px;margin:0 auto;padding:0 16px}

/* Top bar */
.topbar{
  position:sticky; top:0; z-index:50;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar .wrap{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px}
.brand a{font-weight:800;letter-spacing:.02em}
.topnav{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.topnav a{padding:8px 10px;border-radius:10px}
/*.topnav a:hover{background:rgba(15,23,42,.06)}*/
.pill{background:rgba(15,23,42,.04);border:1px solid var(--line)}

.footer{border-top:1px solid var(--line);margin-top:26px;padding:22px 0;color:var(--muted)}
.muted{color:var(--muted)}

/* Flash */
.flashes{margin:16px 0;display:grid;gap:10px}
.flash{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.80);
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}
.flash.ok{border-color:rgba(22,163,74,.35)}
.flash.warn{border-color:rgba(245,158,11,.35)}
.flash.err{border-color:rgba(239,68,68,.35)}

/* ようこそ〜〜さん */
.welcome{
  margin:16px 0 0;
/*padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: #fff;*/
  font-size:16px;
}

/* Layout */
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:16px;
  margin-top:18px;
}

/* Index: search block */
.search-fields{
  display:grid;
  gap:12px;
}
.search-fields .field{
  margin:0;
}
@media (min-width: 600px){
  .search-fields{
    grid-template-columns: 240px 1fr; /* カテゴリ / キーワード */
    align-items:end;
  }
}

.search-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:center; /* 検索・リセットを中央へ */
  margin-top: 1rem;
}

/* Index: ask button (between search and list) */
.askbar{
  margin: 0;
}
.askbar .btn.primary{
  max-width:560px;
  margin:0 auto;
}

/* Card */
.card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow: var(--shadow);
  overflow:hidden;
  margin: 2rem 0;
}
.card .hd{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  background: #f6faff;
}
.card .bd{padding:14px}

/* Buttons */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 12px;border-radius:14px;
  border:1px solid var(--line);
  background: rgba(15,23,42,.04);
  cursor:pointer;
  color:var(--text);
}
button.btn,
input.btn{
  font: inherit;
}

/*.btn:hover{background:rgba(15,23,42,.06)}*/
.btn.primary{background:var(--accent);border-color:rgba(37,99,235,.30);color:#fff;display: block;text-align: center;}
.btn.primary:hover{filter:brightness(1.03)}
.btn.ghost{background:transparent}
.btn.small{padding:7px 10px;border-radius:12px;font-size:14px}
.btn.regist{background:var(--regist);color:#fff;display: block;text-align: center;}

/* Forms */
.field{display:grid;gap:8px;margin:10px 0 30px;}
label{color:var(--muted);font-size:13px}
.field label {font-weight: bold;}

input[type="text"], input[type="email"], input[type="password"], select, textarea{
  width:100%;
  border-radius:14px;
  padding:10px 12px;
  border:1px solid var(--line);
  background: #fff;
  color: var(--text);
  outline:none;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus, textarea:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
textarea{min-height:160px;resize:vertical}

/* Table */
.table{
  width:100%;
  border-collapse:collapse;
}
.table th,.table td{
  border-bottom:1px solid var(--line);
  padding:10px 8px;
  text-align:left;
  vertical-align:top;
}
.table th{color:var(--muted);font-weight:700;font-size:13px}

@media (max-width: 800px){
  /* スレッド一覧：タイトル以外を非表示 */
  .thread-table th:not(.col-title),
  .thread-table td:not(.col-title){
    display:none;
  }

  /* タイトルが縦に割れないように1行表示（必要なら省略） */
  .thread-table td.col-title a{
    display:block;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
}

/* Badges */
.badge{
  display:inline-flex;align-items:center;
  padding:4px 10px;border-radius:999px;
  border:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
  background: rgba(15,23,42,.03);
}
.badge.open{border-color:rgba(20,184,166,.92);background:rgba(20,184,166,.92);color:#fff}
.badge.solved{border-color:rgba(22,163,74,.35);color:rgba(15,23,42,.78)}
.badge.closed{border-color:rgba(245,158,11,.35);color:rgba(15,23,42,.78)}

.badge.new{border-color:rgba(239,68,68,.35);color:rgba(239,68,68,.92);background:rgba(239,68,68,.06)}
.badge.up{border-color:rgba(245,158,11,.35);color:rgba(245,158,11,.92);background:rgba(245,158,11,.06)}
.thread-mark{margin-left:8px}
@media (max-width: 800px){
  .thread-mark{margin-left:0;margin-top:6px}
}

.refmark{
  margin-left:6px;
  font-size:12px;
  line-height:1;
  opacity:.7;
}
.refurl-details{
  display:inline-block;
  margin-left:6px;
  vertical-align:middle;
}
.refurl-details summary{
  display:inline;
  cursor:pointer;
  list-style:none;
}
.refurl-details summary::-webkit-details-marker{
  display:none;
}
.refurl-box{
  margin-top:8px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card);
  max-width:560px;
  word-break:break-all;
  font-size:12px;
}
.refurl-row{
  display:flex;
  gap:8px;
  align-items:flex-start;
}
.refurl-row .label{
  flex:0 0 auto;
  color:var(--muted);
}
.refurl-row .val{
  flex:1 1 auto;
}


/* Posts */
.post{
  border-top:1px solid var(--line);
  padding:14px;
  background: rgba(255,255,255,.92);
}
.post:first-child{border-top:none}
.post .meta{
  display:flex;gap:10px;flex-wrap:wrap;
  color:var(--muted);
  font-size:13px;
  margin-bottom:10px
}
.post .body{white-space:pre-wrap;line-height:1.75;overflow-wrap:anywhere}
.post .body a.autolink{word-break:break-word}

/* Question (asker) */
.post.asker{
/*  background: #fff3f3;
  border-left: 8px solid #ff7477;*/
  background: #effffd;
  border-left: 8px solid var(--accent2);
}

/* Staff (support) */
.post.staff{
  background: #eff6ff; /* very light blue */
  border-left: 8px solid #2563eb;
}
.post.staff .meta > div:first-child{
  font-weight:800;
}
.post.staff .meta > div:first-child::before{
  content: "サポート ";
  color: rgba(37,99,235,.95);
}

/* Notice */
.notice{
  margin:14px 0;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.88);
}

.hr{height:1px;background:var(--line);margin:14px 0}

/* Admin: unreplied highlight */
.table tr.row-unreplied td{
  background: rgba(245,158,11,.08);
}
.table tr.row-unreplied td:first-child{
  border-left: 6px solid rgba(245,158,11,.75);
}

.only-link{
  text-align:center;
  padding:56px 0;
}

.flash-plain{
  text-align:center;
  padding:6px 0;
}


/* 本登録待ちメッセージだけ強調（赤文字） */
.flash.pending{
  color:#b91c1c;
  font-weight:700;
  border-color:rgba(239,68,68,.35);
}


/* 休止モードのお知らせ（ヘッダー直下） */
.site-notice{margin:16px 0 0}
.site-notice__inner{
  padding:14px 16px;
  border-radius:16px;
  background: #ff0000;
  color: #fff;
}
.site-notice__title{font-weight:800;margin-bottom:6px}
.site-notice__msg{line-height:1.7}
