/* クラシカル・スタイル・デザインシステム */
:root {
    --bg-color: #f7f4ef;
    --header-bg: #e8dfd3;
    --card-bg: #ffffff;
    --text-color: #3a2e2e;
    --text-dim: #665b52;
    --accent-color: #6e5a52;
    --accent-hover: #8d776c;
    --border-color: #c6b8a4;
    --border-light: #d2c7b8;
    --sidebar-accent: #b9a48d;
    --plus-color: #ff8a95;
    --minus-color: #bbbbbb;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: "Times New Roman", "游明朝", "Yu Mincho", "Hiragino Mincho ProN", serif;
    margin: 0;
    line-height: 1.8;
}

.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header & Navigation */
header {
    background: var(--header-bg);
    border-bottom: 2px solid var(--border-color);
    padding: 2.5rem 1rem;
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
    letter-spacing: 1px;
}


.logo {
    font-size: 2rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 1rem;
}


nav {
    margin-top: 1rem;
}

nav a {
    color: var(--text-dim);
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 500;
}

nav a:hover {
    color: var(--accent-color);
}

/* Thread List (Index) */
.thread-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-left: 5px solid var(--sidebar-accent);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.thread-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.thread-card h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.thread-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex;
    gap: 1.5rem;
}

/* Thread Detail (Show) */
.thread-main {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    padding: 2rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.category {
    background: var(--header-bg);
    color: var(--text-dim);
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
}

.thread-body {
    font-size: 1.1rem;
    margin: 1.5rem 0;
}

/* Comments */
.comment-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.comment-card.nested {
    margin-left: 2.5rem;
    border-left: 3px solid var(--sidebar-accent);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-footer {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-actions-left {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.reply-count,
.reply-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.reply-count:hover,
.reply-link:hover {
    text-decoration: underline;
}

/* Voting Redesign - Positioned Bottom Right */
.vote-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vote-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.vote-count {
    font-size: 0.75rem;
    font-weight: bold;
}

.vote-count.plus {
    color: #f26d7d;
}

.vote-count.minus {
    color: var(--text-dim);
}

.vote-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
}

.vote-btn:active {
    transform: scale(0.95);
}

.vote-btn.plus {
    background-color: var(--plus-color);
}

.vote-btn.minus {
    background-color: var(--minus-color);
}

.vote-bar-wrapper {
    width: 100px;
    height: 16px;
    background: #e0d9cf;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 8px 4px 8px;
    /* カウントの位置に合わせる */
}

.vote-bar {
    width: 100%;
    height: 100%;
}

.vote-bar-fill.plus {
    background-color: var(--plus-color);
    height: 100%;
    transition: width 0.3s ease-out;
}

/* For nested replies */
.vote-container.small {
    gap: 0.5rem;
}

.vote-bar-mini {
    display: inline-block;
    width: 40px;
    height: 8px;
    background: #e0d9cf;
    border-radius: 1px;
    vertical-align: middle;
    overflow: hidden;
    margin-bottom: 2px;
}

/* Forms */
textarea {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-light);
    color: var(--text-color);
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    min-height: 120px;
    font-family: inherit;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--accent-color);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.form-actions {
    text-align: right;
    margin-top: 1rem;
}

/* 連絡先入力関連のスタイル */
.contact-checkbox-container {
    margin: 1rem 0 0.5rem 0;
}

.contact-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-dim);
}

.contact-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.contact-checkbox span {
    user-select: none;
}

.contact-input-container {
    margin: 0.5rem 0 1rem 0;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.contact-input-container.hidden {
    display: none;
}

.contact-input-container input[type="text"] {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-light);
    color: var(--text-color);
    border-radius: 4px;
    padding: 0.75rem;
    font-family: inherit;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.contact-input-container input[type="text"]::placeholder {
    color: #b0a89a;
    opacity: 1;
}

/* Admin Header */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.admin-user-info {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.logout-link {
    color: #f85149;
    text-decoration: none;
    margin-left: 0.5rem;
}

footer {
    text-align: center;
    padding: 3rem;
    margin-top: 4rem;
    background: var(--header-bg);
    color: var(--text-dim);
    font-size: 0.9rem;
    border-top: 2px solid var(--border-color);
}