/* ===== 教师备忘事项 - 浮动按钮 + 侧边面板样式 ===== */

/* 浮动按钮 */
.memo-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90e2 0%, #67b8ff 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    z-index: 10000;
    transition: all 0.3s ease;
}

.memo-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(74, 144, 226, 0.5);
}

.memo-fab:active {
    transform: scale(0.95);
}

/* 未完成数量徽章 */
.memo-fab .memo-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4757;
    color: white;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.4);
}

.memo-fab .memo-badge:empty,
.memo-fab .memo-badge[data-count="0"] {
    display: none;
}

/* 遮罩层 */
.memo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    /* 透明背景，仅用于点击关闭 */
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.memo-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* 侧边面板 (改为浮动对话框样式) */
/* 侧边面板 (改为浮动对话框样式 - 磨砂玻璃风格) */
.memo-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-width: 90vw;
    height: 550px;
    max-height: 80vh;

    /* 磨砂玻璃效果 */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

    z-index: 10002;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;

    /* 初始隐藏状态：缩放+透明 */
    transform-origin: bottom right;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.memo-panel.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* 面板头部 */
.memo-panel-header {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.9) 0%, rgba(103, 184, 255, 0.9) 100%);
    backdrop-filter: blur(5px);
    color: white;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

.memo-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.memo-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.memo-panel-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* 添加按钮区域 */
.memo-add-bar {
    padding: 16px 24px;
    border-bottom: 1px solid #eef2f7;
    flex-shrink: 0;
}

.memo-add-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #4a90e2, #67b8ff);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.memo-add-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* 筛选标签 */
.memo-filter-bar {
    padding: 10px 24px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #eef2f7;
    flex-shrink: 0;
}

.memo-filter-tab {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    background: white;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.memo-filter-tab.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
}

.memo-filter-tab:hover:not(.active) {
    border-color: #4a90e2;
    color: #4a90e2;
}

/* 备忘列表 */
.memo-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 24px;
}

.memo-list::-webkit-scrollbar {
    width: 5px;
}

.memo-list::-webkit-scrollbar-thumb {
    background: #d0d7de;
    border-radius: 3px;
}

.memo-empty {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.memo-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    color: #d0d7de;
}

.memo-empty p {
    font-size: 14px;
}

/* 单条备忘卡片 (玻璃风格) */
.memo-item {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(5px);
}

.memo-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: #fff;
}

.memo-item.completed {
    opacity: 0.6;
    background: #fafafa;
}

.memo-item.completed .memo-item-title {
    text-decoration: line-through;
    color: #999;
}

/* 优先级指示条 */
.memo-item.priority-high {
    border-left: 4px solid #ff4757;
}

.memo-item.priority-mid {
    border-left: 4px solid #ffa502;
}

.memo-item.priority-low {
    border-left: 4px solid #2ed573;
}

/* 备忘头部行 */
.memo-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.memo-item-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    background: white;
}

.memo-item-checkbox:hover {
    border-color: #4a90e2;
}

.memo-item.completed .memo-item-checkbox {
    background: #4a90e2;
    border-color: #4a90e2;
    color: white;
}

.memo-item-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

/* 操作按钮组 */
.memo-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.memo-item:hover .memo-item-actions {
    opacity: 1;
}

.memo-item-actions button {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.15s;
}

.memo-item-actions button:hover {
    color: #4a90e2;
    background: rgba(74, 144, 226, 0.1);
}

.memo-item-actions button.delete-btn:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

/* 备忘内容 */
.memo-item-content {
    font-size: 13px;
    color: #666;
    margin: 4px 0 4px 30px;
    word-break: break-word;
    line-height: 1.5;
}

/* 备忘元数据行 */
.memo-item-meta {
    display: flex;
    gap: 12px;
    margin-left: 30px;
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

.memo-item-meta .overdue {
    color: #ff4757;
    font-weight: 600;
}

.memo-item-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ===== 添加/编辑表单 ===== */
.memo-form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 5;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.memo-form-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.memo-form-header {
    background: linear-gradient(135deg, #4a90e2 0%, #67b8ff 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.memo-form-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.memo-form-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.memo-form-group {
    margin-bottom: 18px;
}

.memo-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.memo-form-group input,
.memo-form-group textarea,
.memo-form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    color: #333;
}

.memo-form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a90e2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

/* 自定义日期选择器图标颜色 */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(53%) sepia(35%) saturate(959%) hue-rotate(174deg) brightness(93%) contrast(88%);
    /* 接近 #4a90e2 */
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.memo-form-group input:focus,
.memo-form-group textarea:focus,
.memo-form-group select:focus {
    outline: none;
    border-color: #4a90e2;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.15);
}

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

/* 优先级选择器 */
.memo-priority-selector {
    display: flex;
    gap: 10px;
}

.memo-priority-option {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.memo-priority-option:hover {
    border-color: #aaa;
}

.memo-priority-option.selected.high {
    border-color: #ff4757;
    background: rgba(255, 71, 87, 0.08);
    color: #ff4757;
}

.memo-priority-option.selected.mid {
    border-color: #ffa502;
    background: rgba(255, 165, 2, 0.08);
    color: #e69500;
}

.memo-priority-option.selected.low {
    border-color: #2ed573;
    background: rgba(46, 213, 115, 0.08);
    color: #20bf6b;
}

/* 表单底部按钮 */
.memo-form-footer {
    padding: 16px 24px;
    border-top: 1px solid #eef2f7;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.memo-form-footer button {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.memo-form-cancel {
    background: #f1f3f5;
    color: #666;
}

.memo-form-cancel:hover {
    background: #e9ecef;
}

.memo-form-submit {
    background: linear-gradient(135deg, #4a90e2, #67b8ff);
    color: white;
}

.memo-form-submit:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* 响应式 */
@media (max-width: 480px) {
    .memo-panel {
        width: 100vw;
        right: -100vw;
    }

    .memo-fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}