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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #36393f;
    color: #dcddde;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: #2f3136;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: #fff;
    font-size: 24px;
}

.user-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    display: inline-block;
    background: #5865f2;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn:hover {
    background: #4752c4;
}

.btn-secondary {
    background: #4e5058;
}

.btn-secondary:hover {
    background: #3b3d45;
}

.btn-danger {
    background: #da373c;
}

.btn-danger:hover {
    background: #ba2e32;
}

.thread-table {
    width: 100%;
    background: #2f3136;
    border-radius: 8px;
    overflow: hidden;
}

.thread-table th,
.thread-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #202225;
}

.thread-table th {
    background: #202225;
    font-weight: 600;
}

.thread-table a {
    color: #00aff4;
    text-decoration: none;
}

.thread-table a:hover {
    text-decoration: underline;
}

.post {
    background: #2f3136;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
}

.post-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #202225;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.post-header strong {
    color: #fff;
}

.post-date {
    color: #72767d;
    font-size: 12px;
}

.badge {
    background: #5865f2;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.post-content {
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background: #40444b;
    border: 1px solid #202225;
    border-radius: 4px;
    color: #dcddde;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #5865f2;
}

.reply-form {
    margin-top: 30px;
    padding: 20px;
    background: #2f3136;
    border-radius: 8px;
}

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

.reply-form textarea {
    width: 100%;
    padding: 10px;
    background: #40444b;
    border: 1px solid #202225;
    border-radius: 4px;
    color: #dcddde;
    margin-bottom: 10px;
}

.error {
    background: #da373c;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.pagination {
    margin-top: 20px;
    display: flex;
    gap: 5px;
    justify-content: center;
}

.pagination a {
    padding: 6px 12px;
    background: #2f3136;
    color: #dcddde;
    text-decoration: none;
    border-radius: 4px;
}

.pagination a.active,
.pagination a:hover {
    background: #5865f2;
    color: white;
}

.login-box {
    background: #2f3136;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    max-width: 500px;
    margin: 50px auto;
}

.login-box h2 {
    margin-bottom: 20px;
}

.login-box p {
    margin-bottom: 30px;
    color: #b9bbbe;
}

.discord-btn {
    display: inline-block;
    background: #5865f2;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.discord-btn:hover {
    background: #4752c4;
}

/* アバタースタイル */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    vertical-align: middle;
}

.avatar-medium {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    vertical-align: middle;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    vertical-align: middle;
}

/* ユーザー情報エリア */
.user-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-info .avatar {
    margin-right: 5px;
}

/* 投稿者のヘッダー */
.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #202225;
    flex-wrap: wrap;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-author .avatar {
    width: 36px;
    height: 36px;
}

.post-author strong {
    color: #fff;
}

/* スレッド一覧の作成者セル */
.thread-table td:nth-child(2) {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-table .avatar {
    width: 28px;
    height: 28px;
}

/* ヘッダーのユーザー情報 */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info .avatar {
    width: 36px;
    height: 36px;
}

/* 通常のメンション */
.mention {
    background: #5865f2;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    display: inline-block;
    transition: all 0.2s;
}

/* 自分宛のメンション（特別ハイライト） */
.mention-self {
    background: #faa81a;
    color: #1a1a1a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    display: inline-block;
    font-weight: bold;
    box-shadow: 0 0 0 2px rgba(250, 168, 26, 0.3);
    animation: mentionPulse 0.5s ease;
}

/* 自分宛メンションのホバー効果 */
.mention-self:hover {
    background: #f89c0e;
    transform: scale(1.02);
}

/* メンションされたときのアニメーション */
@keyframes mentionPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(250, 168, 26, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 4px rgba(250, 168, 26, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(250, 168, 26, 0);
    }
}

/* メンションされた投稿に表示するバッジ */
.mention-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #faa81a;
    color: #1a1a1a;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: bold;
}

/* 自分がメンションされた投稿のカードに付ける境界線 */
.post-mentioned {
    border-left: 4px solid #faa81a;
    background: #383a40;
    transition: background 0.3s;
}

.post-mentioned:hover {
    background: #3d3f45;
}