// 自定义变量
:host {
    --page-padding: 16px;
    --card-border-radius: 16px;
    --primary-color: var(--ion-color-primary);
    --text-color: var(--ion-color-dark);
    --background-color: var(--ion-background-color);
}

// 头部样式
.header-container {
    display: flex;
    align-items: center;
    padding: 8px var(--page-padding);
    background: var(--background-color);

    .search-box {
        flex: 1;

        .custom-searchbar {
            --background: #f4f5f8;
            --border-radius: 12px;
            --placeholder-color: #666;
            --icon-color: #666;
            padding: 0;
        }
    }

    .header-icons {
        display: flex;
        gap: 16px;
        margin-left: 16px;

        .action-icon {
            font-size: 24px;
            color: var(--text-color);
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            transition: background-color 0.3s;

            &:hover {
                background-color: rgba(var(--ion-color-primary-rgb), 0.1);
            }
        }
    }
}

// 内容区域
.content-container {
    padding: 16px 0;
}

.page-title {
    margin-bottom: 24px;
    padding: 0 var(--page-padding);

    h1 {
        font-size: 32px;
        font-weight: 700;
        color: var(--text-color);
        margin: 0;
    }

    .subtitle {
        font-size: 16px;
        color: var(--ion-color-medium);
        margin: 8px 0 0;
    }
}

// 计划卡片样式
.plan-card {
    margin: 0 var(--page-padding) 24px;
    border-radius: var(--card-border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: white;
    overflow: hidden;
    transition: transform 0.3s ease;

    &:hover {
        transform: translateY(-2px);
    }

    ion-card-header {
        padding: 20px;
        background: linear-gradient(135deg, var(--ion-color-primary), var(--ion-color-primary-shade));

        ion-card-title {
            font-size: 1.4em;
            font-weight: 600;
            color: white;
        }

        ion-card-subtitle {
            color: rgba(255, 255, 255, 0.8);
            margin-top: 8px;
        }
    }

    ion-card-content {
        padding: 16px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: white;
        overflow: hidden;

        comp-markmap {
            width: 100%;
            height: 45vh;
            display: block;
        }
    }
}

// 导航按钮样式
.navigation-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    margin-top: 16px;

    .nav-button {
        --padding-start: 16px;
        --padding-end: 16px;
        --background: var(--ion-color-light);
        --background-hover: var(--ion-color-light-shade);
        --border-radius: 24px;
        --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

        height: 48px;
        min-width: 120px;

        display: flex;
        align-items: center;
        gap: 8px;

        ion-icon {
            font-size: 20px;
            color: var(--text-color);
        }

        span {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-color);
        }

        &[disabled] {
            opacity: 0.5;
        }

        &:hover:not([disabled]) {
            --background: var(--ion-color-light-shade);
        }
    }
}

// 无计划状态样式
.no-plans {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70vh;
    text-align: center;
    padding: 0 32px;

    ion-icon {
        font-size: 64px;
        color: var(--ion-color-medium);
        margin-bottom: 24px;
    }

    h2 {
        font-size: 24px;
        font-weight: 600;
        color: var(--text-color);
        margin: 0 0 12px;
    }

    p {
        font-size: 16px;
        color: var(--ion-color-medium);
        margin: 0;
    }
}

.card-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    .header-actions {
        display: flex;
        gap: 8px;
    }

    .edit-button {
        --color: rgba(255, 255, 255, 0.9);
        font-size: 14px;

        ion-icon {
            margin-right: 4px;
        }

        &:hover {
            --color: white;
        }
    }

    .delete-button {
        --color: rgba(255, 255, 255, 0.9);
        font-size: 14px;

        ion-icon {
            margin-right: 4px;
        }

        &:hover {
            --color: var(--ion-color-danger);
        }
    }
}

.edit-container {
    width: 100%;
    height: 45vh;
    display: flex;
    flex-direction: column;
    gap: 16px;

    .markdown-editor {
        flex: 1;
        border: 1px solid var(--ion-color-medium);
        border-radius: 8px;
        padding: 12px;
        font-family: monospace;
        background: #f8f9fa;
    }

    .edit-actions {
        display: flex;
        justify-content: flex-end;
        gap: 12px;
    }
}