/* 基础样式和变量 */
:root {
    --primary-color: #FF9A9E;
    --primary-light: #FECFEF;
    --secondary-color: #A8EDEA;
    --accent-color: #FAD0C4;
    --text-primary: #5D4E6D;
    --text-secondary: #8B7B9E;
    --bg-primary: #FFF9FB;
    --bg-secondary: #FFFFFF;
    --shadow-soft: 0 4px 20px rgba(255, 154, 158, 0.15);
    --shadow-medium: 0 8px 30px rgba(255, 154, 158, 0.2);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #FFF9FB 0%, #FEF5F7 50%, #FFF0F3 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 3rem;
    animation: bounce 2s ease infinite;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 50%, #A8EDEA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* 浮动图标动画 */
.floating-icons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.float-icon {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

.float-icon:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.float-icon:nth-child(2) { top: 20%; right: 15%; animation-delay: 1s; }
.float-icon:nth-child(3) { top: 60%; left: 5%; animation-delay: 2s; }
.float-icon:nth-child(4) { top: 70%; right: 10%; animation-delay: 3s; }
.float-icon:nth-child(5) { top: 40%; left: 15%; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(10deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 统计卡片 */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-light);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-sm);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* 添加按钮 */
.add-button-container {
    text-align: center;
    margin-bottom: 30px;
}

.add-btn {
    background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.4);
    transition: var(--transition);
    font-family: inherit;
}

.add-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 154, 158, 0.5);
}

.add-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.5rem;
}

/* 日志区域 */
.logs-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--primary-light);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-color: transparent;
    color: white;
}

/* 日志网格 */
.logs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* 日志卡片 */
.log-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.log-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-light);
}

.log-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.log-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.log-card-content {
    padding: 20px;
}

.log-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.log-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.log-card-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.log-card-category {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.category-milestone { background: #FFE4E1; color: #FF6B6B; }
.category-daily { background: #E8F5E9; color: #4CAF50; }
.category-photo { background: #E3F2FD; color: #2196F3; }
.category-growth { background: #FFF3E0; color: #FF9800; }
.category-other { background: #F3E5F5; color: #9C27B0; }

.log-card-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.log-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-card-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.log-card-tag {
    background: var(--bg-secondary);
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.log-card-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.log-card-stat {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 2s ease infinite;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 2px solid var(--bg-primary);
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--bg-primary);
    color: var(--primary-color);
}

/* 表单样式 */
.log-form {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group.half {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E8E8E8;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* 照片上传 */
.photo-upload {
    border: 2px dashed #DDD;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.photo-upload:hover {
    border-color: var(--primary-color);
}

.upload-area {
    padding: 30px;
    text-align: center;
    cursor: pointer;
    background: var(--bg-primary);
    transition: var(--transition);
}

.upload-area:hover {
    background: var(--primary-light);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.upload-area p {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 15px;
    background: var(--bg-secondary);
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}

.preview-remove:hover {
    background: #FF6B6B;
    color: white;
}

/* 标签输入 */
.tags-input {
    border: 2px solid #E8E8E8;
    border-radius: var(--radius-sm);
    padding: 10px;
    background: var(--bg-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tag-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tag-remove:hover {
    opacity: 1;
}

#tagInput {
    border: none;
    background: transparent;
    flex: 1;
    min-width: 120px;
    padding: 5px;
}

#tagInput:focus {
    outline: none;
}

/* 表单按钮 */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 10px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 154, 158, 0.5);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 2px solid #E8E8E8;
}

.btn-secondary:hover {
    background: #E8E8E8;
    color: var(--text-primary);
}

.btn-danger {
    background: #FF6B6B;
    color: white;
}

.btn-danger:hover {
    background: #FF5252;
    transform: translateY(-2px);
}

/* 详情弹窗 */
.detail-content {
    max-width: 700px;
}

.detail-body {
    padding: 25px;
}

.detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.detail-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.detail-content-text {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.detail-growth {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.detail-growth h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.growth-items {
    display: flex;
    gap: 30px;
}

.growth-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.growth-icon {
    font-size: 1.5rem;
}

.growth-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.growth-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.detail-tag {
    background: var(--bg-primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.detail-actions {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    border-top: 2px solid var(--bg-primary);
    justify-content: flex-end;
}

/* 确认弹窗 */
.confirm-content {
    max-width: 400px;
    text-align: center;
    padding: 40px;
}

.confirm-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.confirm-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.confirm-content p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Toast提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    font-weight: 600;
    color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .logo-icon {
        font-size: 2rem;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .logs-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions button {
        width: 100%;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions button {
        width: 100%;
    }

    .confirm-actions {
        flex-direction: column;
    }

    .confirm-actions button {
        width: 100%;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 选中状态 */
::selection {
    background: var(--primary-light);
    color: var(--text-primary);
}
