/* ============================================================
   SmartDiary Forum — matches the official site design
   (navy #003366 / blue #007bff, light cards)
   ============================================================ */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN",
                 "Hiragino Sans", "Meiryo", sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.8;
}

a { color: #007bff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header ---- */
.main-header {
    background: #fff;
    padding: 20px;
    border-bottom: 2px solid #003366;
    text-align: center;
}
.main-header h1 { margin: 0; font-size: 1.5rem; color: #003366; }

/* ---- Nav bar ---- */
.bbs-nav { background: #003366; }
.bbs-nav-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 22px;
}
.bbs-nav-inner a {
    color: #fff;
    display: inline-block;
    padding: 12px 2px;
    font-size: .9rem;
}
.bbs-nav-inner a:hover { color: #cfe2ff; text-decoration: none; }
.bbs-nav-inner a:last-child { margin-left: auto; }

/* ---- Wrapper ---- */
.bbs-wrap {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 20px;
}

.bbs-h2 {
    font-size: 1.25rem;
    color: #003366;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e6ebf1;
}

/* ---- Two-column: list + post form ---- */
.bbs-columns { display: flex; gap: 24px; align-items: flex-start; }
.bbs-main { flex: 1; min-width: 0; }
.bbs-side { flex: 0 0 320px; }

@media (max-width: 820px) {
    .bbs-columns { flex-direction: column; }
    .bbs-side { flex: none; width: 100%; order: -1; }
}

/* ---- Thread list ---- */
.thread-list { list-style: none; margin: 0; padding: 0; }
.thread-list li {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 14px 18px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.thread-title { font-size: 1.05rem; font-weight: bold; color: #003366; }
.thread-title:hover { color: #007bff; }
.thread-meta { font-size: .8rem; color: #888; display: flex; gap: 14px; white-space: nowrap; }
.thread-count {
    background: #eef2f7; color: #003366;
    border-radius: 999px; padding: 2px 10px; font-weight: bold;
}

.bbs-empty {
    background: #fff; border-radius: 8px; padding: 30px;
    text-align: center; color: #888;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

/* ---- Pager ---- */
.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager-cur {
    display: inline-block; min-width: 34px; text-align: center;
    padding: 6px 8px; border-radius: 6px; background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.pager-cur { background: #003366; color: #fff; }

/* ---- Post cards / forms ---- */
.post-card, .admin-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 20px;
}
.post-card h3 { margin: 0 0 14px; color: #003366; font-size: 1.05rem; }

.post-form .fld { display: block; margin-bottom: 12px; }
.post-form .fld > span {
    display: block; font-size: .82rem; color: #555; margin-bottom: 4px;
}
.post-form input[type=text],
.post-form input[type=password],
.post-form textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #cdd5df;
    border-radius: 6px;
    font-family: inherit;
    font-size: .95rem;
    background: #fff;
}
.post-form input[type=text]:focus,
.post-form textarea:focus {
    outline: none; border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,.12);
}
.post-form textarea { resize: vertical; }
.fld-captcha input { max-width: 120px; }
.fld-note { font-size: .78rem; color: #999; margin: 0 0 12px; }

.btn-post {
    background: #003366; color: #fff; border: 0;
    padding: 11px 26px; border-radius: 6px;
    font-size: .95rem; font-weight: bold; cursor: pointer;
    transition: background .2s;
}
.btn-post:hover { background: #00509e; }

.form-err {
    background: #fdecea; border: 1px solid #f5c6cb; color: #a12622;
    border-radius: 6px; padding: 10px 14px; margin: 0 0 14px; font-size: .9rem;
}

/* honeypot — hidden from humans */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Thread view ---- */
.thread-view { max-width: 820px; }
.crumb { margin: 0 0 10px; font-size: .88rem; }
.post {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 16px 20px;
    margin-bottom: 12px;
}
.post-head {
    display: flex; align-items: baseline; gap: 12px;
    padding-bottom: 8px; margin-bottom: 10px;
    border-bottom: 1px dashed #e2e8f0;
    flex-wrap: wrap;
}
.post-no {
    background: #003366; color: #fff; font-weight: bold;
    border-radius: 5px; padding: 1px 9px; font-size: .82rem;
}
.post-name { font-weight: bold; color: #2c3e50; }
.post-date { font-size: .8rem; color: #999; margin-left: auto; }
.post-body { white-space: normal; word-wrap: break-word; }
.post-image { margin-top: 12px; }
.post-image img {
    max-width: 320px; max-height: 320px; height: auto;
    border: 1px solid #e2e8f0; border-radius: 6px;
}
.reply-card { margin-top: 22px; }

/* ---- Admin ---- */
.admin-head { display: flex; justify-content: space-between; align-items: center; }
.logout-link { font-size: .85rem; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.admin-table td { border-top: 1px solid #eee; padding: 10px 8px; vertical-align: top; }
.a-id { color: #999; font-size: .82rem; white-space: nowrap; }
.a-meta { font-size: .78rem; color: #999; }
.a-excerpt { font-size: .85rem; color: #555; margin-top: 3px; }
.btn-del {
    background: #c0392b; color: #fff; border: 0; cursor: pointer;
    padding: 6px 14px; border-radius: 5px; font-size: .82rem;
}
.btn-del:hover { background: #a5281b; }

/* ---- Footer ---- */
.main-footer {
    background: #fff; border-top: 1px solid #e6ebf1;
    text-align: center; padding: 20px; margin-top: 40px;
    color: #999; font-size: .82rem;
}
