/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'yahei', sans-serif;
    background: #f0f2f5;
    color: #333;
}

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

.error {
    color: #dc3545;
    font-size: 14px;
    margin-bottom: 10px;
}

.success {
    color: #28a745;
    font-size: 14px;
    margin-bottom: 10px;
}

/* 表单样式 */
.form-container {
    max-width: 350px;
    margin: 50px auto;
    padding: 25px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.form-title {
    text-align: center;
    margin-bottom: 20px;
    color: #1a73e8;
    font-size: 24px;
}

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

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

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.form-control:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary {
    background: #1a73e8;
    color: #fff;
}

.btn-primary:hover {
    background: #1557b0;
}

.btn-success {
    background: #0054FF;
    color: #fff;
}

.btn-success:hover {
    background: #003DFF;
}

.form-link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.form-link a {
    color: #1a73e8;
    text-decoration: none;
}

.form-link a:hover {
    text-decoration: underline;
}

/* 导航栏样式 */
.navbar {
    background: #fff;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo {
    font-size: 20px;
    font-weight: 700;
    color: #1a73e8;
    text-decoration: none;
}

.navbar-search {
    display: flex;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px 0 0 20px;
    width: 150px;
  border-color: #006BFF;
  outline: none; /* 移除默认聚焦外框 */
    transition: border-color 0.3s;
}



.search-btn {
    padding: 9px 12px;
    border: none;
    background: #006BFF;
    color: #fff;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    margin-right: 5px;
   
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 100;
    background: #fff;
    min-width: 16px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    z-index: 1;
}

.dropdown-content a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
}

.dropdown-content a:hover {
    background: #f5f5f5;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* 帖子列表样式 */
.posts-container {
    margin-top: 20px;
}

.post {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.post-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.post-author {
    font-weight: 500;
    text-decoration: none;
    color: #333;
}

.post-author:hover {
    text-decoration: underline;
}

.post-time {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.post-body {
    padding: 20px;
}

.post-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
    text-decoration: none;
}

.post-title:hover {
    text-decoration: underline;
}

.post-tags {
    margin: 10px 0;
}

.post-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #e8f0fe;
    color: #1a73e8;
    border-radius: 20px;
    font-size: 12px;
    margin-right: 5px;
}

.post-intro {
    margin-bottom: 15px;
    line-height: 1.6;
}

.post-files {
    margin: 15px 0;
}

.file-item {
    margin-bottom: 10px;
}

.file-item img,
.file-item video {
    max-width: 100%;
    border-radius: 6px;
}

.file-download {
    display: inline-block;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.file-download:hover {
    background: #e9ecef;
}

.post-signature {
    font-style: italic;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f2f5;
}

/* 评论区样式 */
.comment-section {
    padding: 20px;
    border-top: 1px solid #f0f2f5;
}

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

.comment-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    min-height: 80px;
    font-size: 14px;
}

.comment-list {
    margin-top: 20px;
    border-radius:5px; 
    margin-bottom:5px;
    max-height:330px; 
    overflow-y: scroll;
    
}

.comment {
    padding: 15px;
    border-bottom: 1px solid #f0f2f5;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-author {
    font-weight: 500;
    text-decoration: none;
    color: #333;
}

.comment-time {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
}

.comment-content {
    font-size: 14px;
    line-height: 1.5;
}

/* 个人主页样式 */
.profile-container {
    max-width: 800px;
    margin: 30px auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.profile-header {
    padding: 20px;
    background: #1a73e8;
    color: #fff;
    text-align: center;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #fff;
    object-fit: cover;
    margin-bottom: 10px;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
}

.profile-id {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 10px;
}

.profile-signature {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

.profile-edit-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    color: #1a73e8;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.profile-edit-btn:hover {
    background: #f5f5f5;
}

.profile-body {
    padding: 20px;
}

.profile-section {
    margin-bottom: 25px;
}

.profile-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f2f5;
}

.profile-info {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.profile-info-label {
    font-weight: 500;
    color: #666;
}

.profile-info-value {
    word-break: break-all;
}

.profile-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.profile-post-card {
    border: 1px solid #f0f2f5;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}

.profile-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-post-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.profile-post-title {
    padding: 10px;
    font-size: 16px;
    font-weight: 500;
}

/* 按钮样式 */
.upload-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 51px;
    height: 51px;
    border-radius: 50%;
    background: #1a73e8;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.3s;
}

.upload-btn:hover {
    background: #1557b0;
}

/* 搜索结果样式 */
.search-results {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-results-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.search-results-count {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}