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

body {
    font-family: "ＭＳ Ｐゴシック", "MS PGothic", sans-serif;
    margin: 0;
    padding: 0 20px 20px 20px;
    background: #6495ed;
    color: #000;
    font-size: 14px;
    line-height: 1.5;
}

#ad-space {
    height: 80px;
    flex-shrink: 0;
}

.container {
    max-width: 840px;
    margin: 0 auto;
    background: #F5F6CE;
    padding: 20px;
    border: 1px solid #ccc;
}

#vdbanner {
    margin-bottom: 0;
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

h1 {
    font-size: 18px;
    margin: 0 0 10px 0;
    padding: 0;
    text-align: center;
    font-weight: normal;
}

.board-description {
    text-align: center;
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
}

.total-posts {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

/* 投稿フォーム */
.post-form {
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f8f8;
    border: 1px solid #ddd;
}

.form-group {
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 10px;
}

.form-group label {
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 14px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.form-text {
    color: #666;
    font-size: 0.9em;
    grid-column: 1 / -1;  /* グリッドの全列を使用 */
}

button[type="submit"] {
    background: #007bff;
    border: 1px solid #ccc;
    padding: 2px 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

/* 投稿一覧 */
.posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post {
    font-size: medium;
    border: 1px solid #ccc;
    background: #fff;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
}

.post-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
}

.post-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
}

.post-number {
    font-weight: bold;
    color: #666;
}

.post-number a {
    text-decoration: none;
    color: #4caf50;
}

.post-number a:hover {
    text-decoration: underline;
    color: #2e7d32;  /* 濃い緑色 */
}

.post-name {
    font-weight: bold;
}

.post-date {
    color: #666;
    font-size: 0.9em;
}

.post-title {
    font-weight: bold;
}

.post-content {
    padding: 10px;
    word-wrap: break-word;
}

.post-content a {
    text-decoration: none;
    color: #4caf50;
}

.post-content a:hover {
    text-decoration: underline;
    color: #2e7d32;  /* 濃い緑色 */
}

.post-title h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-top: 10px;
    padding-bottom: 5px;
}

.post-footer {
    padding: 5px 10px;
}

/* 子記事 */
.child-posts {
    margin-left: 20px;
/*    border-left: 2px solid #ccc;*/
}

.post.child {
    margin-top: 10px;
    border: 1px solid #ddd;
}

.post.child .post-header {
    background: #f8f8f8;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .form-group {
        grid-template-columns: 1fr;
    }
    
    .post-header {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .post-date {
        grid-column: 1;
    }
}

.delete-link {
    color: #e74c3c;
    text-decoration: none;
}

.delete-link:hover {
    text-decoration: underline;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.button {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    margin: 0 2px;
}

.button:hover {
    background: #e0e0e0;
}

/* ページネーション */
.pagination {
    margin-top: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #ccc;
    background: #f8f8f8;
    color: #000;
    text-decoration: none;
    font-size: 14px;
}

.page-link:hover {
    background: #f0f0f0;
}

.page-current {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #999;
    background: #e0e0e0;
    color: #000;
    font-size: 14px;
}

.page-dots {
    display: inline-block;
    padding: 5px;
    color: #666;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .pagination {
        gap: 3px;
    }
    
    .page-link,
    .page-current {
        padding: 3px 8px;
        font-size: 12px;
    }
}

/* ヘッダーリンク */
.header-links {
    margin-bottom: 10px;
    text-align: right;
}

.footer-links {
    margin-bottom: 10px;
    text-align: right;
}

.toolbar {
    font-size: 0.8em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.toolbar-left {
    display: flex;
    gap: 5px;
}

.toolbar-right {
    display: flex;
    gap: 5px;
}

.toolbar a {
    text-decoration: none;
    color: #4caf50;
}

.toolbar a:hover {
    text-decoration: underline;
    color: #2e7d32;  /* 濃い緑色 */
}

.newpost-links {
    margin-bottom: 10px;
    text-align: center;
}

.newpost-description {
    font-size: 0.8em;
    color: #666;
}


/* 投稿アクション */
.post-actions {
    margin-top: 5px;
    text-align: right;
}

/* エラーメッセージ */
.error-message {
    margin-bottom: 20px;
    padding: 10px;
    background: #fff0f0;
    border: 1px solid #ffcccc;
    color: #cc0000;
}

/* フォームボタン */
.form-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.form-buttons button {
    padding: 5px 20px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
}

.form-buttons button:hover {
    background: #e0e0e0;
}

.form-buttons button:hover[type="submit"] {
    background-color: #0056b3;
}

.form-buttons button[type="submit"] {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .header-links {
        text-align: center;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .button {
        width: 100%;
        text-align: center;
    }
}

/* 表のスタイル */
.markdown-table {
    border-collapse: collapse;
    margin: 0;
/*    font-size: 0.9em;*/
}

.markdown-table td {
    border: 1px solid #ddd;
    padding: 2px 2px;
    text-align: left;
}



/* 返信フォーム */
.reply-form {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.reply-form h3 {
    margin-bottom: 15px;
    color: #333;
}

/* 返信一覧 */
.replies {
    margin: 20px 0;
}

.replies h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}

.reply {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.reply-name {
    font-weight: bold;
    color: #007bff;
}

.reply-date {
    color: #666;
    font-size: 0.9em;
}

.reply-content {
    line-height: 1.6;
    white-space: pre-wrap;
}

.home-link {
    color: #666;
    font-size: 0.8em;
    text-decoration: none;
}

.home-link:hover {
    text-decoration: underline;
}

.search-form {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.search-form form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-form select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.search-form button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.search-form button:hover {
    background-color: #0056b3;
}

.search-form .button {
    padding: 8px 15px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.search-form .button:hover {
    background-color: #5a6268;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin: 0;
}

/* 広告のスタイル */
.ad-container {
    width: 100%;
    margin: 20px 0;
    text-align: center;
}

.ad-header {
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
}

.ad-sidebar {
    width: 300px;
    margin-left: 20px;
    text-align: center;
}

.ad-footer {
    width: 100%;
    margin-top: 20px;
    text-align: center;
}

/* メインコンテンツのレイアウト調整 */
.main-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.posts {
    flex: 1;
}
