/* ========== 每日幻想管理面板 ========== */

.daily-fantasy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.daily-fantasy-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ---- Header ---- */
.daily-fantasy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.daily-fantasy-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.daily-fantasy-header .df-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.daily-fantasy-header .df-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ---- NPC Selector ---- */
.df-npc-selector-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 28px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    flex-shrink: 0;
}

.df-npc-selector-row label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.df-npc-selector {
    padding: 8px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    min-width: 220px;
    transition: border-color 0.2s;
}

.df-npc-selector:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ---- Scrollable Body ---- */
.daily-fantasy-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---- Section containers ---- */
.df-section {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.df-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f8f5ff;
    border-bottom: 1px solid #e5e7eb;
}

.df-section-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #4f46e5;
    margin: 0;
}

.df-section-body {
    padding: 16px 20px;
}

/* ---- Prompt input area ---- */
.df-prompt-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.df-prompt-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 72px;
    line-height: 1.5;
    color: #374151;
    transition: border-color 0.2s;
}

.df-prompt-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.df-generate-btn {
    padding: 10px 22px;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    height: 42px;
    align-self: flex-end;
}

.df-generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.45);
}

.df-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---- Pending video grid ---- */
.df-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    min-height: 100px;
}

.df-video-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    padding: 30px 0;
}

.df-pending-card {
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.df-pending-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #a78bfa;
}

.df-pending-card.selected {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.df-card-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #e5e7eb;
    display: block;
}

.df-card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #a78bfa;
}

.df-card-body {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.df-card-meta {
    font-size: 11px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.df-card-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid #f0f0f0;
}

.df-btn-schedule {
    flex: 1;
    padding: 6px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.df-btn-schedule:hover {
    background: #4338ca;
}

.df-btn-select {
    padding: 6px 10px;
    background: #f3f4f6;
    color: #374151;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.df-btn-select.active {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #7c3aed;
}

/* ---- Batch schedule bar ---- */
.df-batch-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #ede9fe;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #4f46e5;
    font-weight: 600;
}

.df-batch-bar input[type="date"] {
    padding: 6px 10px;
    border: 1.5px solid #a78bfa;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: #fff;
}

.df-batch-btn {
    padding: 7px 18px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.df-batch-btn:hover {
    background: #6d28d9;
}

/* ---- Calendar ---- */
.df-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.df-calendar-nav button {
    padding: 6px 16px;
    background: #f3f4f6;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    color: #374151;
    font-weight: 600;
}

.df-calendar-nav button:hover {
    background: #e5e7eb;
}

.df-calendar-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.df-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.df-calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    padding: 4px 0;
    text-transform: uppercase;
}

.df-calendar-day {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    min-height: 80px;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.df-calendar-day:hover {
    border-color: #a78bfa;
    background: #faf5ff;
}

.df-calendar-day.other-month {
    opacity: 0.35;
    cursor: default;
}

.df-calendar-day.other-month:hover {
    border-color: #e5e7eb;
    background: #fff;
}

.df-calendar-day.today {
    border-color: #4f46e5;
    background: #eef2ff;
}

.df-calendar-day.scheduled {
    border-color: #7c3aed;
    background: #faf5ff;
}

.df-calendar-day.empty {
    background: #fff;
}

.df-day-number {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    line-height: 1;
}

.df-calendar-day.today .df-day-number {
    color: #4f46e5;
}

.df-calendar-day.scheduled .df-day-number {
    color: #7c3aed;
}

.df-day-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin-top: 2px;
}

.df-day-label {
    font-size: 10px;
    color: #7c3aed;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.df-day-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.df-calendar-day.scheduled:hover .df-day-remove-btn {
    display: flex;
}

/* ---- Date picker modal ---- */
.df-date-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.df-date-picker-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    min-width: 320px;
}

.df-date-picker-box h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px;
}

.df-date-picker-box input[type="date"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.df-date-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.df-date-picker-actions button {
    padding: 8px 20px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.df-date-picker-actions .df-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.df-date-picker-actions .df-cancel:hover {
    background: #e5e7eb;
}

.df-date-picker-actions .df-confirm {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.df-date-picker-actions .df-confirm:hover {
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.45);
}

/* ---- Status badges ---- */
.df-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.df-status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.df-status-badge.processing {
    background: #dbeafe;
    color: #2563eb;
}

.df-status-badge.completed {
    background: #d1fae5;
    color: #059669;
}

.df-status-badge.failed {
    background: #fee2e2;
    color: #dc2626;
}

/* ---- Loading spinner ---- */
.df-loading {
    text-align: center;
    padding: 30px;
    color: #9ca3af;
    font-size: 14px;
}

.df-loading::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: df-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes df-spin {
    to { transform: rotate(360deg); }
}

/* ---- Header button ---- */
.btn-daily-fantasy {
    padding: 12px 24px;
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-daily-fantasy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
}

/* 进度条脉冲动画 */
@keyframes df-pulse {
    0%, 100% { opacity: 0.4; width: 20%; }
    50% { opacity: 1; width: 50%; }
}
