/* ========== 基础重置 ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: #f5f6fa;
    color: #2d3436;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

a {
    color: #0984e3;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ========== 导航栏 ========== */
.navbar {
    background: #2d3436;
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-links a {
    color: #dfe6e9;
    font-size: 0.95rem;
}
.nav-links a:hover {
    color: #fff;
    text-decoration: none;
}

.nav-links .admin-link {
    color: #ffeaa7;
    font-weight: 600;
}

.nav-user {
    color: #74b9ff;
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* ========== 闪现消息 ========== */
.flash {
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 6px;
    font-size: 0.95rem;
    border-left: 4px solid;
}

.flash-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.flash-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.flash-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.flash-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* ========== 主内容区 ========== */
main {
    flex: 1;
    padding: 24px 16px;
}

h1 { font-size: 1.6rem; margin-bottom: 16px; }
h2 { font-size: 1.3rem; margin: 20px 0 12px; }
h3 { font-size: 1.1rem; }

/* ========== 卡片 ========== */
.post-card, .comment-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.post-card-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

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

.post-card-thumb {
    flex-shrink: 0;
}

.thumb-img {
    border-radius: 6px;
    object-fit: cover;
    background: #eee;
    /* 骨架屏效果：灰色占位，加载后显示图片 */
}

.thumb-img:not([src]), .thumb-img[src=""] {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.post-card h3 {
    margin-bottom: 6px;
}
.post-card h3 a {
    color: #2d3436;
}
.post-card h3 a:hover {
    color: #0984e3;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: #636e72;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.post-excerpt {
    color: #636e72;
    margin-bottom: 10px;
}

/* ========== 帖子详情 ========== */
.post-detail {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.post-content {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========== 评论 ========== */
.comments-section {
    margin-bottom: 24px;
}

.comment-card {
    padding: 14px 18px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.comment-time {
    color: #b2bec3;
    font-size: 0.82rem;
}

.comment-form {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
}

/* ========== 表单 ========== */
.auth-form {
    max-width: 420px;
    margin: 40px auto;
    background: #fff;
    padding: 32px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.post-form {
    max-width: 720px;
    background: #fff;
    padding: 28px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.1);
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: #636e72;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none !important;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: #0984e3;
    color: #fff;
}
.btn-primary:hover {
    background: #0773c5;
}

.btn-secondary {
    background: #dfe6e9;
    color: #2d3436;
}
.btn-secondary:hover {
    background: #b2bec3;
}

.btn-danger {
    background: #e17055;
    color: #fff;
}
.btn-danger:hover {
    background: #d63031;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.82rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ========== 分类筛选 ========== */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.cat-tag {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    background: #fff;
    color: #636e72;
    border: 1px solid #ddd;
    text-decoration: none !important;
    transition: all 0.2s;
}

.cat-tag:hover {
    border-color: #0984e3;
    color: #0984e3;
}

.cat-tag.cat-active {
    background: #0984e3;
    color: #fff;
    border-color: #0984e3;
}

/* ========== 组合筛选（按钮 + 弹窗） ========== */
.combined-filter {
    position: relative;
    margin-bottom: 12px;
    display: inline-block;
}

.btn-filter {
    background: #fff;
    color: #2d3436;
    border: 1px solid #ddd;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
.btn-filter:hover {
    border-color: #0984e3;
    color: #0984e3;
    background: #f0f4ff;
}

.filter-indicator {
    color: #e17055;
    font-size: 0.65rem;
    animation: pulse 2s infinite;
}

/* 遮罩层 */
.filter-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.2);
    z-index: 200;
}

/* 弹窗面板 */
.filter-popup {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 201;
    width: 520px;
    max-width: calc(100vw - 32px);
    overflow: hidden;
}

.filter-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #eee;
}
.filter-popup-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #2d3436;
}

.filter-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #b2bec3;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}
.filter-close:hover {
    color: #d63031;
    background: #f8d7da;
}

.filter-popup-body {
    padding: 16px 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.filter-popup-footer {
    display: flex;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid #eee;
    justify-content: flex-end;
}

/* 筛选区块 */
.filter-section {
    margin-bottom: 18px;
}
.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-section-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d3436;
    display: block;
    margin-bottom: 8px;
}
.filter-section-header .filter-section-title {
    margin-bottom: 0;
}

.filter-section-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
}

.filter-quick-link {
    color: #0984e3;
    text-decoration: none !important;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}
.filter-quick-link:hover {
    background: #e8f4fd;
}

.filter-quick-sep {
    color: #ddd;
    user-select: none;
}

/* 分类勾选框网格 */
.filter-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #2d3436;
    transition: background 0.15s;
    user-select: none;
    border: 1px solid transparent;
}
.filter-checkbox-item:hover {
    background: #f0f4ff;
}
.filter-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #0984e3;
    flex-shrink: 0;
}
.filter-checkbox-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 打卡分类特殊样式 */
.checkin-cat {
    background: #fef9e7;
    border-color: #f9e79f;
}
.checkin-cat:hover {
    background: #fdf2d1;
}

