@use './styles/doc-reminder.scss';
@use './styles/project-reminder.scss';
@use './styles/pomodoroTimer.scss';
@use './styles/pomodoroStats.scss';


.smart-batch-dialog {
    .b3-dialog__content {
        padding: 20px;
    }

    // 批量操作面板样式
    .batch-operations-panel {
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        border: 1px solid var(--b3-theme-primary-light);
        border-radius: 12px;
        margin-bottom: 20px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;

        &:hover {
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        }
    }

    .batch-operations-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 20px;
        background: var(--b3-theme-primary-lightest);
        border-bottom: 1px solid var(--b3-theme-primary-light);

        h3 {
            margin: 0;
            font-size: 13px;
            font-weight: 600;
            color: var(--b3-theme-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .batch-toggle {
            display: flex;
            align-items: center;
        }

        #batchToggleBtn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            font-size: 13px;
            border-radius: 6px;
            transition: all 0.2s ease;

            .toggle-icon {
                width: 14px;
                height: 14px;
                transition: transform 0.2s ease;
            }

            &:hover {
                background: var(--b3-theme-primary-light);
                color: var(--b3-theme-primary);
            }
        }
    }

    .batch-operations-content {
        padding: 20px;
        background: white;
        animation: slideDown 0.3s ease;
    }

    .batch-operation-row {
        // display: flex;
        gap: 20px;
        margin-bottom: 20px;

        &:last-child {
            margin-bottom: 0;
        }

        @media (max-width: 768px) {
            flex-direction: column;
            gap: 16px;
        }
    }

    .batch-operation-item {
        flex: 1;
        min-width: 0;

        &.full-width {
            flex: 1 1 100%;
        }

        .b3-form__label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            font-size: 13px;
            color: var(--b3-theme-on-background);
        }
    }

    // 批量分类容器
    .batch-category-container {
        display: flex;
        gap: 12px;
        align-items: flex-start;
    }

    .category-selector-compact {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        flex: 1;
        min-height: 36px;
        padding: 6px;
        // border: 1px solid var(--b3-border-color);
        border-radius: 6px;
        background: var(--b3-theme-background);
        max-height: 80px;
        overflow-y: auto;
    }

    .category-option-compact {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        border: 1px solid var(--b3-border-color);
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        background: var(--b3-theme-background);
        font-size: 12px;
        white-space: nowrap;
        min-height: 24px;
        position: relative;

        &:hover {
            background: var(--b3-theme-surface-light);
            border-color: var(--b3-theme-primary-light);
            transform: translateY(-1px);
        }

        &.selected {
            border-color: var(--b3-theme-primary);
            background: var(--b3-theme-primary-lightest);
            color: var(--b3-theme-primary);
            font-weight: 500;
            transform: scale(1.02);
        }

        &.selected::after {
            content: '✓';
            position: absolute;
            top: -4px;
            right: -4px;
            width: 12px;
            height: 12px;
            background: var(--b3-theme-primary);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 8px;
            font-weight: bold;
            border: 2px solid white;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        }

        // 无分类选项特殊样式
        &[data-category=""] {
            background: var(--b3-theme-background);
            color: var(--b3-theme-on-surface-light);
            border-style: dashed;
        }

        &[data-category=""]:hover {
            background: var(--b3-theme-surface-light);
            color: var(--b3-theme-on-background);
            border-style: solid;
        }

        &[data-category=""].selected {
            background: var(--b3-theme-primary-lightest);
            color: var(--b3-theme-primary);
            border-style: solid;
            border-color: var(--b3-theme-primary);
        }

        // 有颜色的分类选项
        &[data-category]:not([data-category=""]) {
            color: white;
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
            border-color: rgba(255, 255, 255, 0.3);

            &:hover {
                filter: brightness(1.1);
                border-color: rgba(255, 255, 255, 0.6);
            }

            &.selected {
                border-color: white;
                box-shadow: 0 0 0 2px var(--b3-theme-primary);
                filter: brightness(1.2);
            }

            &.selected::after {
                background: white;
                color: var(--b3-theme-primary);
            }
        }
    }

    // 批量优先级容器
    .batch-priority-container {
        display: flex;
        gap: 12px;
        align-items: flex-start;
    }

    .priority-selector-compact {
        display: flex;
        gap: 6px;
        flex: 1;
        padding: 6px;
        // border: 1px solid var(--b3-border-color);
        border-radius: 6px;
        background: var(--b3-theme-background);
    }

    .priority-option-compact {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        border: 1px solid var(--b3-border-color);
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        background: var(--b3-theme-background);
        font-size: 12px;
        white-space: nowrap;
        min-height: 24px;
        position: relative;

        &:hover {
            background: var(--b3-theme-surface-light);
            border-color: var(--b3-theme-primary-light);
            transform: translateY(-1px);
        }

        &.selected {
            border-color: var(--b3-theme-primary);
            background: var(--b3-theme-primary-lightest);
            color: var(--b3-theme-primary);
            font-weight: 500;
            transform: scale(1.02);
        }

        &.selected::after {
            content: '✓';
            position: absolute;
            top: -4px;
            right: -4px;
            width: 12px;
            height: 12px;
            background: var(--b3-theme-primary);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 8px;
            font-weight: bold;
            border: 2px solid white;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        }
    }

    // 批量日期容器
    .batch-date-container {
        display: flex;
        gap: 8px;
        align-items: center;

        #batchDateInput {
            flex: 1;
            min-width: 0;
        }

        #batchApplyDateBtn {
            flex-shrink: 0;
            white-space: nowrap;
        }

        #batchNlDateBtn {
            flex-shrink: 0;
            width: 40px;
            height: 40px;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            border-radius: 6px;
            title: "智能日期识别";
        }

        @media (max-width: 576px) {
            flex-wrap: wrap;
            gap: 8px;

            #batchDateInput {
                flex: 1 1 100%;
            }

            #batchApplyDateBtn {
                flex: 1;
            }

            #batchNlDateBtn {
                width: 40px;
            }
        }
    }

    // 批量应用按钮样式
    #batchApplyCategoryBtn,
    #batchApplyPriorityBtn,
    #batchApplyDateBtn {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 12px;
        font-weight: 500;
        border-radius: 6px;
        transition: all 0.2s ease;
        position: relative;
        overflow: hidden;

        &:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            background: var(--b3-theme-surface-light);
            color: var(--b3-theme-on-surface-light);
        }

        &:not(:disabled):hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        &:not(:disabled):active {
            transform: translateY(0);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        &::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            transition: left 0.5s ease;
        }

        &:hover::before {
            left: 100%;
        }
    }

    .block-list-header {
        margin-bottom: 16px;
        padding: 12px 16px;
        background: linear-gradient(135deg, var(--b3-theme-primary-lightest), var(--b3-theme-surface-light));
        border-radius: 8px;
        border: 1px solid var(--b3-theme-primary-light);
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;

        @media (max-width: 576px) {
            flex-direction: column;
            align-items: stretch;
        }
    }

    .list-summary {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .list-actions {
        display: flex;
        gap: 8px;

        button {
            padding: 6px 12px;
            font-size: 12px;
            border-radius: 4px;
            transition: all 0.2s ease;

            &:hover {
                transform: translateY(-1px);
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            }
        }
    }

    .summary-text {
        font-size: 14px;
        font-weight: 500;
        color: var(--b3-theme-primary);
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .summary-text::before {
        content: "📊";
        font-size: 16px;
    }

    .block-list-container {
        max-height: 400px;
        overflow-y: auto;
        border: 1px solid var(--b3-border-color);
        border-radius: 8px;
        background: var(--b3-theme-background);
    }

    .block-list {
        padding: 8px;
    }

    .block-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        margin-bottom: 8px;
        border: 1px solid var(--b3-border-color);
        border-radius: 8px;
        background: var(--b3-theme-surface);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .block-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--b3-theme-primary);
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }

    .block-item:hover {
        background: var(--b3-theme-surface-light);
        border-color: var(--b3-theme-primary-light);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .block-item:hover::before {
        transform: scaleY(1);
    }

    // 块复选框样式
    .block-checkbox {
        flex-shrink: 0;
        margin-right: 12px;

        .b3-checkbox {
            display: flex;
            align-items: center;
        }

        .block-select-checkbox {
            margin: 0;
        }

        .b3-checkbox__graphic {
            margin-right: 0;
        }
    }

    .block-info {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 1;
        min-width: 0;
    }

    .block-status {
        font-size: 18px;
        line-height: 1;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }

    .block-item:hover .block-status {
        transform: scale(1.1);
    }

    .block-content {
        flex: 1;
        min-width: 0;
    }

    .block-title {
        font-size: 14px;
        font-weight: 500;
        color: var(--b3-theme-on-background);
        margin-bottom: 6px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.3;
    }

    // 块元数据样式
    .block-meta {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .block-datetime {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 12px;
    }

    .block-attributes {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 12px;
    }

    .block-date {
        color: var(--b3-theme-primary);
        font-weight: 500;
        padding: 2px 6px;
        background: var(--b3-theme-primary-lightest);
        border-radius: 4px;
        border: 1px solid var(--b3-theme-primary-light);
    }

    .block-time {
        color: var(--b3-theme-on-surface-light);
        padding: 2px 6px;
        background: var(--b3-theme-surface-lighter);
        border-radius: 4px;
        position: relative;
    }

    .block-time::before {
        content: "⏰";
        margin-right: 4px;
    }

    .block-category {
        font-size: 11px;

        span {
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 11px;
            font-weight: 500;
        }
    }

    .block-priority {
        font-size: 11px;

        .priority-badge {
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 11px;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 2px;

            &.high {
                background: rgba(231, 76, 60, 0.1);
                color: #e74c3c;
            }

            &.medium {
                background: rgba(243, 156, 18, 0.1);
                color: #f39c12;
            }

            &.low {
                background: rgba(52, 152, 219, 0.1);
                color: #3498db;
            }

            &.none {
                background: rgba(149, 165, 166, 0.1);
                color: #95a5a6;
            }
        }
    }

    .block-actions {
        flex-shrink: 0;
        margin-left: 12px;
    }

    .block-edit-btn {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 6px;
        border: 1px solid var(--b3-theme-primary-light);
        background: var(--b3-theme-background);
        color: var(--b3-theme-primary);
        transition: all 0.2s ease;
        position: relative;
        overflow: hidden;
    }

    .block-edit-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s ease;
    }

    .block-edit-btn:hover {
        background: var(--b3-theme-primary);
        color: white;
        border-color: var(--b3-theme-primary);
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .block-edit-btn:hover::before {
        left: 100%;
    }

    .block-edit-btn:active {
        transform: translateY(0);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    // 加载动画
    .block-item {
        animation: slideInUp 0.3s ease forwards;
    }

    .block-item:nth-child(1) {
        animation-delay: 0ms;
    }

    .block-item:nth-child(2) {
        animation-delay: 50ms;
    }

    .block-item:nth-child(3) {
        animation-delay: 100ms;
    }

    .block-item:nth-child(4) {
        animation-delay: 150ms;
    }

    .block-item:nth-child(5) {
        animation-delay: 200ms;
    }

    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

}

.reminder-panel {
    padding: 8px;
    height: 95%;
    display: flex;
    flex-direction: column;
}

.reminder-header {
    margin-bottom: 12px;
}

.reminder-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 8px;

    .reminder-icon {
        font-size: 16px;
    }

    .reminder-badge {
        background: var(--b3-theme-error);
        color: white;
        border-radius: 50%;
        min-width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: bold;
        margin-left: 4px; // 给徽章添加一点左边距
    }
}

.reminder-controls {
    .b3-select {
        width: 100%;
    }
}

.reminder-list {
    flex: 1;
    overflow-y: auto;
}

.reminder-empty {
    text-align: center;
    color: var(--b3-theme-on-surface-light);
    padding: 20px;
}

.reminder-item {
    border: 1px solid var(--b3-theme-surface-lighter);
    border-radius: 4px;
    margin-bottom: 8px;
    padding: 8px;

    &--overdue {
        border-color: var(--b3-theme-error-light);
    }





}

.reminder-item__content {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.reminder-item__left-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    flex-shrink: 0;
    margin-right: 6px;
    min-width: 16px;
    padding-top: 2px; // 轻微向下调整，更好对齐标题

    input[type="checkbox"] {
        width: 14px;
        height: 14px;
        margin: 0;
        flex-shrink: 0;
        order: 1; // 复选框在上方
    }
}

.collapse-btn {
    min-width: 14px !important;
    width: 14px !important;
    height: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    color: var(--b3-theme-on-surface-light) !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 2; // 折叠按钮在下方

    &:hover {
        background: var(--b3-theme-surface-light) !important;
        color: var(--b3-theme-primary) !important;
        border-radius: 2px !important;
    }

    svg {
        width: 10px;
        height: 10px;
        transition: transform 0.2s ease;
    }
}

.collapse-spacer {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin: 0;
    order: 1; // 占位符也在上方，与折叠按钮位置一致
}

.reminder-item__info {
    flex: 1;
}

.reminder-item__title {
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 4px;
    color: var(--b3-theme-on-background);
    text-decoration: none;
    transition: color 0.2s ease;

    &:hover {
        color: var(--b3-theme-primary);
        text-decoration: underline;
    }
}

.reminder-item__time {
    font-size: 12px;
    color: var(--b3-theme-on-surface-light);
    cursor: pointer;

    &:hover {
        color: var(--b3-theme-primary);
    }
}

.reminder-overdue-label {
    color: var(--b3-theme-error);
    font-weight: 500;
    margin-left: 8px;
}

.reminder-dialog {


    .b3-form__group {
        margin-bottom: 16px;
    }

    .b3-form__label {
        display: block;
        margin-bottom: 4px;
        font-weight: 500;
    }

    .b3-form__desc {
        font-size: 12px;
        color: var(--b3-theme-on-surface-light);
        margin-top: 4px;
    }
}

.batch-reminder-dialog {
    .b3-form__group {
        margin-bottom: 16px;
    }

    .b3-form__label {
        display: block;
        margin-bottom: 4px;
        font-weight: 500;
    }

    .b3-form__desc {
        font-size: 12px;
        color: var(--b3-theme-on-surface-light);
        margin-top: 4px;
    }
}

.time-edit-dialog {


    .b3-form__group {
        margin-bottom: 16px;
    }

    .b3-form__label {
        display: block;
        margin-bottom: 4px;
        font-weight: 500;
    }

    .b3-form__desc {
        font-size: 12px;
        color: var(--b3-theme-on-surface-light);
        margin-top: 4px;
    }
}

// 通用 dialog 布局优化
.quick-reminder-dialog,
.reminder-dialog,
.batch-reminder-dialog,
.time-edit-dialog {
    max-height: 100%;
    max-width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
    // 使 dialog 整体高度使用 flexbox
    .b3-dialog__container {
        display: flex;
        flex-direction: column;

    }

    // 内容区域自适应高度
    .b3-dialog__content {
        flex: 1;
        overflow-y: auto;
        padding: 20px;

    }

    // 按钮区域固定在底部
    .b3-dialog__action {
        flex-shrink: 0;
        padding: 16px 20px;
        border-top: 1px solid var(--b3-theme-surface-lighter);
        background: var(--b3-theme-surface);
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        margin: 0; // 移除默认margin
    }
}

// 自然语言对话框样式优化
.nl-dialog {
    .b3-dialog__container {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .b3-dialog__content {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
        min-height: 0;
    }

    .b3-dialog__action {
        flex-shrink: 0;
        padding: 16px 20px;
        border-top: 1px solid var(--b3-theme-surface-lighter);
        background: var(--b3-theme-surface);
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        margin: 0;
    }
}

// 预览样式
.nl-preview {
    padding: 12px;
    border: 1px solid var(--b3-border-color);
    border-radius: 6px;
    background: var(--b3-theme-surface);
    font-size: 14px;
    color: var(--b3-theme-on-surface-light);
    min-height: 40px;
    display: flex;
    align-items: center;

    &.nl-preview--success {
        background: var(--b3-card-success-background);
        color: var(--b3-card-success-color);
        border-color: var(--b3-card-success-color);
    }

    &.nl-preview--error {
        background: var(--b3-card-error-background);
        color: var(--b3-card-error-color);
        border-color: var(--b3-card-error-color);
    }
}

/* 悬浮窗口中的提醒面板样式 */
#floatReminderPanel {
    .reminder-panel {
        height: 95%;
        padding: 4px;
    }

    .reminder-list {
        max-height: 600px;
        overflow-y: auto;
    }
}

/* 停靠栏徽章样式 */
.reminder-dock-badge {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    background: var(--b3-theme-error) !important;
    color: white !important;
    border-radius: 50% !important;
    min-width: 14px !important;
    height: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* 确保停靠栏图标有相对定位 */
.dock__item[data-type="reminder_dock"] {
    position: relative !important;
}

// 提醒徽章样式
.reminder-badge,
.reminder-dock-badge {
    background: var(--b3-theme-error);
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    z-index: 1;
}

// 日历视图样式
.reminder-calendar-view {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px;
}

// 视图按钮激活状态样式
.reminder-calendar-view-group .b3-button--primary {
    background-color: var(--b3-theme-primary) !important;
    color: white !important;
    border-color: var(--b3-theme-primary) !important;
}

.reminder-calendar-view-group .b3-button--primary:hover {
    background-color: var(--b3-theme-primary-light) !important;
    border-color: var(--b3-theme-primary-light) !important;
}

.reminder-calendar-toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    align-items: center;
}

.reminder-calendar-view-group {
    display: flex;
    gap: 4px;
}

.reminder-calendar-container {
    flex: 1;
    overflow: auto;
    background-color: var(--b3-theme-background);
}

// 修改日历样式以适应思源主题
.fc {
    --fc-border-color: var(--b3-border-color);
    --fc-button-bg-color: var(--b3-theme-primary);
    --fc-button-border-color: var(--b3-theme-primary);
    --fc-button-hover-bg-color: var(--b3-theme-primary-light);
    --fc-button-hover-border-color: var(--b3-theme-primary-light);
    --fc-event-bg-color: var(--b3-theme-primary);
    --fc-event-border-color: var(--b3-theme-primary);
    --fc-page-bg-color: var(--b3-theme-background);
    --fc-today-bg-color: var(--b3-theme-primary-lightest);
}

.fc .fc-button {
    font-family: inherit;
}

.fc-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

// 提醒事件样式
.reminder-calendar-event-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 2px 4px;
    position: relative; // 为绝对定位的图标提供参考点
}

