/* 王者归来传奇公会样式文件 */

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
    font-size: 14px;
}

/* 容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

/* 导航栏 */
.navbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 0;
    margin-bottom: 20px;
}

.navbar-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 18px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-username {
    color: #64748b;
    font-size: 14px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #64748b;
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: #22c55e;
    color: white;
}

.btn-success:hover {
    background-color: #16a34a;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-file {
    padding: 8px;
}

/* 内容列表 */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.post-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: box-shadow 0.2s;
}

.post-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.post-author {
    font-weight: 500;
    color: #2563eb;
}

.post-time {
    font-size: 12px;
    color: #64748b;
}

.post-content {
    margin-bottom: 12px;
    line-height: 1.6;
}

.post-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-top: 12px;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
}

/* 点赞和评论按钮样式 */
.btn-like, .btn-comment {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.btn-like:hover, .btn-comment:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-like.liked {
    color: #ef4444;
    border-color: #fecaca;
    background: #fef2f2;
}

.btn-like.liked:hover {
    background: #fee2e2;
}

.like-icon, .comment-icon {
    font-size: 16px;
}

.like-count, .comment-count {
    font-weight: 500;
}

/* 评论区域样式 */
.post-comments {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.comments-list {
    margin-bottom: 12px;
}

.comment-item {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.comment-author {
    font-weight: 500;
    color: #2563eb;
    font-size: 12px;
}

.comment-content {
    margin-top: 4px;
    line-height: 1.4;
    font-size: 14px;
}

.comment-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.comment-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-submit-comment {
    align-self: flex-end;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 32px;
}

/* 发布页面 */
.publish-container {
    max-width: 600px;
    margin: 0 auto;
}

.image-preview {
    margin-top: 12px;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 消息提示 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .card {
        padding: 20px;
    }
    
    .navbar-content {
        padding: 0 16px;
    }
    
    .navbar-user {
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .login-card {
        margin: 20px;
        padding: 32px 24px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }

.w-full { width: 100%; }

/* 无限滚动加载状态 */
.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #64748b;
    font-size: 14px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-more-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
}

.no-more-icon {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.6;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background-color: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #16a34a;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.modal-message {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-button {
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 100px;
}

.modal-button:hover {
    background-color: #1d4ed8;
}

.modal-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* 响应式设计 */
@media (max-width: 480px) {
    .modal-content {
        padding: 24px;
        margin: 20px;
    }
    
    .modal-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-message {
        font-size: 14px;
    }
}

/* 图片缩略图样式 */
.post-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 12px 0;
}

.post-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 图片模态框样式 */
.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.image-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-modal-overlay.show .image-modal-image {
    transform: scale(1);
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    transition: background-color 0.2s ease;
    z-index: 2001;
}

.image-modal-close:hover {
    background-color: white;
}

.image-modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-modal-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .post-image {
        height: 250px;
    }
    
    .image-modal-overlay {
        padding: 10px;
    }
    
    .image-modal-close {
        top: -30px;
        right: -30px;
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .post-image {
        height: 200px;
    }
    
    .image-modal-close {
        top: 10px;
        right: 10px;
        background-color: rgba(0, 0, 0, 0.7);
        color: white;
    }
    
    .image-modal-close:hover {
        background-color: rgba(0, 0, 0, 0.9);
    }
}

/* 管理员相关样式 */
.admin-badge {
    background-color: #f59e0b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

/* 删除按钮样式 */
.btn-delete-post, .btn-delete-comment {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.btn-delete-post:hover, .btn-delete-comment:hover {
    background-color: #fef2f2;
    opacity: 1;
    transform: scale(1.1);
}

.btn-delete-post:disabled, .btn-delete-comment:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 评论头部样式 */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comment-header .comment-author {
    margin: 0;
}

/* 管理员登录页面样式 */
.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* 响应式设计 - 管理员功能 */
@media (max-width: 768px) {
    .navbar-user {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .admin-badge {
        order: -1;
        width: 100%;
        text-align: center;
    }
    
    .btn-delete-post, .btn-delete-comment {
        font-size: 14px;
        padding: 2px 6px;
    }
}