/* 现代化手机端配色方案 */
:root {
    /* 主色调 - 科技蓝 */
    --primary-color: #1890ff;
    --primary-light: #e6f7ff;
    --primary-dark: #096dd9;
    
    /* 辅助色 */
    --secondary-color: #595959;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --info-color: #13c2c2;
    
    /* 背景色 */
    --light-bg: #f5f7fa;
    --white: #ffffff;
    --gray-bg: #f0f2f5;
    
    /* 文本色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    
    /* 边框和阴影 */
    --border-color: #e8e8e8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    
    /* 圆角 */
    --border-radius: 16px;
    --border-radius-sm: 8px;
    
    /* 气泡提示 */
    --toast-bg: rgba(0, 0, 0, 0.8);
    --toast-text: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    background-color: var(--white);
    box-shadow: var(--shadow-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 18px 0;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
}

.tabs {
    display: flex;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 16px;
    text-align: center;
    border: none;
    background-color: transparent;
    font-size: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.tab-content {
    display: none;
    padding: 20px;
    flex: 1;
}

.tab-content.active {
    display: block;
}

/* 今日页面样式 */
.status-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 24px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.status-title {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 500;
}

.toggle-btn {
    padding: 16px 40px;
    font-size: 18px;
    border: none;
    border-radius: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    min-width: 140px;
}

.toggle-btn.available {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
}

.toggle-btn.reserved {
    background: linear-gradient(135deg, rgba(255, 77, 79, 0.2), rgba(220, 53, 69, 0.3));
    color: var(--danger-color);
    border: 1px solid rgba(255, 77, 79, 0.3);
}

.toggle-btn:active {
    transform: scale(0.98);
}

.calendar-section {
    margin-top: 30px;
}

.calendar-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

/* 一周日历样式 - 手机端优化 */
.week-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.day-item {
    text-align: center;
    padding: 12px 4px;
    border-radius: var(--border-radius-sm);
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.day-item:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.day-item .date {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.day-item .day {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}

/* 今天突出显示 */
.day-item.today {
    background-color: var(--primary-light) !important;
    border: 2px solid var(--primary-color);
}

.day-item.today .date {
    color: var(--primary-color);
}

.day-item.available {
    background-color: var(--white);
}

.day-item.reserved {
    background-color: rgba(255, 77, 79, 0.08);
    border: 1px solid rgba(255, 77, 79, 0.3);
}

.day-item.reserved .date {
    color: var(--danger-color);
}

/* 周末日期样式 */
.day-item.weekend {
    position: relative;
    overflow: hidden;
    animation: weekend-pulse 2s ease-in-out infinite;
}

.day-item.weekend .date {
    color: var(--danger-color) !important;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(255, 77, 79, 0.3);
}

.day-item.weekend .day {
    color: var(--danger-color) !important;
    font-weight: bold;
}

/* 月日历中周末日期样式 */
.calendar-day.weekend {
    position: relative;
    overflow: hidden;
    animation: weekend-pulse 2s ease-in-out infinite;
}

.calendar-day.weekend {
    color: var(--danger-color) !important;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255, 77, 79, 0.3);
}

.calendar-day.weekend.other-month {
    color: rgba(220, 53, 69, 0.5) !important;
}

/* 周末脉冲动画 */
@keyframes weekend-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 79, 0);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 5px rgba(255, 77, 79, 0.1);
    }
}

/* 未来一周预约情况展开/折叠样式 */
.week-calendar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    padding: 12px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.week-calendar-toggle:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.week-calendar-toggle.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.week-calendar-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.more-dates {
    display: none;
    margin-top: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.more-dates.expanded {
    display: block;
}

/* 额外日期的网格布局 */
.more-dates-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.more-dates-grid .day-item {
    margin-bottom: 8px;
}

/* 月日历样式 */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
}

