/**
 * 审核面板 - 文件夹命名弹窗样式（创建项目文件夹 / 创建子文件夹）
 * 独立组件样式，仅用于审核面板，不与其他面板通用
 *
 * 命名规范：review-folder-name-modal- 前缀
 * 字体规范：Microsoft YaHei（微软雅黑）
 * 主题：深色
 */

/* ==================== 遮罩层 ==================== */
#folderNameModal.review-folder-name-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    z-index: 10000 !important;
    display: none;
    justify-content: center !important;
    align-items: center !important;
    pointer-events: auto !important;
    animation: review-folder-name-modal-fade-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* JS 通过 style.display = 'block' 显示时，强制为 flex 以居中内容 */
#folderNameModal.review-folder-name-modal-overlay[style*="block"] {
    display: flex !important;
}

/* ==================== 对话框容器（固定高度，不随封面图变化；内容区可滚动） ==================== */
.review-folder-name-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 420px;
    max-width: 520px;
    width: 90%;
    height: 85vh;
    max-height: 85vh;
    padding: 0;
    margin: 0 auto;
    background: var(--bg-card, #1e1e1e);
    border-radius: var(--review-radius-lg, 12px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(255, 255, 255, 0.06),
                0 0 48px rgba(102, 126, 234, 0.06);
    overflow: hidden;
    animation: review-folder-name-modal-scale-in 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    border: 1px solid rgba(102, 126, 234, 0.18);
}

/* 内容区右键「创建文件夹」：固定更紧凑的高度（约 380px），并保持遮罩层 flex 居中 */
#folderNameModal.review-folder-name-modal-overlay[data-modal-mode="create-folder"] .review-folder-name-modal {
    height: min(380px, 85vh);
    max-height: min(380px, 85vh);
}

.review-folder-name-modal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-radius: 14px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(6px);
    pointer-events: none;
}

.review-folder-name-modal:hover::before {
    opacity: 1;
}

/* ==================== 头部（固定不滚动） ==================== */
.review-folder-name-modal__header {
    flex-shrink: 0;
    text-align: center;
    padding: 28px 28px 20px;
    border-bottom: 1px solid var(--review-border-color, rgba(255, 255, 255, 0.08));
    background: linear-gradient(180deg, var(--bg-card, #1e1e1e) 0%, var(--review-bg-secondary, #1a1a1a) 100%);
    position: relative;
}

.review-folder-name-modal__header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.5) 50%, transparent 100%);
    border-radius: 1px;
}

.review-folder-name-modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: #eab308;
    filter: drop-shadow(0 2px 8px rgba(234, 179, 8, 0.25));
}

.review-folder-name-modal__icon svg {
    width: 48px;
    height: 48px;
}

.review-folder-name-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: var(--review-text-primary, #f0f0f0);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.3;
}

/* ==================== 内容区（超出时垂直滚动） ==================== */
.review-folder-name-modal__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 28px;
    background: var(--bg-card, #1e1e1e);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.review-folder-name-modal__body::-webkit-scrollbar {
    width: 8px;
}

