/* ============================================
   DQ10掲示板 thread.css
   viewportなし / iPhone自動文字拡大なし / 改善版
============================================ */

html {
    font-size: 118%;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "MS PGothic", "Yu Gothic", sans-serif;
    background: #eef2ee;
    margin: 0;
    padding: 24px;
    color: #222;
    font-size: 100%;
    line-height: 1.72;
}

/* ============================================
   全体枠
============================================ */
.container {
    max-width: 960px;
    margin: 0 auto;
    background: #ffffff;
    border: 2px solid #9bc89b;
    border-radius: 12px;
    padding: 24px;
}

/* ============================================
   見出し
============================================ */
h1 {
    margin: 0 0 18px;
    padding-bottom: 10px;
    font-size: 2rem;
    line-height: 1.4;
    color: #2b7a2b;
    border-bottom: 2px solid #b8dcb8;
    word-break: break-word;
}

h2 {
    margin: 34px 0 18px;
    font-size: 1.6rem;
    line-height: 1.4;
    color: #2b7a2b;
    word-break: break-word;
}

/* ============================================
   ページ情報・ページャー
============================================ */
.page-info {
    margin: 8px 0 18px;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.pager {
    margin: 14px 0 24px;
    text-align: center;
    line-height: 1.8;
}

.pager a,
.pager span {
    display: inline-block;
    min-width: 38px;
    padding: 8px 12px;
    margin: 3px;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid #b7dcb7;
    border-radius: 6px;
    background: #f8fff8;
    color: #2b7a2b;
}

.pager a:hover {
    background: #e9f9e9;
}

.pager .current {
    background: #2f8f2f;
    color: #fff;
    border-color: #1e6f1e;
    font-weight: bold;
}

/* ============================================
   投稿ブロック
============================================ */
.post {
    background: #f8fff8;
    border: 1px solid #c7dfc7;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.my-post {
    background: #fff9df;
    border-color: #e4d68a;
}

/* ============================================
   投稿ヘッダー
============================================ */
.meta {
    margin-bottom: 10px;
    color: #444;
}

.meta-head {
    display: block;
}

.meta-main {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
}

.number {
    display: inline-block;
    margin-right: 6px;
    color: #1a33cc;
    font-weight: bold;
    font-size: 1.35rem;
    line-height: 1;
    vertical-align: middle;
}

.meta img {
    width: 32px;
    height: 32px;
    margin-right: 2px;
    vertical-align: middle;
    image-rendering: auto;
}

.name {
    color: #167d16;
    font-weight: bold;
    font-size: 1.12rem;
    vertical-align: middle;
}

.level {
    margin-left: 2px;
    color: #555;
    font-size: 0.92rem;
    vertical-align: middle;
}

.date-row {
    margin-top: 4px;
    margin-left: 72px;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ============================================
   本文
============================================ */
.message {
    margin-top: 10px;
    color: #111;
    font-size: 1.18rem;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message a {
    word-break: break-all;
}

/* ============================================
   返信フォーム
============================================ */
.reply-form {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid #c7dfc7;
}

.reply-form input[type="text"],
.reply-form textarea {
    width: 100%;
    max-width: 600px;
    padding: 12px;
    margin-top: 6px;
    margin-bottom: 14px;
    font-size: 1rem;
    color: #222;
    background: #fff;
    border: 1px solid #c3d8c3;
    border-radius: 6px;
    appearance: none;
}

.reply-form textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.7;
}

.reply-form input[type="text"]:focus,
.reply-form textarea:focus {
    outline: none;
    border-color: #5aaa5a;
    box-shadow: 0 0 0 3px rgba(90, 170, 90, 0.14);
}

.reply-form button {
    display: inline-block;
    background: #2f8f2f;
    border: 1px solid #1e6f1e;
    color: #ffffff;
    font-size: 1rem;
    font-weight: bold;
    padding: 14px 24px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    appearance: none;
}

.reply-form button:hover {
    background: #257825;
}

.reply-form button:active {
    transform: translateY(1px);
}

/* ============================================
   戻るリンク
============================================ */
.back-link {
    margin-top: 22px;
}

.back-link a {
    color: #1f6f1f;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
}

.back-link a:hover {
    text-decoration: underline;
}

/* ============================================
   アンカーリンク
============================================ */
.anchor-link {
    display: inline-block;
    padding: 2px 6px;
    margin: 2px 0 4px;
    font-size: 0.78rem;
    color: #0033cc;
    text-decoration: none;
    border: 1px solid #bdbdbd;
    border-radius: 3px;
    background: linear-gradient(#fdfdfd, #e0e0e0);
}

.anchor-link:hover {
    background: linear-gradient(#ffffff, #dcdcdc);
    text-decoration: none;
}

.anchor-link:active {
    background: linear-gradient(#d5efd5, #ffffff);
}

/* ============================================
   返信ボタン
============================================ */
.reply-btn {
    margin-left: 10px;
    margin-top: 1px;
    padding: 4px 8px;
    font-size: 0.78rem;
    line-height: 1.3;
    color: #2b2b2b;
    background: linear-gradient(#fdfdfd, #dcdcdc);
    border: 1px solid #9a9a9a;
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
    cursor: pointer;
    vertical-align: middle;
    appearance: none;
}

.reply-btn:hover {
    background: linear-gradient(#ffffff, #d6ead6);
    border-color: #6ea96e;
}

/* ============================================
   ID表示
============================================ */
.post-id {
    margin-top: 8px;
    text-align: right;
    font-size: 0.78rem;
    line-height: 1.6;
    color: #999;
}

.post-id span {
    color: #666;
}

.id-link {
    color: #777;
    text-decoration: underline;
    word-break: break-all;
}

.id-link:hover {
    color: #333;
}

/* ============================================
   神スクロールボタン
============================================ */
.scroll-btn {
    position: fixed;
    right: 20px;
    width: 48px;
    height: 48px;
    border: 1px solid #1e6f1e;
    border-radius: 50%;
    background: #2f8f2f;
    color: #fff;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
}

.scroll-btn.show {
    opacity: 1;
    transform: translateY(0);
}

.scroll-btn:hover {
    background: #257825;
}

.up-btn {
    bottom: 90px;
}

.down-btn {
    bottom: 30px;
}

.up-btn:hover::after {
    content: "最上部へ";
    position: absolute;
    right: 55px;
    background: #333;
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.down-btn:hover::after {
    content: "最下部へ";
    position: absolute;
    right: 55px;
    background: #333;
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ============================================
   viewportなし環境向けの補助調整
============================================ */
@media screen and (max-width: 600px) {
    body {
        padding: 12px;
    }

    .container {
        padding: 18px 16px;
        border-radius: 10px;
    }

    h1 {
        font-size: 1.9rem;
        margin-bottom: 16px;
        padding-bottom: 8px;
    }

    h2 {
        font-size: 1.45rem;
        margin-top: 28px;
        margin-bottom: 16px;
    }

    .page-info {
        margin: 8px 0 16px;
    }

    .pager {
        margin: 12px 0 20px;
    }

    .pager a,
    .pager span {
        min-width: 34px;
        padding: 8px 10px;
        margin: 2px;
        font-size: 0.9rem;
    }

    .post {
        padding: 14px;
        margin-bottom: 10px;
    }

    .meta {
        font-size: 1rem;
        line-height: 1.8;
    }

    .meta img {
        width: 28px;
        height: 28px;
        margin-right: 4px;
    }

    .number {
        font-size: 1.28rem;
        margin-right: 4px;
    }

    .name {
        font-size: 1.08rem;
    }

    .level {
        font-size: 0.9rem;
    }

    .date-row {
        margin-left: 38px;
        font-size: 0.88rem;
    }

    .message {
        font-size: 1.16rem;
        line-height: 1.78;
    }

    .reply-form input[type="text"],
    .reply-form textarea {
        max-width: none;
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .reply-form textarea {
        min-height: 160px;
    }

    .reply-form button {
        font-size: 1rem;
        padding: 12px 20px;
    }

    .reply-btn {
        margin-left: 8px;
        font-size: 0.76rem;
    }

    .post-id {
        margin-top: 10px;
        font-size: 0.78rem;
    }

    .back-link a {
        font-size: 0.98rem;
    }

    .scroll-btn {
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .up-btn {
        bottom: 72px;
    }

    .down-btn {
        bottom: 20px;
    }

    .up-btn:hover::after,
    .down-btn:hover::after {
        display: none;
    }
}