.checkin-badge {
    display: inline-block;
    background: #e17055;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* 时间行 */
.filter-time-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* 当前激活筛选标签 */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    min-height: 0;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 500;
    gap: 4px;
}

.filter-tag-module {
    background: #e8f4fd;
    color: #0984e3;
}

.filter-tag-default {
    background: #f0f0f0;
    color: #636e72;
}

.filter-tag-time {
    background: #f0f4ff;
    color: #636e72;
}

/* 移动端弹窗全宽 */
@media (max-width: 560px) {
    .filter-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        margin-top: 0;
        border-radius: 16px 16px 0 0;
        width: 100%;
        max-width: 100%;
        max-height: 80vh;
    }
    .filter-popup-body {
        max-height: 50vh;
    }
    .filter-checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .btn-filter {
        width: 100%;
        justify-content: center;
    }
    .combined-filter {
        display: block;
    }
}

.cat-link {
    color: #0984e3;
    background: #e8f4fd;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-decoration: none !important;
}

.cat-link:hover {
    background: #0984e3;
    color: #fff;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0;
}

.page-info {
    color: #636e72;
    font-size: 0.9rem;
}

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

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.text-muted {
    color: #b2bec3;
}

/* ========== 后台管理 ========== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.admin-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 10px 20px;
    border-radius: 6px;
    color: #2d3436;
    font-weight: 500;
    font-size: 0.9rem;
}

.admin-nav a:hover {
    background: #f0f0f0;
    text-decoration: none;
}

.admin-nav a.active {
    background: #0984e3;
    color: #fff;
}

/* 仪表盘统计 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 28px 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.stat-number {
    font-size: 2.4rem;
    font-weight: 700;
    color: #0984e3;
}

.stat-label {
    color: #636e72;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ========== 表格 ========== */
.admin-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #636e72;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: #f8f9ff;
}

.admin-table .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* 角色标签 */
.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.role-admin {
    background: #ffeaa7;
    color: #d63031;
}

.role-user {
    background: #dfe6e9;
    color: #636e72;
}

/* ========== 权限徽章 ========== */
.perm-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
}

