/* ==================== 写作页面样式 ==================== */
.write-container {
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: 
        linear-gradient(135deg, rgba(60, 20, 100, 0.88) 0%, rgba(40, 10, 70, 0.92) 40%, rgba(15, 5, 35, 0.96) 100%),
        url('../images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* ==================== 顶部导航 ==================== */
.write-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 20px;
}

.back-btn {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    opacity: 0.9;
    transition: opacity 0.3s;
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.3);
}

.nav-title {
    color: white;
    font-size: 1.3em;
    font-weight: 300;
    text-align: center;
    flex: 1;
}

.save-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.save-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* ==================== 写作内容区 ==================== */
.write-content {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* ==================== 日期选择 ==================== */
.date-section {
    margin-bottom: 20px;
}

.date-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1em;
    color: #667eea;
    font-weight: 600;
    outline: none;
    transition: border-color 0.3s;
}

.date-input:focus {
    border-color: #667eea;
}

/* ==================== 标题输入 ==================== */
.title-section {
    margin-bottom: 20px;
}

.title-input {
    width: 100%;
    padding: 16px;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    font-size: 1.5em;
    font-weight: 500;
    color: #333;
    outline: none;
    transition: border-color 0.3s;
    background: transparent;
}

.title-input:focus {
    border-bottom-color: #667eea;
}

.title-input::placeholder {
    color: #ccc;
    font-weight: 300;
}

/* ==================== 工具栏 ==================== */
.toolbar {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

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

.toolbar-group label {
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
}

.toolbar-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9em;
    outline: none;
    cursor: pointer;
    background: white;
}

.toolbar-group input[type="color"] {
    width: 40px;
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
}

/* ==================== 编辑器 ==================== */
.editor-section {
    margin-bottom: 20px;
}

.content-input {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1em;
    line-height: 1.8;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
}

.content-input:focus {
    border-color: #667eea;
}

.content-input::placeholder {
    color: #ccc;
}

/* ==================== 预览区域 ==================== */
.preview-section {
    margin-bottom: 25px;
}

.preview-label {
    font-size: 0.85em;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.preview-box {
    padding: 20px;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    min-height: 100px;
    background: #fafafa;
    transition: all 0.3s;
}

.preview-box.has-content {
    border-style: solid;
    border-color: #667eea;
    background: white;
}

.preview-placeholder {
    color: #ccc;
    text-align: center;
    padding: 30px;
}

/* ==================== 表情包 ==================== */
.emoji-section {
    margin-bottom: 25px;
}

.emoji-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 500;
    color: #333;
}

.toggle-emoji {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 0.9em;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.3s;
}

.toggle-emoji:hover {
    background: #f0f0f0;
}

.emoji-panel {
    display: none;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    animation: slideDown 0.3s ease;
}

.emoji-panel.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.emoji-category {
    margin-bottom: 15px;
}

.emoji-category:last-child {
    margin-bottom: 0;
}

.emoji-title {
    font-size: 0.8em;
    color: #999;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.emoji-item {
    font-size: 1.5em;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    user-select: none;
}

.emoji-item:hover {
    background: white;
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ==================== 图片上传 ==================== */
.image-section {
    margin-bottom: 25px;
}

.image-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
}

.image-upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.image-upload-area:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.upload-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.upload-text {
    color: #666;
    font-size: 1em;
    margin-bottom: 5px;
}

.upload-hint {
    color: #999;
    font-size: 0.85em;
}

.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
}

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

.image-preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255,99,71,0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.image-preview-item .remove-btn:hover {
    transform: scale(1.1);
}

/* ==================== 标签 ==================== */
.tags-section {
    margin-bottom: 20px;
}

.tags-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
}

.tags-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95em;
    outline: none;
    transition: border-color 0.3s;
    margin-bottom: 10px;
}

.tags-input:focus {
    border-color: #667eea;
}

.tags-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-suggestion {
    background: #f0f0f0;
    color: #666;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s;
}

.tag-suggestion:hover {
    background: #667eea;
    color: white;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .write-content {
        padding: 20px;
    }

    .toolbar {
        gap: 10px;
    }

    .toolbar-group {
        flex: 1;
        min-width: 120px;
    }

    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .write-nav {
        padding: 15px;
    }

    .nav-title {
        font-size: 1.1em;
    }
}
