/* 入住人员显示样式 */
.guest-name-display {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    background: #f8f9fa;
    color: #333;
    min-height: 20px;
    display: flex;
    align-items: center;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 权限验证页面样式 */
.auth-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    background: white;
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 450px;
    width: 90%;
    text-align: center;
}

.auth-header {
    margin-bottom: 40px;
}

.auth-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.auth-header p {
    color: #666;
    font-size: 1.1rem;
}

.auth-form h3 {
    margin-bottom: 30px;
    color: #333;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.required {
    color: #dc3545;
}

.auth-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-height: 44px; /* 移动端最小触摸目标 */
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.auth-error {
    color: #dc3545;
    text-align: center;
    margin-top: 15px;
    font-size: 0.95rem;
    padding: 10px;
    background: #f8d7da;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
}

/* 主页面样式 */
.main-page {
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

header {
    margin-bottom: 40px;
    color: white;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.header-left h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info span {
    font-size: 1.1rem;
    font-weight: 500;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-height: 44px;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* 预约容器 */
.booking-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* 左侧面板 */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.calendar-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

.calendar-header h2 {
    font-size: 1.8rem;
    color: #333;
    font-weight: 600;
}

.nav-btn {
    background: #f8f9fa;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #667eea;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-width: 44px;
    min-height: 44px;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.calendar-grid {
    margin-bottom: 20px;
}

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

.calendar-weekdays div {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    padding: 10px;
    font-size: 0.9rem;
}

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

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    position: relative;
    border: 2px solid transparent;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

/* 日期标签样式 */
.date-label {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.6rem;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
    line-height: 1;
}

.partial-label {
    background: rgba(255, 193, 7, 0.9);
    color: #856404;
}

.full-label {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.calendar-day.available {
    background: #e8f5e8;
    color: #2d5a2d;
    border-color: #4caf50;
}

.calendar-day.available:hover {
    background: #4caf50;
    color: white;
    transform: scale(1.05);
}

.calendar-day.booked {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.calendar-day.booked:hover {
    background: #ffc107;
    color: #856404;
    transform: scale(1.05);
}

.calendar-day.full {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
    cursor: not-allowed;
}

.calendar-day.current {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 700;
}

.calendar-day.selected {
    background: #28a745;
    color: white;
    border-color: #28a745;
    font-weight: 700;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.calendar-day.other-month {
    color: #ccc;
    cursor: not-allowed;
    background: #f8f9fa;
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
    pointer-events: none;
}

.calendar-day.disabled {
    background: #f5f5f5;
    color: #ccc;
    border-color: #e0e0e0;
    cursor: not-allowed;
}

.calendar-legend {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    overflow-x: auto;
    padding: 5px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 2px solid;
    flex-shrink: 0;
}

.legend-color.current {
    background: #667eea;
    border-color: #667eea;
}

.legend-color.available {
    background: #e8f5e8;
    border-color: #4caf50;
}

.legend-color.selected {
    background: #28a745;
    border-color: #28a745;
}

.legend-color.booked {
    background: #fff3cd;
    border-color: #ffc107;
}

.legend-color.full {
    background: #f8d7da;
    border-color: #dc3545;
}

.legend-color.disabled {
    background: #f5f5f5;
    border-color: #e0e0e0;
}

/* 房型选择 */
.room-selection {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.room-selection h3 {
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.room-option {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    position: relative;
}

.room-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.room-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.room-option.disabled:hover {
    border-color: #dee2e6;
    transform: none;
    box-shadow: none;
}

.room-option.selected {
    border-color: #667eea;
    background: #f8f9ff;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.room-icon {
    font-size: 2rem;
    width: 60px;
    text-align: center;
}

.room-info h4 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #333;
}

.room-info p {
    color: #666;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.price {
    color: #28a745;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 右侧面板 */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.booking-form,
.booking-records {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.booking-form h3,
.booking-records h3 {
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-height: 44px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 预约记录 */
.booking-record {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.booking-record h4 {
    color: #333;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.booking-record .record-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.booking-record .record-details span {
    font-size: 0.9rem;
    color: #666;
}

.booking-record .record-actions {
    display: flex;
    gap: 10px;
}

.record-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.record-btn.view {
    background: #17a2b8;
    color: white;
}

.record-btn.cancel {
    background: #dc3545;
    color: white;
}

.record-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

/* 管理员功能 */
.admin-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.admin-section h3 {
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.admin-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.admin-btn.danger {
    background: #dc3545;
}

.admin-btn.danger:hover {
    background: #c82333;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-footer button {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.modal-footer button:first-child {
    background: #28a745;
    color: white;
}

.modal-footer button:last-child {
    background: #6c757d;
    color: white;
}

.modal-footer button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.modal-footer button:first-child:hover {
    background: #218838;
}

/* 特定按钮的绿色样式 */
#close-modal,
#cancel-success-close,
#detail-close,
#user-management-close,
#cancel-close {
    background: #28a745 !important;
    color: white !important;
}

#close-modal:hover,
#cancel-success-close:hover,
#detail-close:hover,
#user-management-close:hover,
#cancel-close:hover {
    background: #218838 !important;
}

/* 入住信息样式 */
.checkin-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    display: block !important;
}

.checkin-info h4 {
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* 用户管理样式 */
.user-management-section {
    margin-bottom: 30px;
}

.user-management-section h4 {
    margin-bottom: 20px;
    color: #333;
}

.add-user-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.user-list {
    max-height: 300px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.user-item .user-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-item .user-name {
    font-weight: 600;
    color: #333;
}

.user-item .user-email {
    font-size: 0.9rem;
    color: #666;
}

.user-item .remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.user-item .remove-btn:hover {
    background: #c82333;
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 1024px) {
    .booking-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .admin-controls {
        justify-content: center;
    }
    
    .calendar-section,
    .room-selection,
    .booking-form,
    .booking-records {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .auth-container {
        padding: 25px 15px;
        width: 95%;
        margin: 10px;
    }
    
    .auth-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .header-content {
        padding: 20px 15px;
    }
    
    .header-left h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .calendar-section,
    .room-selection,
    .search-section,
    .booking-form,
    .booking-records,
    .admin-section {
        padding: 20px 15px;
    }
    
    .calendar-header h2 {
        font-size: 1.5rem;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .calendar-weekdays div,
    .calendar-day {
        font-size: 0.9rem;
        padding: 10px 8px;
    }
    
    .room-option {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px 15px;
    }
    
    .room-icon {
        font-size: 2rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .submit-btn,
    .auth-btn {
        padding: 15px;
        font-size: 1.1rem;
    }
    
    .add-user-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-form {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
    
    .admin-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .admin-btn {
        width: 100%;
        padding: 15px;
    }
    
    .booking-record {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .record-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .record-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .auth-container {
        padding: 20px 10px;
        border-radius: 15px;
    }
    
    .auth-header h1 {
        font-size: 1.8rem;
    }
    
    .auth-header p {
        font-size: 1rem;
    }
    
    .header-content {
        padding: 15px 10px;
    }
    
    .header-left h1 {
        font-size: 1.6rem;
    }
    
    .header-left p {
        font-size: 1rem;
    }
    
    .calendar-section,
    .room-selection,
    .booking-form,
    .booking-records,
    .admin-section {
        padding: 15px 10px;
        border-radius: 15px;
    }
    
    .calendar-header h2 {
        font-size: 1.3rem;
    }
    
    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .calendar-weekdays div,
    .calendar-day {
        font-size: 0.8rem;
        padding: 8px 6px;
        min-height: 35px;
    }
    
    .calendar-legend {
        flex-direction: column;
        gap: 10px;
    }
    
    .legend-item {
        font-size: 0.9rem;
    }
    
    .room-option {
        padding: 15px 10px;
    }
    
    .room-icon {
        font-size: 1.8rem;
    }
    
    .room-info h4 {
        font-size: 1.2rem;
    }
    
    .room-info p {
        font-size: 0.9rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px;
        font-size: 16px;
    }
    
    .submit-btn,
    .auth-btn {
        padding: 12px;
        font-size: 1rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 2% auto;
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        font-size: 0.9rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .user-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .user-item .remove-btn {
        width: 100%;
    }
    
    .checkin-info {
        font-size: 0.9rem;
    }
    
    .info-item {
        margin-bottom: 8px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .nav-btn,
    .submit-btn,
    .auth-btn,
    .admin-btn,
    .logout-btn,
    .room-option,
    .calendar-day {
        min-height: 44px; /* iOS推荐的最小触摸目标 */
    }
    
    .calendar-day {
        min-width: 44px;
    }
    
    .nav-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .auth-container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: row;
        gap: 15px;
    }
    
    .booking-container {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .calendar-section,
    .room-selection {
        margin-bottom: 15px;
    }
}
