/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* 主容器 */
.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
}

/* 头部区域 */
.header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

/* 顶部工具栏 */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

/* 搜索框 */
.search-box {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box:focus {
    border-color: #999;
}

/* 按钮通用样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background-color: #666;
    color: #fff;
}

.btn-primary:hover {
    background-color: #555;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #d0d0d0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 日记列表 */
.diary-list {
    margin-bottom: 30px;
}

.diary-item {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.diary-item:hover {
    background-color: #f0f0f0;
}

.diary-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.diary-item-date {
    font-size: 13px;
    color: #999;
}

.diary-item-actions {
    display: flex;
    gap: 8px;
}

.diary-item-title {
    font-weight: 500;
    margin-bottom: 6px;
    color: #333;
}

.diary-item-content {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
    /* 限制显示行数 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.diary-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    background-color: #e8e8e8;
    color: #555;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
}

/* 编辑区域 */
.editor {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    display: none;
}

.editor.active {
    display: block;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.editor-title {
    font-size: 18px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #666;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: #999;
}

.form-textarea {
    min-height: 200px;
    resize: vertical;
}

.form-tags {
    font-size: 13px;
}

.tags-hint {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.editor-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* 隐藏的文件输入框（用于导入） */
.file-input {
    display: none;
}

/* 响应式设计 - 手机端 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .toolbar {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .diary-item-header {
        flex-direction: column;
        gap: 8px;
    }

    .diary-item-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .editor-actions {
        width: 100%;
        flex-direction: column;
    }

    .editor-actions .btn {
        width: 100%;
    }
}

