/* TYPE top page - same tone as /type/b/ viewer. Keep this file ASCII-only:
   some servers send charset=Shift_JIS headers which would garble UTF-8 text. */
:root {
    color-scheme: light;
    --bg: #eeeeec; --surface: #fff; --surface-2: #f7f7f5; --hover: #eceff3;
    --text: #202124; --muted: #6b7078; --line: #cfd2d6; --accent: #2868a9;
    --accent-strong: #174f88; --accent-soft: #e5eff8; --name: #197044; --danger: #b3261e;
    font-family: "BIZ UDPGothic", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root { color-scheme: dark; --bg:#17191c; --surface:#222529; --surface-2:#1c1f22; --hover:#30343a; --text:#e7e8ea; --muted:#adb2b9; --line:#454a51; --accent-soft:#273b50; --name:#70c994; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); }
[v-cloak] { display: none; }
a { color: var(--accent); }
button { font: inherit; color: inherit; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 48px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-family: Arial, sans-serif; }
.brand-text { font-size: .95rem; font-weight: 700; }
.topbar-links { display: flex; gap: 4px; }
.topbar-links a { padding: 6px 10px; text-decoration: none; font-size: .78rem; font-weight: 700; }
.topbar-links a:hover { background: var(--hover); }

.page { max-width: 1080px; margin: 0 auto; padding: 16px 14px 40px; }
.page.narrow { max-width: 760px; }
.crumbs { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--muted); font-size: .74rem; }
.crumbs a { text-decoration: none; }
.crumbs b { color: var(--text); }
.crumbs .share-button { margin-left: auto; padding: 6px 11px; border: 1px solid var(--accent); background: var(--surface); color: var(--accent); cursor: pointer; font-size: .7rem; font-weight: 700; }
.crumbs .share-button:hover { background: var(--accent-soft); }

.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tile { min-width: 0; border: 1px solid var(--line); background: var(--surface); padding: 14px 16px; }
.tile > header h2 { overflow-wrap: anywhere; }
.tile > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tile > header h2 { margin: 0; font-size: .95rem; }
.tile > header button { padding: 4px 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: .68rem; }
.tile > header small { color: var(--muted); font-size: .68rem; }
.tile-badge { padding: 2px 8px; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700; }
.tile-note { margin: 6px 0; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.tile-action { display: inline-block; margin-top: 10px; padding: 8px 13px; background: var(--accent); color: #fff; text-decoration: none; font-size: .78rem; font-weight: 700; }
.tile-action:hover { background: var(--accent-strong); }

.board-tile .tile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.board-tile .tile-stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--surface-2); }
.board-tile dt { color: var(--muted); font-size: .68rem; }
.board-tile dd { margin: 0; font-size: 1.05rem; font-weight: 700; }
.total-tile .total-count { display: flex; align-items: baseline; gap: 8px; }
.total-tile strong { font-size: 2.2rem; }
.total-tile span { color: var(--muted); font-size: .78rem; }

.recent-tile, .news-tile { grid-column: 1 / -1; }
.recent-list, .news-list, .select-list { margin: 0; padding: 0; list-style: none; }
.recent-list li { border-bottom: 1px solid var(--line); }
.recent-list li:last-child { border-bottom: 0; }
.recent-list a { display: grid; gap: 3px; padding: 9px 4px; text-decoration: none; color: var(--text); }
.recent-list a:hover { background: var(--hover); }
.recent-meta { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .7rem; }
.board-chip { flex: 0 0 auto; padding: 1px 7px; background: var(--accent-soft); color: var(--accent); font-style: normal; font-weight: 700; font-size: .64rem; }
.recent-thread { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }
.recent-meta time { margin-left: auto; flex: 0 0 auto; color: var(--muted); font-size: .64rem; }
.recent-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }

.news-list li { border-bottom: 1px solid var(--line); }
.news-list li:last-child { border-bottom: 0; }
.news-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 4px; background: transparent; cursor: pointer; text-align: left; font-size: .8rem; }
.news-list button:hover { background: var(--hover); }
.news-list time { flex: 0 0 auto; color: var(--muted); font-size: .68rem; }
.news-body { margin: 0 4px 10px; padding: 10px 12px; background: var(--surface-2); white-space: pre-wrap; font-size: .78rem; line-height: 1.6; }

.select-list li { border-bottom: 1px solid var(--line); }
.select-list li:last-child { border-bottom: 0; }
.select-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 11px 6px; text-decoration: none; color: var(--text); font-weight: 700; }
.select-list a:hover { background: var(--hover); }
.select-list small { color: var(--muted); font-weight: 400; font-size: .7rem; }

.kako-tree { display: grid; gap: 6px; }
.tree-branch { min-width: 0; }
.tree-branch ol, .tree-branch li, .tree-branch a { max-width: 100%; }
.tree-branch .tree-node { padding: 6px 8px; background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 700; }
.tree-branch ol { margin: 0; padding: 0 0 0 14px; list-style: none; }
.tree-branch li { position: relative; padding-left: 14px; }
.tree-branch li::before { content: ""; position: absolute; top: 0; bottom: 50%; left: 0; width: 10px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.tree-branch li:not(:last-child)::after { content: ""; position: absolute; top: 50%; bottom: 0; left: 0; border-left: 2px solid var(--line); }
.tree-branch li { min-width: 0; }
.tree-branch a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; padding: 8px 6px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.tree-branch li:last-child a { border-bottom: 0; }
.tree-branch a:hover { background: var(--hover); }
.tree-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.tree-branch small { flex: 0 0 auto; color: var(--muted); font-size: .66rem; }

.thread-tile > header { flex-direction: column; align-items: flex-start; gap: 2px; border-bottom: 2px solid var(--text); padding-bottom: 8px; }
.kako-responses { margin: 0; padding: 0; list-style: none; }
.response-card { padding: 8px 2px 12px; border-bottom: 1px solid var(--line); }
.response-info { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: .68rem; }
.response-info b { color: var(--accent); }
.response-name { color: var(--name); font-weight: 700; }
.response-message { margin: 6px 0 0 18px; line-height: 1.65; overflow-wrap: anywhere; font-size: .88rem; }
.reply-link { padding: 0; background: transparent; color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 700; }

.toast { position: fixed; z-index: 130; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 8px 12px; background: #24272b; color: #fff; font-size: .72rem; box-shadow: 0 4px 12px rgb(0 0 0 / 25%); }

@media (max-width: 700px) {
    .tile-grid { grid-template-columns: 1fr; gap: 10px; }
    .page { padding: 10px 8px 30px; }
    .brand-text { font-size: .85rem; }
    .response-message { margin-left: 10px; }
}
