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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    /* 优化中文字体渲染 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 提示消息 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 表单容器 */
.message-form-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.message-form-container h2 {
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 管理员后台入口链接样式 */
.admin-link {
    color: #666;
    text-decoration: none;
    margin-right: 15px;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-link:hover {
    color: #667eea;
    background-color: #f8f9fa;
    transform: scale(1.1);
}

.admin-link i {
    font-size: 1.2em;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.form-group small {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-reply {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-reply:hover {
    background: #e9ecef;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* 留言列表 */
.messages-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.messages-container h2 {
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.no-messages {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-messages i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 留言项 */
.message-item {
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.message-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.message-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e1e5e9;
}

.message-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.message-name {
    font-weight: 600;
    color: #333;
}

.message-type {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.type-bug {
    background: #fee2e2;
    color: #dc2626;
}

.type-suggestion {
    background: #dbeafe;
    color: #2563eb;
}

.type-feature {
    background: #dcfce7;
    color: #16a34a;
}

.type-other {
    background: #fef3c7;
    color: #d97706;
}

.message-time {
    color: #666;
    font-size: 13px;
    margin-left: auto;
}

.message-content {
    padding: 20px;
    line-height: 1.6;
}

.message-image {
    padding: 0 20px 20px;
}

.message-image img {
    max-width: 300px;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    object-fit: cover;
}

.message-image img:hover {
    transform: scale(1.02);
}

.message-actions {
    padding: 15px 20px;
    border-top: 1px solid #e1e5e9;
    background: #f8f9fa;
}

/* 回复表单 */
.reply-form {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
}

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

.reply-form input,
.reply-form textarea {
    font-size: 13px;
    padding: 10px 12px;
}

/* 回复列表 */
.replies {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    position: relative;
}

.reply-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 3px solid #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    position: relative;
}

.reply-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.reply-item:last-child {
    margin-bottom: 0;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f3f4;
}

.reply-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.reply-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-time {
    color: #718096;
    font-size: 12px;
    font-weight: 500;
}

.reply-content {
    color: #4a5568;
    line-height: 1.6;
    font-size: 14px;
    margin-top: 8px;
}

/* 回复操作按钮 */
.reply-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-reply {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-reply:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* 嵌套回复表单 */
.nested-reply-form {
    margin-top: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nested-reply-form .form-group {
    margin-bottom: 12px;
}

.nested-reply-form input,
.nested-reply-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: white;
}

.nested-reply-form input:focus,
.nested-reply-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.nested-reply-form .btn {
    font-size: 12px;
    padding: 6px 12px;
    margin-right: 8px;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nested-reply-form .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.nested-reply-form .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.nested-reply-form .btn-secondary {
    background: #e2e8f0;
    border: 1px solid #cbd5e0;
    color: #4a5568;
}

.nested-reply-form .btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

/* 嵌套回复视觉效果 */
.reply-item[style*="margin-left"] {
    position: relative;
}

/* 一级嵌套回复 */
.reply-item[style*="margin-left: 20px"] {
    border-left-color: #4299e1;
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.03) 0%, rgba(247, 250, 252, 0.8) 100%);
    box-shadow: 0 8px 32px rgba(66, 153, 225, 0.12), 0 2px 8px rgba(0,0,0,0.04);
}

.reply-item[style*="margin-left: 20px"]::before {
    content: '';
    position: absolute;
    left: -25px;
    top: -2px;
    width: 3px;
    height: calc(100% + 4px);
    background: linear-gradient(180deg, #4299e1 0%, #63b3ed 50%, #bee3f8 100%);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(66, 153, 225, 0.3);
}

.reply-item[style*="margin-left: 20px"]::after {
    content: '';
    position: absolute;
    left: -35px;
    top: 28px;
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, #4299e1 0%, #63b3ed 100%);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(66, 153, 225, 0.2);
}

/* 二级嵌套回复 */
.reply-item[style*="margin-left: 40px"] {
    border-left-color: #38b2ac;
    background: linear-gradient(135deg, rgba(56, 178, 172, 0.03) 0%, rgba(240, 255, 244, 0.8) 100%);
    box-shadow: 0 8px 32px rgba(56, 178, 172, 0.12), 0 2px 8px rgba(0,0,0,0.04);
}

.reply-item[style*="margin-left: 40px"]::before {
    content: '';
    position: absolute;
    left: -45px;
    top: -2px;
    width: 3px;
    height: calc(100% + 4px);
    background: linear-gradient(180deg, #38b2ac 0%, #4fd1c7 50%, #9ae6b4 100%);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(56, 178, 172, 0.3);
}

.reply-item[style*="margin-left: 40px"]::after {
    content: '';
    position: absolute;
    left: -55px;
    top: 28px;
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, #38b2ac 0%, #4fd1c7 100%);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(56, 178, 172, 0.2);
}

/* 三级嵌套回复 */
.reply-item[style*="margin-left: 60px"] {
    border-left-color: #ed8936;
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.03) 0%, rgba(255, 250, 240, 0.8) 100%);
    box-shadow: 0 8px 32px rgba(237, 137, 54, 0.12), 0 2px 8px rgba(0,0,0,0.04);
}

.reply-item[style*="margin-left: 60px"]::before {
    content: '';
    position: absolute;
    left: -65px;
    top: -2px;
    width: 3px;
    height: calc(100% + 4px);
    background: linear-gradient(180deg, #ed8936 0%, #f6ad55 50%, #fbd38d 100%);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(237, 137, 54, 0.3);
}

.reply-item[style*="margin-left: 60px"]::after {
    content: '';
    position: absolute;
    left: -75px;
    top: 28px;
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, #ed8936 0%, #f6ad55 100%);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(237, 137, 54, 0.2);
}

/* 隐藏三级回复的回复按钮 */
.reply-item[style*="margin-left: 60px"] .reply-actions {
    display: none;
}

/* 图片模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    cursor: pointer;
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    top: 50%;
    transform: translateY(-50%);
}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.close {
    position: absolute;
    top: 10px;
    right: 25px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    opacity: 0.7;
}

/* 简化动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reply-item {
    animation: fadeInUp 0.3s ease-out forwards;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .message-form-container,
    .messages-container {
        padding: 20px;
    }
    
    .message-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .message-time {
        margin-left: 0;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .reply-form .btn {
        width: auto;
        margin-right: 10px;
    }
    
    /* 移动端多级回复优化 */
    .reply-item[style*="margin-left"] {
        margin-left: 10px !important;
    }
    
    .reply-item[style*="margin-left: 20px"] {
        margin-left: 15px !important;
    }
    
    .reply-item[style*="margin-left: 40px"] {
        margin-left: 25px !important;
    }
    
    .reply-item[style*="margin-left: 60px"] {
        margin-left: 35px !important;
    }
    
    .reply-item[style*="margin-left: 20px"]::before {
        left: -18px !important;
        width: 15px !important;
    }
    
    .reply-item[style*="margin-left: 40px"]::before {
        left: -28px !important;
        width: 25px !important;
    }
    
    .reply-item[style*="margin-left: 60px"]::before {
        left: -38px !important;
        width: 35px !important;
    }
    
    .reply-item[style*="margin-left: 20px"]::after {
        left: -25px;
        width: 15px;
    }
    
    .reply-item[style*="margin-left: 40px"]::after {
        left: -30px;
        width: 15px;
    }
    
    .reply-item[style*="margin-left: 60px"]::after {
        left: -35px;
        width: 15px;
    }
    
    .nested-reply-form {
        padding: 12px !important;
        margin-top: 8px !important;
    }
    
    .reply-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 8px 12px !important;
    }
    
    .reply-actions {
        justify-content: flex-start;
        padding: 6px 12px !important;
        gap: 4px !important;
    }
    
    .reply-item {
        padding: 18px;
        margin-bottom: 8px !important;
    }
    
    .reply-content {
        font-size: 14px;
        padding: 8px 12px !important;
    }
}

@media (max-width: 480px) {
    .message-header,
    .message-content,
    .message-actions,
    .reply-form,
    .replies {
        padding: 15px;
    }
    
    .message-image {
        padding: 0 15px 15px;
    }
}



/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}



/* 个人资料页面样式 */
.profile-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.avatar-preview {
    text-align: center;
    margin-bottom: 30px;
}

.avatar-preview img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-bottom: 15px;
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    margin: 0 auto 15px;
    border: 4px solid #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #e8f2ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 15px;
}

.upload-text {
    color: #666;
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9rem;
    color: #999;
}



/* 管理员回复特殊样式 */
.admin-reply {
    background: rgba(255, 215, 0, 0.05) !important;
    border-left: 3px solid #ffd700 !important;
    border: 1px solid rgba(255, 215, 0, 0.2) !important;
}



.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ffd700;
}

.admin-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.admin-badge {
    background: #ffd700;
    color: #8b4513;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.admin-badge i {
    font-size: 8px;
}