.calendar-nav {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.calendar-nav:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.current-month {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 日历容器 */
.calendar-container {
    margin-bottom: 20px;
}

/* 星期标题行 */
.weekday-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.weekday {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 10px 0;
    font-weight: 600;
}

/* 日期网格 - 确保7列布局 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    width: 100%;
}

.calendar-day {
    text-align: center;
    padding: 14px 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    background-color: var(--white);
    border: 1px solid transparent;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.calendar-day:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
}

.calendar-day.other-month {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* 选中日期修复 - 确保文字可见 */
/* 空闲日期被选中时的样式 */
.calendar-day.selected {
    background-color: var(--danger-color) !important;
    color: var(--white) !important;
    border-color: var(--danger-color);
}

/* 已预约日期被选中时的样式（用于取消操作） */
.calendar-day.reserved.selected {
    background-color: var(--warning-color) !important;
    color: var(--white) !important;
    border-color: var(--warning-color);
}

/* 今天日期突出显示，与充电状态不冲突 */
.calendar-day.today {
    background-color: var(--primary-light) !important;
    border: 2px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
}

/* 今天且选中状态 */
.calendar-day.today.selected {
    background-color: var(--danger-color) !important;
    color: var(--white) !important;
}

/* 今天已预约且选中状态 */
.calendar-day.today.reserved.selected {
    background-color: var(--warning-color) !important;
    color: var(--white) !important;
}

/* 今天日期标记 */
.today-marker {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

/* 为日历日添加相对定位以便标记定位 */
.calendar-day {
    position: relative;
}

.calendar-day.available {
    background-color: var(--white);
}

.calendar-day.reserved {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border-color: rgba(220, 53, 69, 0.3);
}

/* 不可点击的日期 */
.calendar-day.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* 触摸反馈样式 */
.calendar-day.touched {
    background-color: var(--primary-light) !important;
    border-color: var(--primary-color) !important;
}

/* 移动端点击优化 */
.calendar-day,
.day-item {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    user-select: none;
}

/* 修复选择状态移除后的样式 */
.calendar-day:not(.selected) {
    background-color: var(--white) !important;
    color: inherit !important;
    border-color: transparent !important;
}

.calendar-day.available:not(.selected):not(.today) {
    background-color: var(--white) !important;
    color: var(--text-primary) !important;
}

.calendar-day.reserved:not(.selected):not(.today) {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: var(--danger-color) !important;
    border: 1px solid rgba(220, 53, 69, 0.3) !important;
}

/* 按钮样式 */
.confirm-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 25px;
    box-shadow: var(--shadow-sm);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.confirm-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.confirm-btn:disabled {
    background: linear-gradient(135deg, var(--text-light), #bfbfbf);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 底部版权信息 - 移到最底部 */
.footer {
    text-align: center;
    padding: 15px;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    background-color: var(--light-bg);
}

/* 气泡提示 - 底部悬浮设计 */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    max-width: 90%;
}

.toast {
    padding: 12px 20px;
    background-color: var(--toast-bg);
    color: var(--toast-text);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: auto;
    user-select: none;
    /* 固定宽度，防止随文本内容变化 */
    min-width: 200px;
    max-width: 300px;
    width: auto;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 动画效果 */
@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.toast.fade-in {
    animation: toastFadeIn 0.3s ease forwards;
}

.toast.fade-out {
    animation: toastFadeOut 0.3s ease forwards;
}

/* 清空数据按钮样式 */
.clear-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background-color: var(--danger-color);
    color: var(--white);
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 999;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.clear-btn:hover {
    background-color: #ff7875;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 77, 79, 0.2);
}

.clear-btn:active {
    transform: translateY(0);
}

/* 确认弹窗样式 */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.confirm-modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    text-align: center;
}

.modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 25px;
    text-align: center;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.modal-btn.cancel {
    background-color: var(--gray-bg);
    color: var(--text-primary);
}

.modal-btn.cancel:hover {
    background-color: #e8e8e8;
}

.modal-btn.confirm {
    background-color: var(--danger-color);
    color: var(--white);
}

.modal-btn.confirm:hover {
    background-color: #ff7875;
}

/* 响应式优化 */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .week-calendar {
        gap: 8px;
    }
    
    .day-item {
        padding: 12px 5px;
    }
    
    .day-item .date {
        font-size: 14px;
    }
    
    .calendar-day {
        padding: 10px 5px;
        font-size: 13px;
    }
    
    .clear-btn {
        padding: 10px 16px;
        font-size: 13px;
        bottom: 15px;
        right: 15px;
    }
    
    .modal-content {
        padding: 25px 20px;
        margin: 20px;
    }
}