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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #ff2442;
    margin: 0;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav a:hover,
.nav a.active {
    background-color: #ff2442;
    color: #fff;
}

/* 美化添加按钮 */
.nav a.add-button {
    background: linear-gradient(135deg, #ff2442 0%, #ff6b81 100%);
    color: #fff;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav a.add-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav a.add-button:hover::before {
    left: 100%;
}

.nav a.add-button:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 36, 66, 0.5);
    background: linear-gradient(135deg, #e01e37 0%, #ff4757 100%);
}

.nav a.add-button:active {
    transform: translateY(0) scale(0.98);
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 主内容区 */
main {
    min-height: calc(100vh - 120px);
}

/* 笔记瀑布流布局 */
.notes-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.notes-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    /* 确保每列宽度稳定，防止图片加载过程中变形 */
    width: calc(33.333% - 13.333px);
}

/* 笔记项样式 */
.note-item {
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* 确保笔记项宽度稳定，防止图片加载过程中变形 */
    width: 100%;
    max-width: 100%;
}

.note-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.note-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 笔记媒体样式 */
.note-media {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
    padding-top: 100%; /* 默认1:1宽高比 */
}

.media-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.note-media:hover .media-content {
    transform: scale(1.05);
}

.note-media video {
    background-color: #000;
}

.note-media i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 40px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.note-media:hover i {
    opacity: 1;
}

/* 笔记信息样式 */
.note-info {
    padding: 12px;
}