.perm-high {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.perm-low {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.perm-legend {
    margin-top: 12px;
}

.nav-perm {
    font-size: 0.75rem;
    color: #b2bec3;
    margin-left: 2px;
}

/* ========== 上传区 ========== */
.upload-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.upload-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.upload-form .form-group {
    margin-bottom: 0;
}

/* ========== 页脚 ========== */
.footer {
    background: #2d3436;
    color: #b2bec3;
    text-align: center;
    padding: 16px;
    font-size: 0.85rem;
    margin-top: auto;
}

/* ========== 图片/视频画廊 ========== */
.image-gallery, .media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.gallery-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s, opacity 0.3s;
    background: #f0f0f0;
}

.gallery-img:hover {
    transform: scale(1.03);
}

/* 视频播放器 */
.gallery-video {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.gallery-video-player {
    width: 100%;
    max-height: 400px;
    display: block;
    border-radius: 6px;
    outline: none;
}

/* 编辑页面 — 现有视频预览占位 */
.existing-video-preview {
    width: 160px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #2d3436;
    border-radius: 6px;
    border: 2px solid #ddd;
    gap: 4px;
}

.video-icon {
    font-size: 2rem;
}

.video-label {
    color: #b2bec3;
    font-size: 0.78rem;
    font-weight: 500;
}

/* 图片未加载时的占位动画 */
img[loading="lazy"] {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

img[loading="lazy"]:not([src]), img[src=""] {
    min-height: 100px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 图片预览网格（发帖时） */
.image-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.image-preview-grid img {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

/* 现有图片勾选 */
.existing-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-checkbox {
    position: relative;
    cursor: pointer;
}

.image-checkbox input {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.image-checkbox img {
    width: 160px;
    height: 120px;
    border-radius: 6px;
    border: 2px solid #ddd;
    object-fit: cover;
}

.image-checkbox input:not(:checked) + img {
    opacity: 0.35;
    border-color: #e17055;
}

/* ========== 搜索栏 ========== */
.search-bar {
    margin-bottom: 20px;
}

.search-bar form {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 3px rgba(9,132,227,0.1);
}

.search-info {
    margin-top: 8px;
    color: #636e72;
    font-size: 0.9rem;
}

/* ========== 时间筛选栏 ========== */
.time-filter {
    margin-bottom: 20px;
}

.time-filter-form {
    display: flex;
    align-items: center;
}

.time-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.time-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    min-width: 130px;
}

.time-select:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 3px rgba(9,132,227,0.1);
}

.time-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    width: 150px;
}

.date-input:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 3px rgba(9,132,227,0.1);
}

.date-sep {
    color: #636e72;
    font-size: 0.85rem;
    user-select: none;
}

.hash-code {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-family: 'Courier New', monospace;
    color: #d63031;
}

/* ========== 隐私模式 ========== */
.privacy-login-group {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 14px 16px;
}

.privacy-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
}

.privacy-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #d63031;
}

.privacy-checkbox-text strong {
    color: #d63031;
}

.privacy-hint {
    margin-top: 6px;
    margin-left: 30px;
    font-size: 0.82rem;
}

/* 隐私模式折叠面板 */
.privacy-details {
    margin-top: 10px;
    margin-left: 30px;
}

.privacy-summary {
    cursor: pointer;
    color: #d63031;
    font-size: 0.85rem;
    font-weight: 600;
    user-select: none;
    padding: 4px 0;
}

.privacy-summary:hover {
    color: #b71c1c;
}

.privacy-details-body {
    margin-top: 8px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 0.84rem;
    color: #636e72;
    line-height: 1.8;
}

.privacy-details-body ul {
    margin: 6px 0 0 18px;
    padding: 0;
}

.privacy-details-body li {
    margin-bottom: 2px;
}

.privacy-badge {
    background: #d63031;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

.private-tag {
    background: #ffeaa7;
    color: #d63031;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========== 免登录复选框 ========== */
.remember-me-group {
    background: #e8f4fd;
    border: 1px solid #74b9ff;
    border-radius: 8px;
    padding: 12px 16px;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
}

.remember-me-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #0984e3;
}

.remember-me-text {
    color: #0984e3;
    font-weight: 600;
}

.remember-me-hint {
    margin-top: 4px;
    margin-left: 30px;
    font-size: 0.82rem;
}

/* ========== 标题前缀预览 ========== */
.title-prefix-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
}

.title-prefix {
    background: #2d3436;
    color: #ffeaa7;
    padding: 10px 12px;
    border-radius: 6px 0 0 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
}

.title-prefix + input {
    border-radius: 0 6px 6px 0 !important;
}

/* ========== 首页功能卡片 ========== */
.home-welcome {
    text-align: center;
    padding: 40px 0 20px;
}

.home-welcome h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.home-subtitle {
    color: #636e72;
    font-size: 1.1rem;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.feature-card {
    background: #fff;
    border-radius: 12px;
    padding: 36px 28px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    text-decoration: none !important;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(9, 132, 227, 0.15);
    border-color: #0984e3;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.feature-card h2 {
    margin: 0 0 10px;
    color: #2d3436;
    font-size: 1.4rem;
}

.feature-card p {
    color: #636e72;
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.feature-link {
    display: inline-block;
    color: #0984e3;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ========== 待办清单 ========== */
.todo-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.todo-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.todo-input:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.1);
}

.todo-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
    position: relative;
}

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