.review-folder-name-modal__body::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.review-folder-name-modal__body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.review-folder-name-modal__body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.review-folder-name-modal__input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-folder-name-modal__input-group label {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--review-text-secondary, #b0b0b0);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.review-folder-name-modal__input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    color: var(--review-text-primary, #f0f0f0);
    background: linear-gradient(135deg, var(--review-bg-secondary, #252525) 0%, var(--bg-tertiary, #2a2a2a) 100%);
    border: 1px solid var(--review-border-color, rgba(255, 255, 255, 0.12));
    border-radius: var(--review-radius-md, 8px);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.review-folder-name-modal__input::placeholder {
    color: var(--text-muted, #707070);
}

.review-folder-name-modal__input:hover:not(:focus) {
    border-color: rgba(255, 255, 255, 0.18);
}

.review-folder-name-modal__input:focus {
    border-color: rgba(102, 126, 234, 0.7);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

/* ==================== 封面图选择区域（仅创建项目文件夹） ==================== */
.review-folder-name-modal__cover-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--review-border-color, rgba(255, 255, 255, 0.08));
}

.review-folder-name-modal__detail-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--review-border-color, rgba(255, 255, 255, 0.08));
}

.review-folder-name-modal__detail-input {
    width: 100%;
    min-height: 72px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    color: var(--review-text-primary, #f0f0f0);
    background: var(--review-bg-secondary, #252525);
    border: 1px solid var(--review-border-color, rgba(255, 255, 255, 0.12));
    border-radius: var(--review-radius-md, 8px);
    resize: vertical;
    box-sizing: border-box;
}

.review-folder-name-modal__detail-input::placeholder {
    color: var(--review-text-tertiary, #888888);
}

.review-folder-name-modal__detail-input:focus {
    outline: none;
    border-color: rgba(102, 126, 234, 0.7);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.review-folder-name-modal__cover-label {
    display: block;
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--review-text-secondary, #b0b0b0);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.review-folder-cover-dropzone {
    position: relative;
    min-height: 120px;
    border: 2px dashed var(--review-border-color, rgba(255, 255, 255, 0.2));
    border-radius: var(--review-radius-md, 8px);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.review-folder-cover-dropzone:hover,
.review-folder-cover-dropzone.review-folder-cover-dropzone--dragover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.08);
}

.review-folder-cover-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.review-folder-cover-placeholder {
    padding: 16px;
    text-align: center;
}

.review-folder-cover-placeholder__text {
    font-size: 13px;
    color: var(--text-muted, #888);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.review-folder-cover-crop-wrap {
    margin-top: 14px;
}

.review-folder-cover-crop-area {
    position: relative;
    width: 100%;
    max-height: 200px;
    background: #1a1a1a;
    border-radius: var(--review-radius-md, 8px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-folder-cover-canvas-wrap {
    position: relative;
    display: inline-block;
}

.review-folder-cover-canvas {
    display: block;
    max-width: 100%;
    max-height: 200px;
    cursor: move;
}

.review-folder-cover-crop-box {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid rgba(102, 126, 234, 0.9);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    touch-action: none;
}

.review-folder-cover-crop-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.review-folder-cover-crop-box__resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, rgba(102, 126, 234, 0.8) 50%);
}

.review-folder-cover-crop-box__resize:hover {
    background: linear-gradient(135deg, transparent 50%, rgba(102, 126, 234, 1) 50%);
}

.review-folder-cover-crop-hint {
    margin: 8px 0 10px 0;
    font-size: 11px;
    color: var(--text-muted, #707070);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

.review-folder-cover-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.review-folder-cover-confirm-btn,
.review-folder-cover-reselect-btn {
    margin-bottom: 0;
}

#folderNameModal.review-folder-name-modal-overlay .review-folder-name-modal__input,
#folderNameModal.review-folder-name-modal-overlay input#folderNameInput {
    pointer-events: auto !important;
    cursor: text;
}

/* 编辑项目：名称只读时的灰色冻结样式 */
#folderNameModal.review-folder-name-modal-overlay .review-folder-name-modal__input--readonly,
#folderNameModal.review-folder-name-modal-overlay input#folderNameInput.review-folder-name-modal__input--readonly {
    background: var(--review-bg-secondary, #252525) !important;
    color: var(--review-text-tertiary, #888888) !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    border-color: rgba(255, 255, 255, 0.06);
}

.review-folder-name-modal__input-hint {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.3;
    color: var(--review-text-tertiary, #888888);
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
}

/* ==================== 底部按钮 ==================== */
.review-folder-name-modal__footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 28px 22px;
    border-top: 1px solid var(--review-border-color, rgba(255, 255, 255, 0.08));
    background: linear-gradient(180deg, var(--review-bg-secondary, #1a1a1a) 0%, var(--bg-card, #1e1e1e) 100%);
}

.review-folder-name-modal__btn {
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 500;
    font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", "Arial", sans-serif;
    border: none;
    border-radius: var(--review-radius-md, 8px);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    min-width: 88px;
    -webkit-font-smoothing: antialiased;
}

.review-folder-name-modal__btn--secondary {
    background: linear-gradient(135deg, var(--bg-hover, #2d2d2d) 0%, var(--bg-active, #363636) 100%);
    color: var(--review-text-primary, #e8e8e8);
    border: 1px solid var(--review-border-color, rgba(255, 255, 255, 0.12));
}

.review-folder-name-modal__btn--secondary:hover {
    background: linear-gradient(135deg, #363636 0%, #404040 100%);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.review-folder-name-modal__btn--primary {
    background: linear-gradient(135deg, #4f6cf6 0%, #667eea 50%, #5a67d8 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}

.review-folder-name-modal__btn--primary:hover {
    background: linear-gradient(135deg, #5a6ff7 0%, #7688f0 50%, #667eea 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
    transform: translateY(-1px);
}

.review-folder-name-modal__btn--primary:active,
.review-folder-name-modal__btn--secondary:active {
    transform: translateY(0);
}

/* ==================== 动画 ==================== */
@keyframes review-folder-name-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes review-folder-name-modal-scale-in {
    0% {
        transform: scale(0.92);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 移动端响应式已移除（项目仅支持 Windows 桌面端） */

@media (prefers-reduced-motion: reduce) {
    #folderNameModal.review-folder-name-modal-overlay,
    .review-folder-name-modal,
    .review-folder-name-modal__btn {
        animation: none !important;
        transition: none !important;
    }
}