.note-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.note-title-small {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-preview {
    font-size: 14px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.6;
}

/* 加载状态样式 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 40px 0;
    color: #666;
    font-size: 16px;
}

.loading i {
    font-size: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 笔记详情页样式 */
.note-detail {
    background-color: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 媒体滑块样式 */
.media-slider {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background-color: #f5f5f5;
}

.media-slider-container {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.media-slider-wrapper {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
    touch-action: pan-y;
}

.media-slider-item {
    flex: 0 0 100%;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
}

.media-slider-item img,
.media-slider-item video {
    width: 100%;
    height: auto;
    max-height: 200vw; /* 最大高度不超过宽度的两倍 */
    object-fit: contain;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

/* 独立查看模态框 */
.media-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.media-modal.active {
    display: flex;
}

.media-modal-content {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.media-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 10001;
}

.media-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-modal-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.media-modal-nav.prev {
    left: 20px;
}

.media-modal-nav.next {
    right: 20px;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn-prev {
    left: 10px;
}

.slider-btn-next {
    right: 10px;
}

.slider-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background-color: #fff;
    transform: scale(1.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.note-content {
    margin-bottom: 40px;
}

.note-content .note-title {
    font-size: 28px;
    margin-bottom: 16px;
    display: block;
    -webkit-line-clamp: unset;
}

.note-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.note-media-large {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
}

.media-large-content {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.note-text {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
}

/* 相关推荐样式 */
.related-notes {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.related-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.related-item {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.related-item:hover {
    transform: translateY(-2px);
}

/* 管理面板样式 */
.admin-panel {
    background-color: #fff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    margin: 0 auto;
}

.panel-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #333;
    text-align: center;
}

/* 表单样式 */
.note-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff2442;
    box-shadow: 0 0 0 2px rgba(255, 36, 66, 0.1);
}

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

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

/* 美化文件上传区域 */
.file-upload-container {
    position: relative;
    margin-bottom: 16px;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border: 2px dashed #ddd;
    border-radius: 12px;
    background-color: #fafafa;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    gap: 12px;
}

.file-upload-label:hover {
    border-color: #ff2442;
    background-color: #fff5f5;
    color: #ff2442;
}

.file-upload-label.dragover {
    border-color: #ff2442;
    background-color: #fff5f5;
    transform: scale(1.02);
}

.file-upload-label i {
    font-size: 40px;
}

.file-upload-label span {
    font-size: 16px;
    font-weight: 500;
}

/* 文件预览样式 */
.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.file-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 120px;
}

.preview-media {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f0f0f0;
}

.preview-media.video {
    background-color: #000;
}

.preview-filename {
    font-size: 12px;
    color: #666;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.help-text {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 10px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #e01e37;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.3);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

/* 消息样式 */
.success-message,
.error-message {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

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

.success-message a {
    color: #155724;
    font-weight: 600;
    text-decoration: underline;
}

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

/* 未找到样式 */
.not-found {
    text-align: center;
    padding: 60px 20px;
}

.not-found h2 {
    font-size: 24px;
    color: #666;
    margin-bottom: 20px;
}

/* 面包屑导航样式 */
.breadcrumb {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    list-style: none;
    padding: 0;
}

.breadcrumb-item a {
    color: #ff2442;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #e01e37;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #333;
}

.breadcrumb-item::after {
    content: '>';
    margin-left: 8px;
    color: #999;
}

.breadcrumb-item:last-child::after {
    display: none;
}

/* 关键词标签样式 */
.note-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.keyword-tag {
    display: inline-block;
    background-color: #f0f0f0;
    color: #333;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.keyword-tag:hover {
    background-color: #ff2442;
    color: #fff;
    border-color: #ff2442;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.2);
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #ff2442;
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: #e01e37;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 36, 66, 0.4);
}

/* 页脚样式 */
footer {
    background-color: #fff;
    border-top: 1px solid #eee;
    margin-top: 40px;
    padding: 20px 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ff2442;
    text-decoration: underline;
}

.copyright {
    color: #999;
    font-size: 13px;
}

.copyright p {
    margin: 0;
}

/* 客服窗样式 */
.service-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.service-toggle {
    background: linear-gradient(135deg, #ff2442 0%, #ff6b81 100%);
    color: #fff;
    width: 50px;
    height: 150px;
    border-radius: 25px 0 0 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: -2px 2px 12px rgba(255, 36, 66, 0.3);
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1001;
}

.service-toggle:hover {
    background: linear-gradient(135deg, #e01e37 0%, #ff4757 100%);
    width: 60px;
    box-shadow: -4px 4px 16px rgba(255, 36, 66, 0.4);
    transform: translateX(-5px);
}

.service-panel {
    position: absolute;
    right: -320px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
    border-radius: 16px 0 0 16px;
    padding: 25px;
    box-shadow: -6px 6px 20px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease-out;
    min-width: 310px;
    border: 1px solid rgba(255, 36, 66, 0.1);
    backdrop-filter: blur(10px);
    z-index: 999;
}

.service-sidebar:hover .service-panel, .service-sidebar.active .service-panel {
    right: 50px;
    transition: right 0.3s ease-out;
}

.service-qrcode {
    text-align: center;
    margin-bottom: 20px;
}

.service-qrcode img {
    width: 190px;
    height: 190px;
    margin: 0 auto 15px;
    display: block;
    border: 3px solid rgba(255, 36, 66, 0.2);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-out;
    background: #fff;
    padding: 8px;
}

.service-qrcode img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 36, 66, 0.2);
    transition: all 0.3s ease-out;
}

.service-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
    background: linear-gradient(135deg, #ff2442 0%, #ff6b81 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    text-align: center;
}

.service-desc {
    font-size: 15px;
    color: #555;
    line-height: 1.8;
    white-space: pre-line;
    margin-bottom: 15px;
    font-weight: 500;
    background: linear-gradient(135deg, #333 0%, #666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.service-tag {
    display: inline-block;
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    color: #ff2442;
    font-size: 13px;
    padding: 6px 16px;
    border-radius: 20px;
    margin: 0;
    font-weight: 600;
    border: 1px solid rgba(255, 36, 66, 0.2);
    box-shadow: 0 2px 8px rgba(255, 36, 66, 0.1);
    transition: all 0.3s ease-out;
    flex-shrink: 0;
}

.service-tag:hover {
    background: linear-gradient(135deg, #ff2442 0%, #ff6b81 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 36, 66, 0.2);
}

/* 详情页底部二维码 */
.service-footer {
    margin: 60px 0 40px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.service-footer-content {
    display: flex;
    align-items: center;
    gap: 40px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.service-footer .service-qrcode img {
    width: 120px;
    height: 120px;
    border: 3px solid rgba(255, 215, 0, 0.4);
    padding: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.service-footer .service-qrcode img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.service-footer .service-info {
    flex: 1;
    min-width: 0;
}

.service-footer .service-title {
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: left;
}

.service-footer .service-desc {
    font-size: 16px;
    margin-bottom: 0;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: left;
    line-height: 1.8;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    /* 宽屏适配，确保客服窗稳定显示 */
    .service-panel {
        transition: right 0.3s ease-out;
    }
}

@media (max-width: 768px) {
    /* 媒体滑块适配 */
    .slider-btn {
        display: none;
    }
    
    /* 客服窗适配 */
    .service-panel {
        right: -100%;
        min-width: auto;
        width: calc(100% - 50px);
        max-width: 300px;
        transition: right 0.3s ease-out;
        padding: 15px;
    }
    
    .service-sidebar:hover .service-panel,
    .service-sidebar.active .service-panel {
        right: 0;
    }
    
    /* 移动端客服窗样式 */
    .service-panel .service-qrcode img {
        width: 150px;
        height: 150px;
    }
    
    .service-panel .service-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .service-panel .service-desc {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* 底部二维码适配 */
    .service-footer-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .service-footer .service-qrcode img {
        width: 60px;
        height: 60px;
    }
    
    /* 基础样式适配 */
    .container {
        padding: 12px;
    }
    
    .notes-grid {
        flex-direction: column;
        gap: 12px;
    }
    
    .header-content {
        padding: 12px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .nav {
        gap: 15px;
    }
    
    .note-media {
        padding-top: 150%; /* 3:4 宽高比，更适合移动端 */
    }
    
    .nav a {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    /* 移动端添加按钮适配 */
    .nav a.add-button {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .admin-panel {
        padding: 20px 16px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* 平板端：显示两列 */
    .notes-grid {
        flex-direction: row;
        gap: 12px;
        flex-wrap: nowrap;
    }
    
    .notes-column {
        flex: 1;
        gap: 12px;
        /* 确保每列宽度稳定，防止图片加载过程中变形 */
        width: calc(50% - 6px);
    }
    
    /* 隐藏第三列，只显示两列 */
    .notes-column:nth-child(3) {
        display: none;
    }
    
    /* 移动端隐藏面包屑导航 */
    .breadcrumb {
        display: none;
    }
}


@media (max-width: 480px) {
    /* 移动端：显示两列 */
    .notes-grid {
        flex-direction: row;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .notes-column {
        flex: 1;
        gap: 8px;
        /* 确保每列宽度稳定，防止图片加载过程中变形 */
        width: calc(50% - 4px);
    }
    
    /* 隐藏第三列，只显示两列 */
    .notes-column:nth-child(3) {
        display: none;
    }
    
    .note-title {
        font-size: 14px;
    }
    
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 关键词链接在移动端不跳转，但可点击选中 */
    .keyword-tag {
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    /* 关键词选中状态样式 */
    .keyword-tag.selected {
        background-color: #ff2442;
        color: #fff;
        border-color: #ff2442;
    }
}