.todo-item:hover {
    background: #f8f9ff;
}

/* 拖拽手柄 */
.drag-handle {
    cursor: grab;
    color: #b2bec3;
    font-size: 1.2rem;
    padding: 4px 6px;
    user-select: none;
    flex-shrink: 0;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.drag-handle:hover {
    color: #2d3436;
    background: #eee;
}

.drag-handle:active {
    cursor: grabbing;
}

/* 复选框表单 */
.todo-check-form {
    flex-shrink: 0;
    display: flex;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #0984e3;
    flex-shrink: 0;
}

/* 标题 */
.todo-title {
    flex: 1;
    font-size: 0.95rem;
    word-break: break-word;
    cursor: default;
    user-select: none;
}

/* 已完成样式 */
.todo-completed .todo-title {
    text-decoration: line-through;
    color: #b2bec3;
}

/* 操作按钮（默认显示） */
.todo-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* 内联编辑表单 */
.todo-edit-form {
    display: flex;
    gap: 6px;
    flex: 1;
    align-items: center;
}

.todo-edit-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #0984e3;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.todo-edit-input:focus {
    outline: none;
}

/* 拖拽幽灵 */
.todo-ghost {
    opacity: 0.4;
    background: #e8f4fd !important;
}

/* 统计 */
.todo-stats {
    text-align: center;
    color: #636e72;
    font-size: 0.9rem;
    padding: 8px 0;
}

.todo-stats strong {
    color: #0984e3;
}

/* ========== 点赞按钮 ========== */
.like-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: #636e72;
}
.like-btn:hover {
    border-color: #e17055;
    background: #fff5f5;
}
.like-btn.liked {
    color: #d63031;
    border-color: #d63031;
    background: #ffeaea;
}
.like-btn-sm {
    padding: 3px 10px;
    font-size: 0.8rem;
}
.like-count {
    font-weight: 600;
}

/* ========== 帖子操作栏 ========== */
.post-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

/* ========== 评论操作 ========== */
.comment-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}
.reply-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 3px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
    color: #636e72;
    transition: all 0.2s;
}
.reply-btn:hover {
    border-color: #0984e3;
    color: #0984e3;
}
.comment-user {
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-avatar, .comment-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.comment-avatar-placeholder {
    background: #0984e3;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}
.comment-content {
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========== 导航栏头像 ========== */
.nav-avatar-link {
    display: flex;
    align-items: center;
    padding: 0 !important;
}
.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    transition: border-color 0.2s;
}
.nav-avatar:hover {
    border-color: #fff;
}
.nav-avatar-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #0984e3;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.3);
    text-decoration: none !important;
}

/* ========== 通知徽章 ========== */
.notif-link {
    position: relative;
}
.notification-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #d63031;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    animation: pulse 2s infinite;
}

/* ========== 通知列表 ========== */
.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.notifications-header h1 {
    margin-bottom: 0;
}
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.notification-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 8px;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.15s;
    position: relative;
}
.notification-item:hover {
    background: #f0f4ff;
}
.notification-item.unread {
    background: #e8f4fd;
    border-left: 3px solid #0984e3;
}
.notif-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}
.notif-body {
    flex: 1;
    min-width: 0;
}
.notif-content {
    margin: 0 0 4px;
    font-size: 0.95rem;
}
.notif-time {
    font-size: 0.8rem;
    color: #b2bec3;
}
.notif-unread-dot {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0984e3;
}

/* ========== 好友页 ========== */
.friend-search {
    margin-bottom: 24px;
}
.search-results {
    background: #fff;
    border-radius: 8px;
    margin-top: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}
.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.mini-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #636e72;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

