/* static/css/style.css */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --danger-color: #e74c3c;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
    --success-color: #2ecc71;
    --max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: white;
}

/* 布局 */
header, main, footer {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
header {
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--primary-color);
}

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

/* 页脚 */
footer {
    text-align: center;
    padding: 20px 0;
    color: #777;
    border-top: 1px solid var(--border-color);
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    border: none;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.secondary {
    background-color: var(--light-gray);
    color: var(--text-color);
}

.btn.danger {
    background-color: var(--danger-color);
    color: white;
}

.btn.small {
    padding: 4px 8px;
    font-size: 0.85rem;
}

.btn:hover {
    opacity: 0.9;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--light-gray);
    border-radius: 8px;
}

.auth-form h1 {
    margin-bottom: 20px;
    text-align: center;
}

.form-footer {
    margin-top: 20px;
    text-align: center;
}

/* 闪现消息 */
.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 10px;
    background-color: var(--success-color);
    color: white;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* 首页 */
.hero {
    text-align: center;
    padding: 60px 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    color: #777;
    margin-bottom: 30px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.features {
    padding: 40px 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 30px;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* 笔记列表 */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.notes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.note-card {
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    transition: transform 0.3s;
}

.note-card:hover {
    transform: translateY(-5px);
}

.note-card h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.note-card h3 a:hover {
    color: var(--primary-color);
}

.note-date {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.note-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.empty-state {
    text-align: center;
    padding: 40px 0;
}

/* 笔记详情 */
.note-detail {
    max-width: 800px;
    margin: 0 auto;
}

.note-header {
    margin-bottom: 30px;
}

.note-content {
    line-height: 1.8;
    margin-bottom: 30px;
    white-space: pre-wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cta-buttons {
        flex-direction: column;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }

    .notes-list {
        grid-template-columns: 1fr;
    }
}

/* 笔记预览样式 */
.note-preview {
    margin: 10px 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 复制按钮样式 */
.copy-btn {
    background-color: #4CAF50;
}

.copy-btn:hover {
    background-color: #45a049;
}

/* 文件列表样式 */
.files-header {
    margin-top: 40px;
    margin-bottom: 20px;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-card {
    background-color: var(--light-gray);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s;
}

.file-card:hover {
    transform: translateY(-3px);
}

.file-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    word-break: break-all;
}

.file-date {
    color: #777;
    font-size: 0.85rem;
}

.file-actions {
    display: flex;
    gap: 10px;
}

/* 上传表单样式 */
input[type="file"] {
    padding: 10px;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
}

/* 仪表盘按钮组 */
.action-buttons {
    display: flex;
    gap: 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .file-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: flex-end;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons .btn {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
}
