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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    color: #1e293b;
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 10px 12px;
}

/* 头部样式 */
.header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

@media (min-width: 600px) {
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.header h1 {
    font-size: 24px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

@media (min-width: 600px) {
    .header h1 {
        text-align: left;
    }
}

.header-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

@media (min-width: 600px) {
    .header-btns {
        justify-content: flex-end;
    }
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 30px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
    white-space: nowrap;
}

.btn:hover {
    background: #f1f5f9;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
}

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

.btn-admin {
    background: #334155;
    color: white;
    border: none;
}

.btn-admin:hover {
    background: #1e293b;
}

/* 帖子列表 */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 帖子卡片 */
.post-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.post-meta {
    flex: 1;
    min-width: 0;
}

.author {
    font-weight: 600;
    font-size: 15px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.author a {
    color: #1e293b;
    text-decoration: none;
}

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

.post-content {
    font-size: 15px;
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0 2px;
}

/* 媒体网格 */
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin: 12px 0;
}

.media-item {
    border-radius: 8px;
    overflow: hidden;
    background: #e2e8f0;
    aspect-ratio: 1/1;
    cursor: pointer;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item.video-item {
    aspect-ratio: 16/9;
    grid-column: span 3;
}

.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 帖子链接 */
.post-link {
    background: #f1f5f9;
    padding: 10px 12px;
    border-radius: 10px;
    margin: 10px 0;
    border-left: 4px solid #3b82f6;
    word-break: break-all;
    font-size: 14px;
}

.post-link a {
    color: #2563eb;
    text-decoration: none;
}

/* 帖子底部 */
.post-footer {
    margin-top: 12px;
    text-align: right;
}

.btn-view {
    background: #f1f5f9;
    padding: 5px 12px;
    border-radius: 20px;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

/* 表单容器 */
.form-container {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #334155;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    transition: 0.2s;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

.form-group input[type="file"] {
    padding: 8px;
    background: #f8fafc;
}

.form-tip {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* 按钮 */
.btn-submit {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: 0.2s;
}

.btn-submit:hover {
    background: #2563eb;
}

/* 成功消息 */
.success {
    background: #dcfce7;
    color: #166534;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid #86efac;
    font-size: 14px;
}

.success a {
    color: #166534;
    font-weight: 600;
}

/* 分享栏 */
.share-bar {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

@media (min-width: 500px) {
    .share-bar {
        flex-direction: row;
        align-items: center;
    }
}

.share-bar span {
    font-size: 14px;
    white-space: nowrap;
}

.share-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 13px;
    width: 100%;
}

.btn-copy {
    background: #334155;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

/* 后台表格 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table th {
    background: #f0f2f5;
    padding: 10px;
    text-align: left;
    white-space: nowrap;
}

.admin-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

/* 编辑表单 */
.edit-form {
    background: #f5f7fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

/* 按钮 */
.btn-edit, .btn-delete {
    padding: 4px 10px;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    margin: 0 2px;
}

.btn-edit {
    background: #e2e8f0;
    color: #334155;
}

.btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.message {
    background: #dbeafe;
    color: #1e40af;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* 登录容器 */
.login-container {
    max-width: 90%;
    width: 380px;
    margin: 50px auto;
    background: white;
    padding: 25px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.login-title {
    text-align: center;
    margin-bottom: 25px;
    color: #1e293b;
    font-size: 22px;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    margin-bottom: 20px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.error-msg {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
}

/* 注册页头像预览 */
.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f1f5f9;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #e2e8f0;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 个人主页 */
.profile-header {
    background: white;
    border-radius: 16px;
    padding: 25px 20px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    overflow: hidden;
    border: 3px solid #e2e8f0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-qq {
    background: #f1f5f9;
    padding: 6px 16px;
    border-radius: 30px;
    display: inline-block;
    font-size: 14px;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f1f5f9;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}