/* 好友 Tab */
.friends-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.friends-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
    color: #636e72;
    font-weight: 500;
    transition: all 0.15s;
    position: relative;
}
.friends-tab:hover {
    background: #f0f0f0;
}
.friends-tab.active {
    background: #0984e3;
    color: #fff;
}
.tab-badge {
    background: #d63031;
    color: #fff;
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}
.friend-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
}
.friend-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.friend-card:last-child {
    border-bottom: none;
}
.friend-avatar-link {
    flex-shrink: 0;
}
.friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.friend-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0984e3;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
}
.friend-info {
    flex: 1;
    min-width: 0;
}
.friend-info a {
    color: #2d3436;
}
.friend-info .text-muted {
    font-size: 0.78rem;
}
.friend-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.pending-label {
    color: #b2bec3;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ========== 用户主页 ========== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    flex-wrap: wrap;
}
.profile-avatar-section {
    position: relative;
    flex-shrink: 0;
}
.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0984e3;
}
.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #0984e3;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    border: 3px solid #0984e3;
}
.avatar-upload-overlay {
    margin-top: 8px;
    text-align: center;
}
.avatar-upload-label {
    font-size: 0.85rem;
    color: #0984e3;
    cursor: pointer;
    text-decoration: underline;
}
.avatar-form {
    display: inline;
}
.profile-info {
    flex: 1;
    min-width: 200px;
}
.profile-info h1 {
    margin-bottom: 8px;
}
.profile-meta {
    color: #636e72;
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.profile-notes {
    background: #fff3cd;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}
.profile-actions {
    flex-shrink: 0;
}
.profile-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}
.stat-item {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #0984e3;
}
.stat-label {
    font-size: 0.85rem;
    color: #636e72;
}

/* ========== 软删除横幅 ========== */
.deleted-banner {
    background: #ffeaa7;
    border: 1px solid #fdcb6e;
    color: #d63031;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    text-align: center;
}

/* ========== 编辑历史 ========== */
.edit-history {
    margin-top: 20px;
}

.history-table .history-row-header td {
    vertical-align: middle;
}

.version-detail td {
    padding: 0 !important;
    background: #f8f9fa;
}

.version-preview {
    padding: 24px 28px;
    max-width: 100%;
    overflow-x: auto;
}

.version-preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.version-badge {
    display: inline-block;
    background: #0984e3;
    color: #fff;
    padding: 3px 12px;
    border-radius: 14px;
    font-size: 0.82rem;
    font-weight: 600;
}

.version-editor {
    color: #636e72;
    font-size: 0.82rem;
    margin-left: auto;
}

.version-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: #2d3436;
    line-height: 1.4;
}

.version-preview .image-gallery {
    margin: 12px 0 16px;
    padding-top: 0;
    border-top: none;
}

.version-body {
    margin-top: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.8;
    color: #2d3436;
    font-size: 0.95rem;
    padding: 16px 18px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    max-height: 600px;
    overflow-y: auto;
}

.toggle-ver-btn {
    min-width: 80px;
    text-align: center;
    transition: all 0.15s;
}

/* ========== 响应式 ========== */
@media (max-width: 600px) {
    .nav-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-meta {
        flex-direction: column;
        gap: 4px;
    }

    .admin-nav a {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .upload-form {
        flex-direction: column;
    }

    .admin-table {
        font-size: 0.8rem;
    }
    .admin-table th,
    .admin-table td {
        padding: 8px 6px;
    }
}

/* ========== 日程 Tab 切换 ========== */
.schedule-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #fff;
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.schedule-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 8px;
    color: #636e72;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}
.schedule-tab:hover {
    background: #f0f0f0;
    color: #2d3436;
}
.schedule-tab.active {
    background: #0984e3;
    color: #fff;
}

/* ========== 日历 ========== */
.calendar {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.calendar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3436;
}
.calendar-nav {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.15s;
    color: #636e72;
}
.calendar-nav:hover {
    background: #0984e3;
    color: #fff;
    border-color: #0984e3;
}
.calendar-today-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.15s;
    color: #0984e3;
    margin: 0 4px;
}
.calendar-today-btn:hover {
    background: #0984e3;
    color: #fff;
    border-color: #0984e3;
}

/* 日历星期头 */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
}
.calendar-weekday {
    font-size: 0.85rem;
    font-weight: 600;
    color: #636e72;
    padding: 8px 0;
}
.calendar-weekday:first-child,
.calendar-weekday:last-child {
    color: #d63031;
}

