:root {
    --primary: #e8a4b8;
    --primary-dark: #d4899e;
    --secondary: #f5d0d8;
    --bg: #faf6f2;
    --card-bg: #ffffff;
    --text: #4a3f44;
    --text-light: #6b5b5f;
    --border: #e8ddd5;
    --success: #7fb77e;
    --danger: #e57373;
    --warning: #ffb74d;
    --info: #64b5f6;
    --shadow: rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--card-bg) 0%, #fff9fb 100%);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    z-index: 100;
    overflow-y: auto;
}

.logo {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.logo h1 {
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo p {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.3rem;
}

.nav-section {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    padding: 0.7rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.nav-item:hover {
    background: var(--secondary);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(232, 164, 184, 0.2), transparent);
    border-left-color: var(--primary);
    color: var(--primary-dark);
}

.nav-item .badge {
    margin-left: auto;
    padding: 0.15rem 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
}

/* 主内容区 */
.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 0.8rem;
}

.preview-btn {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(232, 164, 184, 0.4);
}

.export-btn {
    padding: 0.6rem 1rem;
    background: var(--info);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.export-btn:hover {
    transform: translateY(-2px);
}

/* 内容面板 */
.panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.panel.active {
    display: block;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title .icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.2rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group input[type="color"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--bg);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 164, 184, 0.2);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input[type="color"] {
    height: 45px;
    padding: 0.3rem;
    cursor: pointer;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.3rem;
}

.form-group .toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--border);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle.active {
    background: var(--success);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: left 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle.active::after {
    left: 27px;
}

/* 颜色选择器组 */
.color-picker-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.color-picker-item {
    text-align: center;
}

.color-picker-item label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.color-picker-item input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* 图片列表 */
.image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--bg);
    border: 2px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

.image-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(229, 115, 115, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-item:hover .remove-btn {
    opacity: 1;
}

.image-item .caption-input {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.image-item .caption-input input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.95);
}

.add-image-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
    border: 2px dashed var(--border);
    border-radius: 12px;
}

.add-image-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(232, 164, 184, 0.1);
}

/* 时间轴编辑 */
.timeline-item-edit {
    background: linear-gradient(135deg, var(--bg), #fff);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    position: relative;
    border-left: 4px solid var(--primary);
}

.timeline-item-edit .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.timeline-item-edit .item-number {
    font-weight: 600;
    color: var(--primary);
    background: rgba(232, 164, 184, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* 打字机文字列表 */
.text-list-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.text-list-item input {
    flex: 1;
}

.text-list-item .remove-text-btn {
    padding: 0.5rem 0.8rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.text-list-item .remove-text-btn:hover {
    transform: scale(1.05);
}

/* 心愿清单样式 */
.wish-item {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 0.8rem;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 0.6rem;
    transition: all 0.3s ease;
}

.wish-item:hover {
    background: rgba(232, 164, 184, 0.15);
}

.wish-item .wish-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.wish-item .wish-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.wish-item .wish-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 0.8rem;
}

.wish-item input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    padding: 0.3rem;
}

.wish-item input:focus {
    outline: none;
    background: white;
    border-radius: 4px;
}

/* 预设主题选择 */
.theme-presets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.theme-preset {
    padding: 0.8rem;
    border-radius: 10px;
    border: 2px solid var(--border);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.theme-preset:hover {
    border-color: var(--primary);
}

.theme-preset.active {
    border-color: var(--primary);
    background: rgba(232, 164, 184, 0.1);
}

.theme-preset .color-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
}

.theme-preset span {
    font-size: 0.75rem;
    color: var(--text);
}

/* 按钮样式 */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 5px 15px rgba(232, 164, 184, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--secondary);
}

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

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

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

.btn-group {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 1rem 1.5rem;
    background: var(--success);
    color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* 特效开关卡片 */
.effect-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg);
    border-radius: 10px;
    margin-bottom: 0.8rem;
}

.effect-toggle .effect-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.effect-toggle .effect-icon {
    font-size: 1.5rem;
}

.effect-toggle .effect-name {
    font-weight: 500;
}

.effect-toggle .effect-desc {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* 甜蜜话语列表 */
.sweet-message-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    align-items: center;
}

.sweet-message-item input {
    flex: 1;
}

.sweet-message-item .freq-select {
    width: 100px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    /* 手机端：让相册缩略图更高一些 */
    .image-item {
        aspect-ratio: 3/4;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
    }

    .nav-section {
        display: none;
    }

    .nav-menu {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .nav-item {
        padding: 0.6rem 1rem;
        white-space: nowrap;
        border-left: none;
        border-radius: 20px;
    }

    .nav-item.active {
        background: var(--primary);
        color: white;
    }

    .nav-item .badge {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .image-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg);
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(232, 164, 184, 0.1);
}

.file-upload-area .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.file-upload-area p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.file-upload-area input[type="file"] {
    display: none;
}

.current-music {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bg), #fff);
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid var(--border);
}

.current-music .music-icon {
    font-size: 2.5rem;
}

.current-music-info {
    flex: 1;
}

.current-music-info .name {
    font-weight: 500;
}

.current-music-info .size {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* 拖拽排序提示 */
.drag-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 预览模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1.2rem;
    border-radius: 12px;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 600;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}
