* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #eef2ff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #1a1a1a;
    min-height: 100vh;
}

a { color: #34345c; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
#header {
    background: #af0a0f;
    color: #fff;
    text-align: center;
    padding: 6px 12px;
}

#header > a { color: #fff; font-size: 20px; font-weight: bold; }
#header > a:hover { color: #ffcccc; text-decoration: none; }

#board-nav {
    margin-top: 4px;
    font-size: 13px;
    color: #ffaaaa;
}

#board-nav a { color: #ffaaaa; margin: 0 3px; font-size: 13px; font-weight: normal; }
#board-nav a:hover { color: #fff; text-decoration: none; }

/* ── Layout ── */
#content {
    max-width: 900px;
    margin: 16px auto;
    padding: 0 12px;
}

footer {
    text-align: center;
    font-size: 11px;
    color: #888;
    padding: 24px 0;
}

/* ── Flash ── */
.flash {
    padding: 6px 10px;
    margin-bottom: 12px;
    border: 1px solid #4caf50;
    background: #f0fff0;
    color: #2e7d32;
}

/* ── Board list (index) ── */
.board-index-title {
    text-align: center;
    margin-bottom: 16px;
}

.board-index-title h1 {
    font-size: 22px;
    color: #af0a0f;
}

.board-index-title p {
    color: #666;
    font-size: 11px;
    margin-top: 2px;
}

.board-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #888;
    max-width: 600px;
    margin: 0 auto;
}

.board-table caption {
    background: #af0a0f;
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    padding: 3px 6px;
    text-align: left;
}

.board-table th {
    background: #d6daf0;
    padding: 3px 8px;
    text-align: left;
    border-bottom: 1px solid #aaa;
    font-size: 11px;
}

.board-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.board-table tr:last-child td { border-bottom: none; }
.board-table tr:hover td { background: #f5f5ff; }
.board-table .slug { font-weight: bold; }
.board-table .count { text-align: right; color: #888; }

/* ── Board heading ── */
.board-title {
    text-align: center;
    margin-bottom: 12px;
}

.board-title h1 { font-size: 20px; color: #af0a0f; }
.board-title p { color: #666; font-size: 11px; }

/* ── Post form ── */
.post-form {
    background: #fff;
    border: 1px solid #aaa;
    margin-bottom: 16px;
}

.post-form legend {
    background: #af0a0f;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    display: block;
    width: 100%;
}

.post-form table {
    padding: 8px;
    width: 100%;
}

.post-form td.label {
    text-align: right;
    padding: 3px 8px 3px 0;
    color: #555;
    width: 90px;
    vertical-align: top;
    padding-top: 5px;
}

.post-form input[type="text"],
.post-form textarea {
    border: 1px solid #aaa;
    padding: 2px 4px;
    font-size: 12px;
    font-family: inherit;
}

.post-form input[type="text"]:focus,
.post-form textarea:focus {
    outline: none;
    border-color: #7070cc;
}

.post-form textarea { resize: vertical; }

.post-form .hint { color: #999; font-size: 11px; margin-top: 2px; }

.post-form .error { color: #c00; font-size: 11px; margin-top: 2px; }

.btn-submit {
    background: #af0a0f;
    color: #fff;
    border: none;
    padding: 3px 12px;
    font-size: 12px;
    cursor: pointer;
}

.btn-submit:hover { background: #8b0000; }

/* ── Thread on board page ── */
.thread-preview {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #c8cde8;
}

.thread-preview:last-of-type { border-bottom: none; }

/* ── Post header ── */
.post-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}

.post-subject { font-weight: bold; color: #0f0c5d; font-size: 13px; }
.post-name { color: #117743; font-weight: bold; }
.post-date { color: #888; }
.post-num { color: #aaa; font-size: 11px; }
.post-tag { color: #888; font-size: 11px; }
.post-link { font-weight: bold; font-size: 11px; }
.post-sage { color: #aaa; font-size: 11px; }

/* ── Post body ── */
.post-body {
    display: inline-flex;
    gap: 10px;
    background: #d6daf0;
    border: 1px solid #b7c5d9;
    padding: 6px 8px;
    max-width: 720px;
}

.post-image a { display: block; }

.post-image img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border: 1px solid #aaa;
    display: block;
}

.post-image-meta {
    color: #888;
    font-size: 11px;
    margin-top: 2px;
    line-height: 1.4;
}

.post-comment {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

/* ── Thread page ── */
.thread-post { margin-bottom: 10px; }
.thread-post.reply { margin-left: 20px; }

/* ── Locked notice ── */
.locked-notice {
    background: #fff8dc;
    border: 1px solid #e0c060;
    color: #806000;
    padding: 6px 10px;
    margin-bottom: 12px;
    font-size: 12px;
}

/* ── Breadcrumb ── */
.breadcrumb {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

/* ── Back link ── */
.back-link { margin-top: 16px; font-size: 12px; }

/* ── Pagination ── */
.pagination { margin-top: 12px; font-size: 12px; }
.pagination nav { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Comment markup ── */
.greentext { color: #789922; }
.quotelink { color: #d00; font-weight: bold; }
.quotelink:hover { text-decoration: underline; color: #900; }
.spoiler { background: #1a1a1a; color: #1a1a1a; cursor: pointer; }
.spoiler:hover { color: #eef2ff; }

/* ── Delete form ── */
.post-delete { margin-top: 4px; font-size: 11px; }
.post-delete summary { color: #aaa; cursor: pointer; display: inline; list-style: none; }
.post-delete summary:hover { color: #c00; }
.post-delete summary::-webkit-details-marker { display: none; }
.post-delete form { display: inline-flex; gap: 4px; align-items: center; margin-top: 2px; }
.post-delete input[type="password"] {
    border: 1px solid #aaa;
    padding: 1px 4px;
    font-size: 11px;
}
.btn-delete {
    background: #555;
    color: #fff;
    border: none;
    padding: 1px 8px;
    font-size: 11px;
    cursor: pointer;
}
.btn-delete:hover { background: #c00; }

/* ── Catalog ── */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.catalog-item {
    display: block;
    background: #fff;
    border: 1px solid #b7c5d9;
    padding: 4px;
    text-align: center;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

.catalog-item:hover { border-color: #af0a0f; background: #f5f5ff; text-decoration: none; }

.catalog-item img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    display: block;
    margin: 0 auto 4px;
}

.catalog-no-image {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 11px;
    background: #f0f0f8;
    margin-bottom: 4px;
}

.catalog-info { font-size: 11px; text-align: left; }
.catalog-replies { color: #888; margin-bottom: 2px; }
.catalog-subject { font-weight: bold; color: #0f0c5d; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-excerpt { color: #444; line-height: 1.3; max-height: 3.9em; overflow: hidden; }