.reminder-calendar-event-checkbox {
    flex-shrink: 0;
    margin-top: 2px;
}

.reminder-calendar-event-content {
    flex: 1;
    overflow: hidden;
}



.fc-event.completed .reminder-calendar-event-content {
    text-decoration: line-through;
}

.fc-event.completed .reminder-calendar-event-content .fc-event-title {
    text-decoration: line-through;
}

.reminder-calendar-event-note {
    font-size: 0.85em;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

// 周期重复图标样式（右上角最右侧）
.reminder-repeat-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    z-index: 4;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

// 链接图标样式（右上角中间）
.reminder-link-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    z-index: 3;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: help;
}

// 深色主题下的链接图标
.b3-theme-dark .reminder-link-indicator {
    background: rgba(50, 50, 50, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

// 当存在重复图标时，链接图标往左偏移
.reminder-calendar-event-wrapper:has(.reminder-repeat-indicator) .reminder-link-indicator {
    right: 16px; // 重复图标宽度12px + 4px间距
}

// 分类图标样式（右上角最左侧）
.reminder-category-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 2;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: help;
}

// 深色主题下的分类图标
.b3-theme-dark .reminder-category-indicator {
    background: rgba(50, 50, 50, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

// 当存在链接图标时，分类图标往左偏移
.reminder-calendar-event-wrapper:has(.reminder-link-indicator) .reminder-category-indicator {
    right: 18px; // 链接图标宽度14px + 4px间距
}

// 当同时存在重复图标和链接图标时，分类图标需要再往左偏移
.reminder-calendar-event-wrapper:has(.reminder-repeat-indicator):has(.reminder-link-indicator) .reminder-category-indicator {
    right: 32px; // 重复12px + 链接14px + 两个间距8px
}

// 当只有重复图标和分类图标时，分类图标往左偏移
.reminder-calendar-event-wrapper:has(.reminder-repeat-indicator):not(:has(.reminder-link-indicator)) .reminder-category-indicator {
    right: 16px; // 重复图标宽度12px + 4px间距
}

.reminder-repeat-indicator.recurring {
    color: #2196F3; // 原始重复事件用蓝色
}

.reminder-repeat-indicator.instance {
    color: #FF9800; // 重复实例用橙色
}

// 绑定块和非绑定块的透明度区分
.fc-event.no-block-binding {
    opacity: 0.75;
}

.fc-event.has-block-binding {
    opacity: 1;
}

// 已完成的非绑定块事件，透明度更低
.fc-event.no-block-binding.completed {
    opacity: 0.5;
}

// 提醒面板样式
.reminder-panel {
    display: flex;
    flex-direction: column;
    height: 95%;
}

.reminder-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--b3-border-color);
}

.reminder-panel__title {
    font-weight: bold;
    flex: 1;
}

.reminder-panel__actions {
    display: flex;
    gap: 4px;
    margin-left: auto; // 确保按钮容器靠右
}

.reminder-panel__content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* 跨天日期设置样式 */
.reminder-date-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;

    input[type="date"],
    input[type="datetime-local"] {
        flex: 1;
        min-width: 0;
    }

    input[type="date"]:first-child,
    input[type="datetime-local"]:first-child {
        flex: 1;
    }

    input[type="date"]:last-child,
    input[type="datetime-local"]:last-child {
        flex: 1;
        opacity: 0.8;
        border-style: dashed;

        &:focus {
            opacity: 1;
            border-style: solid;
        }

        &:not(:placeholder-shown) {
            opacity: 1;
            border-style: solid;
        }
    }
}