/* 日历网格 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    font-size: 0.95rem;
    font-weight: 500;
    color: #2d3436;
    min-height: 44px;
}
.calendar-day:hover {
    background: #f0f4ff;
}
.calendar-day.other-month {
    color: #ccc;
    cursor: default;
}
.calendar-day.today {
    border: 2px solid #0984e3;
    font-weight: 700;
}
.calendar-day.has-schedules {
    background: #fff5f5;
    color: #d63031;
    font-weight: 700;
}
.calendar-day.has-schedules::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d63031;
}
.calendar-day.has-schedules.today {
    background: #d63031;
    color: #fff;
    border-color: #c0392b;
}
.calendar-day.has-schedules.today::after {
    background: #fff;
}
.calendar-day.selected {
    background: #0984e3;
    color: #fff;
    box-shadow: 0 2px 8px rgba(9, 132, 227, 0.3);
}
.calendar-day.selected::after {
    background: #fff;
}
.calendar-day.selected.has-schedules {
    background: #0984e3;
    color: #fff;
}
.calendar-day.selected.has-schedules::after {
    background: #fff;
}

/* ========== 日程列表 ========== */
.schedule-panel {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.schedule-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.schedule-panel-header h3 {
    margin: 0;
}
.schedule-date-badge {
    background: #0984e3;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.schedule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #f8f9fa;
    border-left: 4px solid #4a90d9;
    transition: background 0.15s;
}
.schedule-item:hover {
    background: #f0f4ff;
}
.schedule-date-group {
    margin-bottom: 12px;
}
.schedule-date-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3436;
    padding: 6px 0 4px 0;
    border-bottom: 1px solid #dfe6e9;
    margin-bottom: 6px;
}
.schedule-time {
    font-size: 0.85rem;
    color: #636e72;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 60px;
}
.schedule-title {
    flex: 1;
    font-size: 0.95rem;
    word-break: break-word;
}
.schedule-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* 日程添加/编辑表单 */
.schedule-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
}
.schedule-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0;
}
.schedule-form label {
    font-size: 0.8rem;
    color: #636e72;
    font-weight: 500;
}
.schedule-form input[type="text"],
.schedule-form input[type="date"],
.schedule-form input[type="time"] {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}
.schedule-form input[type="text"]:focus,
.schedule-form input[type="date"]:focus,
.schedule-form input[type="time"]:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.15);
}
.schedule-form .form-title {
    flex: 2;
    min-width: 150px;
}
.schedule-form .form-date {
    flex: 1;
    min-width: 130px;
}
.schedule-form .form-time {
    flex: 0.5;
    min-width: 100px;
}
.schedule-form .form-submit {
    flex-shrink: 0;
    padding-bottom: 0;
}

.schedule-empty {
    text-align: center;
    color: #b2bec3;
    padding: 30px 0;
    font-size: 0.95rem;
}

/* ========== 日程编辑内联 ========== */
.schedule-edit-form {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    flex: 1;
}
.schedule-edit-form input {
    padding: 6px 8px;
    border: 1px solid #0984e3;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
}
.schedule-edit-form input[type="text"] {
    flex: 2;
    min-width: 120px;
}
.schedule-edit-form input[type="date"] {
    flex: 1;
    min-width: 110px;
}
.schedule-edit-form input[type="time"] {
    flex: 0.5;
    min-width: 80px;
}

/* 已完成日程样式 */
.schedule-done {
    opacity: 0.55;
    background: #f5f5f5 !important;
}
.schedule-title-done {
    text-decoration: line-through;
    color: #b2bec3;
}

/* 日程页面筛选标签 */
.filter-link {
    font-size: 0.8rem;
    padding: 3px 10px;
    text-decoration: none;
}

/* ========== 身体状况 — 隐私提示 ========== */
.body-privacy-hint {
    text-align: center;
    padding: 48px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    border: 2px dashed #ddd;
}
.body-privacy-hint h2 {
    color: #2d3436;
    margin: 12px 0 8px;
    font-size: 1.2rem;
}
.body-privacy-hint p {
    color: #636e72;
    font-size: 0.95rem;
}
.body-privacy-icon {
    font-size: 3rem;
}

