/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 禁用移动端点击高亮 */
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    /* 禁用移动端选择文本和点击高亮 */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 允许文本选择的地方 */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* 登录页面样式 */
.login-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 30px 30px 36px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    text-align: center;
}

.login-box h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.question {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 18px;
    line-height: 1.6;
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-message {
    background: rgba(255, 82, 82, 0.2);
    backdrop-filter: blur(10px);
    color: #ff5252;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid rgba(255, 82, 82, 0.3);
    font-weight: 500;
}

.login-box input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    color: #333;
}

.login-box input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.login-box input::placeholder {
    color: #999;
}

.login-box button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.login-box button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.login-box button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    background-position: right center;
}

.login-box button:hover::before {
    left: 100%;
}

.login-box button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 日记页面 */
.diary-page {
    background: linear-gradient(135deg, #f8f4ff 0%, #e3f0ff 100%);
    min-height: 100vh;
    padding: 16px 20px 120px;
    color: #333;
}

.diary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    padding: 8px 12px;
    background: rgba(92, 110, 255, 0.1);
    border: 1px solid rgba(92, 110, 255, 0.2);
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(92, 110, 255, 0.2);
    transform: translateY(-1px);
}

.title-block h1 {
    margin: 2px 0 0;
    font-size: 22px;
    color: #4c4b7d;
}

.welcome-text {
    font-size: 12px;
    color: #8d8da8;
    margin-bottom: 2px;
}

.diary-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.editor-section {
    order: 1;
    width: 100%;
}

.timeline-section {
    order: 2;
    width: 100%;
}

.filter-bar {
    margin-top: 20px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(87, 114, 255, 0.08);
}

