/* ========================================
   BBS - 掲示板スタイル
======================================== */
:root {
    --bbs-primary: #3A5A64;
    --bbs-secondary: #5BA3C6;
    --bbs-accent: #F5C518;
    --bbs-bg: #f5f7f8;
    --bbs-card: #ffffff;
    --bbs-text: #333;
    --bbs-text-light: #666;
    --bbs-border: #e0e0e0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bbs-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
    color: var(--bbs-text);
    line-height: 1.7;
}

.bbs-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.bbs-header {
    background: linear-gradient(135deg, var(--bbs-primary) 0%, #2C5A7C 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.bbs-header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.bbs-header h1 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
}

.bbs-header h1 a {
    color: white;
    text-decoration: none;
}

.bbs-desc {
    margin: 0 0 10px 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.back-to-main,
.back-to-list {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.back-to-main:hover,
.back-to-list:hover {
    color: var(--bbs-accent);
}

/* Main */
.bbs-main {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    width: 100%;
}

/* New Thread Section */
.new-thread-section {
    background: var(--bbs-card);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.new-thread-section h2 {
    margin: 0 0 20px 0;
    font-size: 1.1rem;
    color: var(--bbs-primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bbs-secondary);
}

/* Form */
.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--bbs-text);
}

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

.form-row.inline label {
    margin-bottom: 0;
    min-width: 50px;
}

.form-row input[type="text"],
.form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--bbs-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-row input[type="text"]:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--bbs-secondary);
}

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

.required {
    color: #e74c3c;
}

.btn-post {
    background: linear-gradient(135deg, var(--bbs-secondary) 0%, var(--bbs-primary) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(91, 163, 198, 0.4);
}

.error-message {
    background: #ffe6e6;
    color: #c00;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Thread List */
.thread-list-section h2 {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    color: var(--bbs-primary);
}

.no-threads {
    text-align: center;
    color: var(--bbs-text-light);
    padding: 40px;
    background: var(--bbs-card);
    border-radius: 12px;
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thread-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bbs-card);
    padding: 18px 20px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--bbs-text);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.thread-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.thread-number {
    background: var(--bbs-secondary);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.thread-info {
    flex: 1;
    min-width: 0;
}

.thread-title {
    margin: 0 0 5px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bbs-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-meta {
    font-size: 0.85rem;
    color: var(--bbs-text-light);
    display: flex;
    gap: 15px;
}

.post-count {
    color: var(--bbs-secondary);
    font-weight: 600;
}

/* Thread Detail */
.thread-detail {
    margin-bottom: 30px;
}

.thread-title-main {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    color: var(--bbs-primary);
    padding: 20px 25px;
    background: var(--bbs-card);
    border-radius: 12px 12px 0 0;
    border-bottom: 3px solid var(--bbs-secondary);
}

.thread-stats {
    margin: 0;
    padding: 10px 25px;
    background: var(--bbs-card);
    color: var(--bbs-text-light);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--bbs-border);
}

/* Posts */
.posts-list {
    background: var(--bbs-card);
    border-radius: 0 0 12px 12px;
}

.post-item {
    padding: 20px 25px;
    border-bottom: 1px solid var(--bbs-border);
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:target {
    background: #fffde7;
}

.post-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.post-number {
    background: var(--bbs-primary);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
}

.post-name {
    color: #228B22;
    font-weight: 700;
}

.post-date {
    color: var(--bbs-text-light);
}

.post-body {
    line-height: 1.8;
    word-break: break-word;
}

/* Reply Section */
.reply-section {
    background: var(--bbs-card);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.reply-section h3 {
    margin: 0 0 20px 0;
    font-size: 1.1rem;
    color: var(--bbs-primary);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bbs-secondary);
}

.reply-form .form-row.inline input {
    max-width: 250px;
}

.thread-full {
    color: var(--bbs-text-light);
    text-align: center;
    padding: 20px;
}

/* Footer */
.bbs-footer {
    background: var(--bbs-primary);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
}

/* Mobile */
@media (max-width: 600px) {
    .bbs-header h1 {
        font-size: 1.2rem;
    }
    
    .bbs-main {
        padding: 20px 15px;
    }
    
    .new-thread-section,
    .reply-section {
        padding: 20px 15px;
    }
    
    .thread-item {
        padding: 15px;
    }
    
    .thread-title-main {
        font-size: 1.2rem;
        padding: 15px 20px;
    }
    
    .post-item {
        padding: 15px 20px;
    }
    
    .post-header {
        font-size: 0.85rem;
    }
    
    .reply-form .form-row.inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .reply-form .form-row.inline input {
        max-width: 100%;
    }
}

/* Notice & Messages */
.notice {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #fff8e1;
    border-radius: 6px;
    border-left: 3px solid #F5C518;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
}