/* ========== 禁欲日历标记 ========== */
.calendar-day .abstinence-badge {
    font-size: 0.6rem;
    font-weight: 700;
    margin-top: 1px;
    line-height: 1;
}
/* 性行为日 (Day 0)：白字红底 */
.calendar-day.has-activity {
    background: #d63031;
    color: #fff;
    font-weight: 700;
}
.calendar-day.has-activity .abstinence-badge {
    color: #fff;
}
.calendar-day.has-activity.today {
    background: #c0392b;
    color: #fff;
    border-color: #a93226;
}
.calendar-day.has-activity.selected {
    background: #c0392b;
    color: #fff;
}
/* 遗精日：灰色背景 */
.calendar-day.has-emission {
    background: #dfe6e9;
    color: #636e72;
    font-weight: 600;
}
.calendar-day.has-emission .abstinence-badge {
    color: #636e72;
}
.calendar-day.has-emission.today {
    background: #b2bec3;
    color: #2d3436;
    border-color: #636e72;
}
.calendar-day.has-emission.selected {
    background: #b2bec3;
    color: #2d3436;
}
.calendar-day.has-emission.selected .abstinence-badge {
    color: #2d3436;
}
/* 遗精标记小图标（首次性行为之前的遗精日，无 D[N] 时使用） */
.calendar-day .emission-dot {
    font-size: 0.55rem;
    margin-top: 1px;
    line-height: 1;
}
/* 禁欲中（绿色背景，D[N] badge 灰/白字） */
.calendar-day.has-abstinence {
    background: #00b894;
    color: #fff;
    font-weight: 600;
}
.calendar-day.has-abstinence .abstinence-badge {
    color: #dfe6e9;
    font-weight: 600;
}
.calendar-day.has-abstinence.today {
    background: #00a381;
    color: #fff;
    border-color: #008966;
}
.calendar-day.has-abstinence.today .abstinence-badge {
    color: #fff;
}
.calendar-day.has-abstinence.selected {
    background: #00a381;
    color: #fff;
}
.calendar-day.has-abstinence.selected .abstinence-badge {
    color: #fff;
}
/* Day 0 badge（仅性行为日显示） */
.calendar-day .abstinence-badge.day-zero {
    color: #fff;
    background: rgba(255,255,255,0.25);
    border-radius: 8px;
    padding: 1px 5px;
    font-size: 0.55rem;
    margin-top: 2px;
}
/* 遗精日上的 D[N] badge */
.calendar-day .abstinence-badge.on-emission {
    color: #636e72;
}
.calendar-day.has-emission.selected .abstinence-badge.on-emission,
.calendar-day.has-emission.today .abstinence-badge.on-emission {
    color: #2d3436;
}

/* selected 通用覆盖（禁欲绿） */
.calendar-day.has-abstinence.selected .abstinence-badge,
.calendar-day.has-abstinence.today .abstinence-badge {
    color: #fff;
}

/* ========== 活动记录 / 体重记录列表 ========== */
.activity-record-list,
.weight-record-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.activity-record,
.weight-record {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    gap: 10px;
}
.activity-record-info,
.weight-record-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    font-size: 0.9rem;
}
.activity-record-date,
.weight-record-date {
    color: #636e72;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.activity-record-notes,
.weight-record-notes {
    color: #636e72;
    font-size: 0.85rem;
    font-style: italic;
}
.weight-record-value {
    color: #0984e3;
    font-weight: 700;
    font-size: 1rem;
}
.weight-record-height {
    color: #636e72;
    font-size: 0.85rem;
}

/* ========== 遗精记录列表 ========== */
.emission-record-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.emission-record {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f5f6fa;
    border-radius: 8px;
    gap: 10px;
    border-left: 4px solid #b2bec3;
}
.emission-record-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    font-size: 0.9rem;
}
.emission-record-date {
    color: #636e72;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.emission-record-notes {
    color: #636e72;
    font-size: 0.85rem;
    font-style: italic;
}