.reminder-arrow {
    color: var(--b3-theme-on-surface-light, #666);
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
    user-select: none;
    opacity: 0.7;
}

.reminder-end-date::placeholder {
    color: var(--b3-theme-on-surface-light, #999);
    font-size: 12px;
}

/* 响应式布局 */
@media (max-width: 480px) {
    .reminder-date-container {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;

        .reminder-arrow {
            align-self: center;
            transform: rotate(90deg);
        }
    }
}

.existing-reminders-container {
    max-height: 90px;
    overflow-y: auto;
    border: 1px solid var(--b3-border-color);
    border-radius: 4px;
    padding: 8px;

    .reminder-empty {
        text-align: center;
        color: var(--b3-theme-on-surface-light);
        font-size: 12px;
        padding: 16px;
    }
}

.reminder-item--compact {
    padding: 8px;
    border-radius: 4px;
    background: var(--b3-theme-surface);
    margin-bottom: 4px;

    .reminder-item__title {
        font-size: 13px;
        font-weight: 500;
        margin-bottom: 4px;
    }

    .reminder-item__time {
        font-size: 12px;
        color: var(--b3-theme-on-surface-light);

        &:hover {
            color: var(--b3-theme-primary);
            text-decoration: underline;
        }
    }

    .reminder-item__note {
        font-size: 11px;
        color: var(--b3-theme-on-surface-light);
        margin-top: 4px;
        font-style: italic;
        white-space: pre-wrap;
    }
}

// 优先级颜色样式
// .reminder-priority-high {
//     border-left: 4px solid var(--b3-card-error-color) !important;
//     background-color: var(--b3-card-error-background) !important;
// }

// .reminder-priority-high .reminder-item__note {
//     border: 2px solid var(--b3-card-error-color) !important;
//     color: var(--b3-card-error-color) !important;
//     background-color: transparent !important;
//             white-space: pre-wrap;
// }

// .reminder-priority-medium {
//     border-left: 4px solid var(--b3-card-warning-color) !important;
//     background-color: var(--b3-card-warning-background) !important;
// }

// .reminder-priority-medium .reminder-item__note {
//     color: var(--b3-card-warning-color) !important;
//     background-color: var(--b3-card-warning-background) !important;
//     border: 2px solid var(--b3-card-warning-color) !important;
//     white-space: pre-wrap;
// }

// .reminder-priority-low {
//     border-left: 4px solid var(--b3-card-info-color) !important;
//     background-color: var(--b3-card-info-background) !important;
// }

// .reminder-priority-low .reminder-item__note {
//     color: var(--b3-card-info-color) !important;
//     background-color: var(--b3-card-info-background) !important;
//     border: 2px solid var(--b3-card-info-color) !important;
//     white-space: pre-wrap;
// }

// .reminder-priority-none {
// .reminder-priority-none .reminder-item__note {
//     color: var(--b3-theme-on-background) !important;
//     background-color: transparent !important;
//     border: 2px solid var(--b3-border-color) !important;
//     white-space: pre-wrap;
// }

// 日历事件优先级样式
// .fc-event.reminder-priority-high {
//     background-color: var(--b3-card-error-background) !important;
//     border-color: var(--b3-card-error-color) !important;
//     color: var(--b3-card-error-color) !important;
// }

// .fc-event.reminder-priority-high .reminder-calendar-event-content {
//     color: var(--b3-card-error-color) !important;
// }

// .fc-event.reminder-priority-medium {
//     background-color: var(--b3-card-warning-background) !important;
//     border-color: var(--b3-card-warning-color) !important;
//     color: var(--b3-card-warning-color) !important;

// }

// .fc-event.reminder-priority-medium .reminder-calendar-event-content {
//     color: var(--b3-card-warning-color) !important;
// }

// .fc-event.reminder-priority-low {
//     background-color: var(--b3-card-info-background) !important;
//     border-color: var(--b3-card-info-color) !important;
//     color: var(--b3-card-info-color) !important;
// }

// .fc-event.reminder-priority-low .reminder-calendar-event-content {
//     color: var(--b3-card-info-color) !important;
// }

// .fc-event.reminder-priority-none {
//     background-color: #c6d1c8 !important;
//     color: var(--b3-theme-on-background) !important;
// }

// .fc-event.reminder-priority-none .reminder-calendar-event-content {
//     color: #000 !important;
// }


// 优先级选择器样式
.priority-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.priority-option {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid var(--b3-border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--b3-theme-background);
}

.priority-option:hover {
    background: var(--b3-theme-surface-light);
}

.priority-option.selected {
    border-color: var(--b3-theme-primary);
    background: var(--b3-theme-primary-lightest);
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-dot.high {
    background-color: #e74c3c;
}

.priority-dot.medium {
    background-color: #f39c12;
}

.priority-dot.low {
    background-color: #3498db;
}

.priority-dot.none {
    background-color: #95a5a6;
}

// 优先级标签样式
.reminder-priority-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 500;
}

.reminder-priority-label.high {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.reminder-priority-label.medium {
    background-color: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.reminder-priority-label.low {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.reminder-priority-label.none {
    background-color: rgba(149, 165, 166, 0.1);
    color: #95a5a6;
}



.category-selector-container {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

// 分类选择器样式 - 横向排列
.category-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.category-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 2px solid var(--b3-border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--b3-theme-background);
    font-size: 12px;
    white-space: nowrap;
    min-height: 28px;
    box-sizing: border-box;
    position: relative;
}

.category-option:hover {
    background: var(--b3-theme-surface-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--b3-theme-primary-light);
}

.category-option.selected {
    border: 3px solid var(--b3-theme-primary) !important;
    box-shadow: 0 0 0 2px var(--b3-theme-primary-light), 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transform: scale(1.05) !important;
    z-index: 2;
}

.category-option.selected::after {
    content: '✓';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background: var(--b3-theme-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

// 无分类选项特殊样式
.category-option[data-category=""] {
    background: var(--b3-theme-background);
    color: var(--b3-theme-on-surface-light);
    border-style: dashed;
    border-width: 2px;
}

.category-option[data-category=""]:hover {
    background: var(--b3-theme-surface-light);
    color: var(--b3-theme-on-background);
    border-style: solid;
}

.category-option[data-category=""].selected {
    background: var(--b3-theme-primary-lightest) !important;
    color: var(--b3-theme-primary) !important;
    border-style: solid !important;
    border-color: var(--b3-theme-primary) !important;
    font-weight: bold;
}

.category-option[data-category=""].selected::after {
    background: var(--b3-theme-primary);
    color: white;
}

// 有颜色的分类选项样式
.category-option[data-category]:not([data-category=""]) {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
    border-width: 2px;
}

.category-option[data-category]:not([data-category=""]):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    filter: brightness(1.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.category-option[data-category]:not([data-category=""]).selected {
    border: 3px solid white !important;
    box-shadow: 0 0 0 2px var(--b3-theme-primary), 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    transform: scale(1.05) !important;
    filter: brightness(1.2) saturate(1.2) !important;
    font-weight: bold;
}

.category-option[data-category]:not([data-category=""]).selected::after {
    background: white;
    color: var(--b3-theme-primary);
    border-color: var(--b3-theme-primary);
}

#manageCategoriesBtn {
    padding: 6px 8px;
    min-width: auto;
    height: 28px; // 与分类选项高度保持一致
}

// 分类管理对话框样式
.category-manage-dialog {
    .b3-dialog__content {
        padding: 16px;
    }
}

.category-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--b3-border-color);
}

.categories-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--b3-border-color);
    border-radius: 8px;
    background: var(--b3-theme-surface);
    transition: all 0.2s ease;
}

.category-item:hover {
    background: var(--b3-theme-surface-light);
    border-color: var(--b3-theme-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.category-visual {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-color-preview {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.category-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--b3-theme-on-background);
    flex: 1;
}

.category-actions {
    display: flex;
    gap: 6px;
}

.category-edit-btn,
.category-delete-btn {
    min-width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.category-edit-btn:hover {
    background: var(--b3-theme-primary-lightest);
    border-color: var(--b3-theme-primary);
    color: var(--b3-theme-primary);
}

.category-delete-btn:hover {
    background: var(--b3-card-error-background);
    border-color: var(--b3-card-error-color);
    color: var(--b3-card-error-color);
}

.category-error {
    text-align: center;
    color: var(--b3-theme-on-surface-light);
    padding: 20px;
    font-style: italic;
}

// 分类编辑对话框样式
.category-edit-dialog {
    .b3-dialog__content {
        padding: 20px;
    }
}

.category-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid var(--b3-border-color);
    border-radius: 6px;
    background: var(--b3-theme-surface);
}

.category-preview .category-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.category-preview span {
    font-size: 14px;
    color: var(--b3-theme-on-background);
}

#previewIcon {
    font-size: 16px;
}

#previewName {
    font-weight: 500;
}

// 空状态样式
.categories-list:empty::before {
    content: "暂无分类，点击" 添加分类"创建第一个分类";
    display: block;
    text-align: center;
    color: var(--b3-theme-on-surface-light);
    padding: 40px 20px;
    font-style: italic;
}

/* 快速提醒对话框样式 */
.quick-reminder-dialog {

    .b3-form__group {
        margin-bottom: 16px;
    }

    .b3-form__label {
        display: block;
        margin-bottom: 4px;
        font-weight: 500;
    }

    .b3-form__desc {
        font-size: 12px;
        color: var(--b3-theme-on-surface-light);
        margin-top: 4px;
    }

    .title-input-container {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .category-selector {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 8px;
    }

    .category-option {
        padding: 6px 12px;
        border: 1px solid var(--b3-theme-border);
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 12px;
        color: white;
        background-color: var(--b3-theme-surface-lighter);

        &:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        &.selected {
            border-color: var(--b3-theme-primary);
            box-shadow: 0 0 0 2px rgba(var(--b3-theme-primary-rgb), 0.2);
        }

        span {
            color: white;
        }
    }

    .priority-selector {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .priority-option {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        border: 1px solid var(--b3-border-color);
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s ease;
        background: var(--b3-theme-background);

        &:hover {
            background: var(--b3-theme-surface-light);
            border-color: var(--b3-theme-primary-light);
        }

        &.selected {
            border-color: var(--b3-theme-primary);
            background: var(--b3-theme-primary-lightest);
            color: var(--b3-theme-primary);
        }
    }

    .priority-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;

        &.high {
            background-color: #e74c3c;
        }

        &.medium {
            background-color: #f39c12;
        }

        &.low {
            background-color: #3498db;
        }

        &.none {
            background-color: #95a5a6;
        }
    }

    .reminder-date-container {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .reminder-arrow {
        color: var(--b3-theme-on-surface-light);
        font-weight: bold;
    }

    .repeat-setting-container {
        width: 100%;
    }
}

/* 绑定到块对话框样式 */
.bind-to-block-dialog {
    .block-content-preview {
        padding: 8px;
        background-color: var(--b3-theme-surface-lighter);
        border: 1px solid var(--b3-theme-border);
        border-radius: 4px;
        font-size: 12px;
        color: var(--b3-theme-on-surface);
        max-height: 100px;
        overflow-y: auto;
        word-break: break-all;
    }
}

/* 自然语言识别对话框样式 */
.nl-dialog {
    .nl-preview {
        padding: 12px;
        border: 1px solid var(--b3-theme-border);
        border-radius: 4px;
        background-color: var(--b3-theme-surface-lighter);
        font-size: 13px;
        min-height: 40px;
        display: flex;
        align-items: center;

        &.nl-preview--success {
            border-color: var(--b3-theme-success);
            background-color: var(--b3-theme-success-lightest);
            color: var(--b3-theme-success);
        }

        &.nl-preview--error {
            border-color: var(--b3-theme-error);
            background-color: var(--b3-theme-error-lightest);
            color: var(--b3-theme-error);
        }
    }
}

/* 快速提醒事件样式 */
.fc-event.reminder-quick {
    opacity: 0.8;
    border-style: dashed !important;
}

.fc-event.reminder-quick::before {
    content: "🔗";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.7;
}

/* 任务分类标签样式 */
.reminder-item__category {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    margin-top: 4px;
    transition: all 0.2s ease;
    position: relative;
    line-height: 1.2;
    white-space: nowrap;
    cursor: default;
    border: 1px solid transparent;

    /* 图标样式 */
    span:first-child {
        font-size: 10px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 名称样式 */
    span:last-child {
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.02em;
    }

    /* 悬停效果 */
    &:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        filter: brightness(1.1) saturate(1.1);
        border-color: rgba(255, 255, 255, 0.3);
    }

    /* 暗色模式适配 */
    @media (prefers-color-scheme: dark) {
        &:hover {
            filter: brightness(1.2) saturate(1.1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }
    }


}

@keyframes categoryFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(2px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 在完成的任务中保持分类标签的可见性 */
.reminder-item[style*="opacity: 0.5"] .reminder-item__category {
    opacity: 0.8;
    filter: grayscale(0.3);
}

.reminder-item[style*="opacity: 0.5"] .reminder-item__category:hover {
    opacity: 1;
    filter: grayscale(0.1) brightness(1.1);
}