
/* 
组件样式文件
url: static/css/zujian.css
创建: 2025-10-29 12:00
 © 2024-2025 www.family.com  版权所有 保留一切权利
*/



/* 自定义日期选择器样式 */
.custom-date-picker {
    position: relative;
    display: inline-block;
}

.custom-date-picker input {
    cursor: pointer;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-date-picker input:hover {
    border-color: #2196f3;
}

.custom-date-picker input:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
    outline: none;
}

.calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    animation: fadeIn 0.2s ease-out forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; }
}

.custom-calendar-container {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    padding: 20px;
    min-width: 600px;
    border: 1px solid #e0e0e0;
    
    /* 初始状态 */
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    animation: slideDown 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 展开动画 */
@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 关闭动画 */
.custom-calendar-container.closing {
    animation: slideUp 0.2s ease-in forwards;
}

@keyframes slideUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

/* 确保弹窗在小屏幕上不超出边界 */
@media (max-width: 768px) {
    .custom-calendar-container {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0.95);
        margin-top: 0;
        min-width: 350px;
        max-width: 90vw;
    }
    
    @keyframes slideDown {
        0% {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.9);
        }
        100% {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }
}

.calendar-header {
    margin-bottom: 15px;
    text-align: center;
}

.date-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.date-inputs input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 120px;
    margin-right: 0;
}

.calendar-wrapper {
    display: flex;
    gap: 20px;
}

.calendar-month {
    flex: 1;
}

.month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 10px;
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 16px;
    color: #666;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.nav-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 8px;
}

.calendar-weekdays div {
    text-align: center;
    padding: 8px;
    font-weight: bold;
    color: #666;
    font-size: 14px;
}

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

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.calendar-day.current-month {
    color: #333;
}

.calendar-day.current-month:hover {
    background-color: #e3f2fd;
    transform: scale(1.1);
}

.calendar-day.prev-month,
.calendar-day.next-month {
    color: #ccc;
}

.calendar-day.today {
    background-color: #ff9800;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.calendar-day.in-range {
    background-color: #e3f2fd !important;
    color: #1976d2 !important;
}

.calendar-day.selected {
    background-color: #1976d2;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
    transform: scale(1.05);
}

.calendar-footer {
    margin-top: 10px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.calendar-footer button {
    padding: 5px 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    background: white;
    font-size: 14px;
    transition: all 0.2s;
}

.calendar-footer button:first-child {
    color: #666;
}

.calendar-footer button:first-child:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.calendar-footer button:last-child {
    background-color: #2196f3;
    color: white;
    border-color: #2196f3;
}

.calendar-footer button:last-child:hover {
    background-color: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

/* 年月选择器样式 */
.selection-mode-tabs {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 15px;
}

.mode-tab {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.mode-tab:hover {
    background-color: #f5f5f5;
    border-color: #2196f3;
}

.mode-tab.active {
    background-color: #2196f3;
    color: white;
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

/* 年选择器样式 */
.year-selector {
    padding: 10px;
}

.year-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.year-range-title {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.year-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.year-item {
    aspect-ratio: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.year-item:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.year-item.current-year {
    background-color: #ff9800;
    color: white;
    font-weight: bold;
    border-color: #ff9800;
}

.year-item.selected {
    background-color: #1976d2;
    color: white;
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

/* 月选择器样式 */
.month-selector {
    padding: 10px;
}

.month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.year-title {
    font-weight: bold;
    font-size: 16px;
    color: #2196f3;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.year-title:hover {
    background-color: #e3f2fd;
    text-decoration: none;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.month-item {
    aspect-ratio: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.month-item:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.month-item.current-month {
    background-color: #ff9800;
    color: white;
    font-weight: bold;
    border-color: #ff9800;
}

.month-item.selected {
    background-color: #1976d2;
    color: white;
    border-color: #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

/* 月份和年份标题可点击样式 */
.month-title {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    color: #333;
    font-weight: 500;
}

.month-title:hover {
    color: #1976d2;
    background-color: #e3f2fd;
}

/* 调整日历容器高度以适应不同模式 */
.calendar-content {
    min-height: 300px;
    transition: height 0.3s ease;
}

/* 添加一些微妙的阴影效果 */
.custom-calendar-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
    filter: drop-shadow(0 -2px 4px rgba(0, 0, 0, 0.1));
}

/* 小屏幕上隐藏箭头 */
@media (max-width: 768px) {
    .custom-calendar-container::before {
        display: none;
    }
}