.calendar-view {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 8px 4px;
    font-weight: 500;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day:hover {
    background: rgba(92, 110, 255, 0.1);
}

.calendar-day.has-message {
    background: rgba(92, 110, 255, 0.15);
    color: #5b6eff;
    font-weight: 600;
}

.calendar-day.has-message:hover {
    background: rgba(92, 110, 255, 0.25);
}

.calendar-day.today {
    border: 2px solid #5b6eff;
}

.calendar-day.selected {
    background: #5b6eff;
    color: white;
}

.calendar-day.other-month {
    color: #ccc;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calendar-nav-btn {
    padding: 6px 12px;
    background: rgba(92, 110, 255, 0.1);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #5b6eff;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: rgba(92, 110, 255, 0.2);
}

.calendar-month {
    font-size: 16px;
    font-weight: 600;
    color: #4c4b7d;
}

.date-filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid rgba(99, 113, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.btn-filter {
    padding: 8px 16px;
    background: rgba(92, 110, 255, 0.1);
    border: 1px solid rgba(92, 110, 255, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: #5b6eff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-filter:hover {
    background: rgba(92, 110, 255, 0.2);
}

.stats-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1500;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.stats-header h3 {
    margin: 0;
    color: #4c4b7d;
    font-size: 20px;
}

.stats-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.stats-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.stats-content {
    padding: 20px;
    overflow-y: auto;
}

.stats-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-value {
    color: #4c4b7d;
    font-size: 16px;
    font-weight: 600;
}

.stat-author {
    margin-top: 8px;
    padding-left: 16px;
    font-size: 13px;
    color: #888;
}

.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1500;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.settings-header h3 {
    margin: 0;
    color: #4c4b7d;
    font-size: 20px;
}

.settings-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.settings-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.settings-content {
    padding: 20px;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section h4 {
    margin: 0 0 16px 0;
    color: #4c4b7d;
    font-size: 16px;
    font-weight: 600;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.settings-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    background: #fff;
}

.settings-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.form-actions .btn-primary {
    flex: 1;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.form-actions .btn-primary:active {
    transform: translateY(0);
}

.form-actions .btn-secondary {
    flex: 1;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.05);
    color: #666;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-actions .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.settings-message {
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    margin-top: 8px;
}

.settings-message.success {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.settings-message.error {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.textarea-wrapper {
    position: relative;
}

.emoji-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(92, 110, 255, 0.1);
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.emoji-btn:hover {
    background: rgba(92, 110, 255, 0.2);
}

.emoji-picker {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 12px;
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 200;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    border: 1px solid rgba(99, 113, 255, 0.1);
}

.emoji-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.emoji-item:hover {
    background: rgba(92, 110, 255, 0.1);
}

/* 相册页面样式 */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px 0;
}

.album-grid.is-loading::after {
    content: '加载中...';
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #7a7bbd;
}

.album-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #f5f5f5;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.album-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(87, 114, 255, 0.2);
}

.album-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.album-item:hover .album-item-overlay {
    opacity: 1;
}

.album-item-info {
    color: white;
}

.album-item-content {
    margin: 0 0 6px 0;
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.album-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .album-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-list.is-loading::after {
    content: '加载中...';
    text-align: center;
    padding: 20px;
    color: #7a7bbd;
}

.message-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 12px 28px rgba(87, 114, 255, 0.12);
    border: 1px solid rgba(99, 121, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #8b8cae;
}

.message-author {
    font-weight: 600;
    color: #5c5d92;
}

.message-content {
    font-size: 15px;
    line-height: 1.7;
    color: #45456e;
    word-break: break-word;
}

.message-image {
    cursor: pointer;
}

.message-image img {
    width: 100%;
    border-radius: 14px;
    margin-top: 4px;
    box-shadow: 0 8px 25px rgba(125, 149, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.message-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(125, 149, 255, 0.3);
}

.message-voice {
    margin-top: 8px;
    display: flex;
    align-items: center;
}

.voice-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(92, 110, 255, 0.08);
    border-radius: 20px;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.voice-content:hover {
    background: rgba(92, 110, 255, 0.12);
}

.message-voice.playing .voice-content {
    background: rgba(92, 110, 255, 0.15);
}

.voice-icon-wrapper {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5b6eff, #9c7bff);
    border-radius: 50%;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.voice-content:hover .voice-icon-wrapper {
    transform: scale(1.1);
}

.voice-play-icon {
    line-height: 1;
    margin-left: 2px;
}

.voice-duration {
    font-size: 14px;
    color: #5c5d92;
    font-weight: 500;
    min-width: 30px;
}

.message-actions {
    display: flex;
    justify-content: flex-end;
}

.reply-toggle {
    border: none;
    background: transparent;
    color: #5b6eff;
    cursor: pointer;
    font-size: 13px;
}

.message-replies {
    padding-left: 16px;
    border-left: 2px solid rgba(91, 110, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reply-item {
    font-size: 14px;
    color: #565872;
    line-height: 1.6;
}

.reply-item strong {
    color: #5c5d92;
    margin-right: 6px;
}

.reply-form {
    margin-top: 10px;
    display: none;
    flex-direction: column;
    gap: 8px;
}

.reply-form.visible {
    display: flex;
}

.reply-form textarea {
    width: 100%;
    border: 1px solid rgba(99, 113, 255, 0.2);
    border-radius: 12px;
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.reply-form button {
    align-self: flex-end;
    padding: 6px 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #5b6eff, #9c7bff);
    color: white;
    font-size: 13px;
    cursor: pointer;
}

.reply-time {
    font-size: 12px;
    color: #a0a1c0;
    margin-left: 8px;
}

.editor-card {
    background: white;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 20px 40px rgba(90, 103, 216, 0.12);
    border: 1px solid rgba(93, 113, 255, 0.08);
}

.editor-card h2 {
    margin-bottom: 12px;
    color: #4c4b7d;
    font-size: 18px;
}

.editor-card textarea {
    width: 100%;
    border: 1px solid rgba(99, 113, 255, 0.2);
    border-radius: 16px;
    padding: 12px 48px 12px 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 90px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.editor-card textarea:focus {
    outline: none;
    border-color: rgba(91, 110, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(91, 110, 255, 0.1);
}

.form-footer {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.image-upload {
    padding: 8px 14px;
    background: rgba(92, 110, 255, 0.08);
    border-radius: 50px;
    font-size: 13px;
    color: #5b6eff;
    cursor: pointer;
    border: 1px dashed rgba(92, 110, 255, 0.4);
    transition: all 0.2s ease;
}

.image-upload input {
    display: none;
}

.image-upload:hover {
    background: rgba(92, 110, 255, 0.15);
}

.voice-record-btn {
    padding: 8px 14px;
    background: rgba(92, 110, 255, 0.08);
    border: 1px dashed rgba(92, 110, 255, 0.4);
    border-radius: 50px;
    font-size: 13px;
    color: #5b6eff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.voice-record-btn:hover {
    background: rgba(92, 110, 255, 0.15);
}

.voice-record-btn.recording {
    background: rgba(255, 82, 82, 0.15);
    border-color: rgba(255, 82, 82, 0.5);
    color: #ff5252;
    animation: pulse 1s infinite;
}

.voice-record-btn .voice-icon {
    font-size: 16px;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: rgba(255, 82, 82, 0.1);
    border-radius: 50px;
    color: #ff5252;
    font-size: 13px;
    font-weight: 500;
}

.recording-animation {
    width: 12px;
    height: 12px;
    background: #ff5252;
    border-radius: 50%;
    animation: recording-pulse 1s infinite;
}

@keyframes recording-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.recording-tip {
    font-size: 12px;
    opacity: 0.8;
}

.file-previews {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-preview,
.voice-preview {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(92, 110, 255, 0.08);
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 13px;
    color: #5c5d92;
}

.image-preview button,
.voice-preview button {
    border: none;
    background: transparent;
    color: #ff5f6d;
    font-size: 16px;
    cursor: pointer;
}

.btn-primary {
    margin-left: auto;
    padding: 10px 24px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #5b6eff, #9c7bff);
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(92, 110, 255, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(92, 110, 255, 0.3);
}

.empty-state {
    background: white;
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    color: #8889aa;
    font-size: 15px;
    box-shadow: 0 15px 35px rgba(87, 114, 255, 0.12);
}

@media (min-width: 900px) {
    .diary-main {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
        gap: 24px;
    }

    .editor-section {
        grid-column: 2;
        grid-row: 1;
        position: sticky;
        top: 24px;
        align-self: flex-start;
    }

    .timeline-section {
        grid-column: 1;
        grid-row: 1;
        padding-bottom: 0;
    }
}

@media (max-width: 768px) {
    .diary-page {
        padding: 20px 14px 100px;
    }

    .title-block h1 {
        font-size: 20px;
    }
    
    .welcome-text {
        font-size: 11px;
    }
    
    .diary-header {
        margin-bottom: 12px;
    }

    .editor-card textarea {
        min-height: 80px;
    }

    .form-footer {
        justify-content: space-between;
    }
}

/* 相册页面样式 */
.gallery-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 15px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    flex: 1;
}

/* Header中的音乐播放器 */
.music-player-header {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.music-controls-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.music-btn-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.music-btn-header:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background-position: right center;
}

.music-btn-header:active {
    transform: scale(0.95);
}

.music-icon-header {
    font-size: 18px;
    line-height: 1;
}

.music-info-header {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.music-info-header span {
    display: block;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

#music-next-header {
    font-size: 12px;
    padding-left: 2px;
}

@media (max-width: 480px) {
    .music-info-header {
        display: none;
    }
    
    .music-controls-header {
        gap: 8px;
    }
}

.refresh-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
    border: none;
    cursor: pointer;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    background: linear-gradient(135deg, #ff5252 0%, #ff1744 100%);
}

.upload-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background-position: right center;
}

.upload-icon {
    font-size: 16px;
}

.upload-text {
    display: inline;
}

@media (max-width: 480px) {
    .upload-text {
        display: none;
    }
    
    .upload-btn {
        padding: 10px;
        width: 40px;
        justify-content: center;
    }
}

/* 媒体网格 */
.masonry-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    padding: 15px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* 媒体项样式 */
.media-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
                0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.media-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

.media-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(230, 230, 230, 0.8));
    overflow: hidden;
}

.media-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.45), rgba(255,255,255,0));
    transform: translateX(-100%);
    animation: shimmer 2.5s ease-in-out infinite;
}

.media-thumb.media-loaded::after {
    opacity: 0;
    animation: none;
}

.media-thumb img,
.media-thumb video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-thumb img.loaded,
.media-thumb video.loaded {
    opacity: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading p {
    color: rgba(102, 126, 234, 0.8);
    font-weight: 500;
    margin-top: 15px;
}

.spinner {
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top: 4px solid;
    border-top-color: #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #764ba2;
    border-right-color: #f093fb;
    animation: spin 1.5s linear infinite reverse;
    opacity: 0.6;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-more {
    text-align: center;
    padding: 40px 20px;
    color: rgba(102, 126, 234, 0.6);
    font-size: 14px;
    font-weight: 500;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    margin-bottom: 40px;
}

.page-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.page-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.35);
}

.page-info {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.icp-footer {
    text-align: center;
    padding: 15px 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    width: 100%;
}

.login-page .icp-footer {
    position: fixed;
    bottom: 0;
}

.icp-footer a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: color 0.2s ease;
}

.icp-footer a:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* 响应式设计 - 平板 */
@media (min-width: 768px) {
    .masonry-container {
        gap: 20px;
        padding: 30px;
    }
    
    .header {
        padding: 20px 30px;
    }
    
    .header h1 {
        font-size: 28px;
    }
}

/* 响应式设计 - 电脑 */
@media (min-width: 1024px) {
    .masonry-container {
        padding: 40px;
        gap: 25px;
    }
}

/* 图片懒加载占位符 */
.media-item img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

.media-item img.loaded {
    opacity: 1;
}

/* 图片放大模态框 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* 禁用移动端点击高亮 */
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    /* 防止触摸时出现默认行为 */
    touch-action: manipulation;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.image-modal-content {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
    opacity: 1;
}

.image-modal.active .image-modal-content {
    transform: scale(1);
}

.image-modal img,
.image-modal video {
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2001;
    /* 禁用移动端点击高亮 */
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    outline: none;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.image-modal-close:active {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(0.9);
}

.image-modal-close:focus {
    outline: none;
}

/* 左右切换按钮 */
.image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2001;
    user-select: none;
    /* 禁用移动端点击高亮 */
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
    /* 防止触摸时出现默认行为 */
    touch-action: manipulation;
    /* 防止点击时出现蓝色背景 */
    -webkit-touch-callout: none;
    outline: none;
}

.image-modal-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.image-modal-nav:active {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(0.9);
}

.image-modal-nav:focus {
    outline: none;
}

.image-modal-prev {
    left: 20px;
}

.image-modal-next {
    right: 20px;
}

/* 手机端模态框优化 */
@media (max-width: 767px) {
    .image-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .image-modal-nav {
        width: 50px;
        height: 50px;
        font-size: 32px;
    }
    
    .image-modal-prev {
        left: 10px;
    }
    
    .image-modal-next {
        right: 10px;
    }
    
    .image-modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .image-modal img,
    .image-modal video {
        max-height: 100vh;
        border-radius: 0;
    }
    
    /* 防止页面闪烁 - 使用will-change优化 */
    .image-modal {
        will-change: opacity;
    }
    
    body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
    
    /* 移动端禁用所有点击高亮 */
    .image-modal * {
        -webkit-tap-highlight-color: transparent;
        tap-highlight-color: transparent;
    }
}

/* 背景音乐播放器 */
.music-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    min-width: 250px;
    max-width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.music-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.music-btn:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    background-position: right center;
}

.music-btn:active {
    transform: scale(1.05) rotate(0deg);
}

.music-icon {
    font-size: 20px;
    line-height: 1;
}

.music-info {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.music-info span {
    display: block;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

#music-next {
    font-size: 12px;
    padding-left: 2px;
}

/* 响应式：手机端音乐播放器 */
@media (max-width: 767px) {
    .masonry-container {
        padding: 10px;
        gap: 10px;
    }
    
    .media-item {
        border-radius: 12px;
    }
    
    .music-player {
        bottom: 10px;
        padding: 8px 15px;
        min-width: 200px;
    }
    
    .music-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .music-info span {
        font-size: 12px;
    }
    
    .music-controls {
        gap: 10px;
    }
}

/* 上传模态框样式 */
.upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-modal.active {
    display: flex;
    opacity: 1;
}

.upload-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.upload-modal.active .upload-modal-content {
    transform: scale(1);
}

.upload-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 700;
}

.upload-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #666;
}

.upload-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.upload-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.upload-area {
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(102, 126, 234, 0.02);
}

.upload-area:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.05);
}

.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.upload-placeholder {
    pointer-events: none;
}

.upload-icon-large {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-placeholder p {
    margin: 8px 0;
    color: #666;
}

.upload-hint {
    font-size: 12px;
    color: #999;
}

.upload-file-list {
    margin-top: 20px;
}

.upload-file-list h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    margin-bottom: 8px;
    gap: 12px;
}

.file-item-info {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.file-item-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 82, 82, 0.1);
    color: #ff5252;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.file-item-remove:hover {
    background: rgba(255, 82, 82, 0.2);
    transform: scale(1.1);
}

.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.3s ease;
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.upload-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 24px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 手机端上传模态框优化 */
@media (max-width: 767px) {
    .upload-modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .upload-modal-header {
        padding: 16px 20px;
    }
    
    .upload-modal-header h2 {
        font-size: 18px;
    }
    
    .upload-modal-body {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon-large {
        font-size: 40px;
    }
}

