/* --- Material 3 变量定义 --- */
:root {
    --md-sys-color-primary: #1A367C;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d1e4ff;
    --md-sys-color-surface: #fdfbff;
    --md-sys-color-surface-container: #f3f3f8;
    --md-sys-color-outline-variant: #c4c6d0;
    --md-sys-color-secondary: #535f70;

    /* 动画曲线：标准的 M3 缓动 */
    --easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --easing-emphasized: cubic-bezier(0.3, 0, 0, 1);
}

/* --- 全局重置与基础 --- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    background-color: var(--md-sys-color-surface);
    font-family: "PingFang SC", "Inter", system-ui, sans-serif;
    color: #1a1c1e;
    overflow-x: hidden;
}

/* --- 响应式三栏布局布局 --- */
.app-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 0;
    height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- 侧边栏通用样式 --- */
.side-panel {
    padding: 32px 24px;
    overflow-y: auto;
    background: var(--md-sys-color-surface);
    border-inline: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- 个人信息卡片动画 --- */
.profile-card {
    background: var(--md-sys-color-surface-container);
    border-radius: 28px;
    padding: 24px;
    text-align: center;
    transition: transform 0.4s var(--easing-emphasized), box-shadow 0.4s;
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.05);
}

.avatar-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--md-sys-color-primary), #4c66af);
    color: white;
    border-radius: 24px; /* M3 风格的圆角矩形头像 */
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    box-shadow: 0 8px 16px rgba(26, 54, 124, 0.2);
    animation: avatar-pop 0.6s var(--easing-standard);
}

@keyframes avatar-pop {
    0% { transform: scale(0.5) rotate(-15deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* --- 搜索栏：丝滑动效 --- */
.search-container {
    position: sticky;
    top: 0;
    background: rgba(253, 251, 255, 0.8);
    backdrop-filter: blur(12px);
    padding: 16px 0;
    z-index: 10;
}

.search-input {
    width: 100%;
    padding: 16px 28px;
    border-radius: 100px;
    border: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container);
    font-size: 16px;
    transition: all 0.3s var(--easing-standard);
}

.search-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--md-sys-color-primary-container);
    transform: scale(1.01);
}

/* --- 帖子卡片：入场动画 --- */
.post-card {
    background: #fff;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--md-sys-color-outline-variant);
    opacity: 0;
    transform: translateY(20px);
    animation: post-appear 0.5s var(--easing-standard) forwards;
}

@keyframes post-appear {
    to { opacity: 1; transform: translateY(0); }
}

/* --- 发布区交互 --- */
.publish-box {
    background: #fff;
    border-radius: 28px;
    padding: 24px;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.textarea-wrapper textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    padding: 12px;
    font-size: 16px;
    resize: none;
    background: transparent;
}

.textarea-wrapper textarea:focus { outline: none; }

/* 图片预览动画 */
#imagePreview {
    width: 100%;
    border-radius: 16px;
    margin-top: 12px;
    display: none;
    animation: expand-down 0.4s var(--easing-emphasized);
}

@keyframes expand-down {
    from { transform: scaleY(0); opacity: 0; }
    to { transform: scaleY(1); opacity: 1; }
}

/* --- 按钮动画 --- */
.btn-m3 {
    background: var(--md-sys-color-primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.btn-m3:hover {
    box-shadow: 0 4px 12px rgba(26, 54, 124, 0.3);
    filter: brightness(1.1);
}

.btn-m3:active {
    transform: scale(0.95);
}

/* --- 响应式适配 --- */
@media (max-width: 1100px) {
    .app-wrapper {
        grid-template-columns: 1fr;
    }
    .side-panel {
        display: none; /* 在手机端可以做成抽屉式菜单 */
    }
}