/* ========== 禁欲天数卡片 + 目标 ========== */
.abstinence-streak-card {
    background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.abstinence-streak-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

/* 服药连续天数卡片 */
.medication-streak-card {
    background: linear-gradient(135deg, #4a148c 0%, #7b1fa2 100%);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.medication-streak-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.streak-main {
    margin-bottom: 6px;
}
.streak-label {
    font-size: 0.95rem;
    color: #b2bec3;
    margin-bottom: 4px;
}
.streak-days {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    color: #00b894;
}
.streak-days.streak-none {
    color: #636e72;
    font-size: 2.5rem;
}
.streak-unit {
    font-size: 1.2rem;
    font-weight: 400;
    color: #dfe6e9;
}
.streak-since {
    font-size: 0.8rem;
    color: #b2bec3;
    margin-top: 4px;
}
.streak-empty-state .streak-since {
    color: #636e72;
}
.streak-goal {
    margin: 14px 0 8px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
}
.goal-info {
    font-size: 0.85rem;
    color: #dfe6e9;
    margin-bottom: 8px;
}
.goal-info strong {
    color: #fff;
}
.goal-achieved {
    color: #00b894;
    font-weight: 700;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.goal-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.goal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00b894, #00cec9);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.goal-progress-fill.achieved {
    background: linear-gradient(90deg, #fdcb6e, #e17055);
}
.goal-progress-text {
    font-size: 0.75rem;
    color: #b2bec3;
    text-align: right;
}
.goal-set-btn {
    margin-top: 6px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.15);
    color: #dfe6e9;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.goal-set-btn:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.goal-form {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.goal-input {
    width: 120px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.9rem;
}
.goal-input::placeholder {
    color: rgba(255,255,255,0.4);
}
.goal-input:focus {
    outline: none;
    border-color: #00b894;
    background: rgba(255,255,255,0.15);
}
.goal-form .btn-sm {
    font-size: 0.8rem;
    padding: 6px 12px;
}

/* ========== 体重曲线图 ========== */
.chart-container {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    height: 350px;
    position: relative;
}
.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ========== 附件管理系统（动态文件行） ========== */
.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.file-row:hover {
    border-color: #0984e3;
}

.file-row input[type="file"] {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: 0.85rem;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.file-row .file-preview {
    flex-shrink: 0;
    width: 48px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.file-row .file-preview .file-icon {
    font-size: 1.2rem;
}

.file-row .file-info {
    flex-shrink: 0;
    font-size: 0.82rem;
    color: #636e72;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-remove {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #e17055;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.15s;
}

.btn-remove:hover {
    background: #e17055;
    color: #fff;
    border-color: #e17055;
}

.btn-add-file {
    margin-bottom: 6px;
    font-size: 0.85rem;
    padding: 5px 14px;
    border: 1px dashed #0984e3;
    color: #0984e3;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-add-file:hover {
    background: #e8f4fd;
    border-style: solid;
}

.size-indicator {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #636e72;
    transition: color 0.2s;
}

.size-indicator.warning {
    color: #e17055;
    font-weight: 700;
}

/* ========== 服药管理 ========== */

/* 服药日历 */
.calendar-day.has-medication {
    background: #f3e5f5;
    color: #7b1fa2;
    font-weight: 600;
}
.calendar-day.has-medication::after {
    content: '';
    position: absolute;
    bottom: 4px;
    font-size: 0.5rem;
}
.calendar-day.has-medication.today {
    background: #7b1fa2;
    color: #fff;
    border-color: #6a1b9a;
}
.med-dot {
    font-size: 0.5rem;
    margin-top: 1px;
    line-height: 1;
}
/* 服药记录列表 */
.medication-record-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.medication-record {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    gap: 10px;
    border-left: 4px solid #7b1fa2;
}
.medication-record-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
    font-size: 0.9rem;
}
.medication-record-date {
    color: #636e72;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.medication-name {
    color: #7b1fa2;
    font-weight: 700;
}
.medication-dosage {
    color: #0984e3;
    background: #e8f4fd;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}
.medication-notes {
    color: #e17055;
    font-size: 0.82rem;
    font-weight: 500;
}
