/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

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

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    color: #666;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-primary:hover {
    background: #5568d3;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

/* 主页面样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #667eea;
    font-size: 24px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0 20px;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-link:hover {
    background-color: #f0f0f0;
    color: #667eea;
}

.nav-link.active {
    background-color: #667eea;
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 250px;
}

.btn-secondary {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-secondary:hover {
    background: #5a6268;
}

.user-info {
    color: #666;
}

/* Footer样式 */
.footer {
    background: #fff;
    border-top: 1px solid #e9ecef;
    padding: 20px 0;
    margin-top: 40px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* 搜索容器 */
.search-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-container .search-input {
    flex: 1;
    max-width: 400px;
}

/* 主容器 */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 20px;
}

.sidebar {
    width: 200px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.floor-list {
    list-style: none;
}

.floor-list li {
    padding: 10px;
    margin-bottom: 5px;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.floor-list li:hover {
    background: #e9ecef;
}

.floor-list li.active {
    background: #667eea;
    color: white;
}

.content-area {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.zone-selector {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.zone-selector h2 {
    font-size: 18px;
    margin-bottom: 15px;
}

.zone-buttons {
    display: flex;
    gap: 10px;
}

.zone-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.zone-btn:hover {
    background: #e9ecef;
}

.zone-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 房间网格 */
.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.room-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
    background: white;
}

.room-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.room-code {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.room-type {
    padding: 4px 8px;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 12px;
}

.room-prices {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    padding: 0;
}

.price-item {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.monthly-price {
    border-left: 3px solid #667eea;
    color: #667eea;
}

.daily-price {
    border-left: 3px solid #f5576c;
    color: #f5576c;
}

.room-stats {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.room-beds {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.bed-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 3px solid #ccc;
    border-radius: 8px;
    padding: 6px;
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.bed-group:hover {
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.bed-item {
    padding: 12px;
    border-radius: 5px;
    text-align: center;
    font-size: 13px;
    position: relative;
    min-height: 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s;
    border: 2px solid;
}

.bed-item.upper {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1e9f1 100%);
    border-color: #b8dce8;
    margin-bottom: 3px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}

.bed-item.upper:hover {
    background: linear-gradient(135deg, #d8eef8 0%, #c1e3f1 100%);
    border-color: #8cc8e8;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.bed-item.lower {
    background: linear-gradient(135deg, #f0f8f0 0%, #e0f0e0 100%);
    border-color: #c8e0c8;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bed-item.lower:hover {
    background: linear-gradient(135deg, #e0f4e0 0%, #d0e8d0 100%);
    border-color: #a8d0a8;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.bed-item.upper.occupied {
    background: linear-gradient(135deg, #ffe8e8 0%, #ffd1d1 100%);
    border-color: #e74c3c;
    color: #c0392b;
}

.bed-item.upper.occupied:hover {
    background: linear-gradient(135deg, #ffd8d8 0%, #ffb8b8 100%);
    border-color: #c0392b;
    box-shadow: 0 4px 8px rgba(192, 57, 43, 0.3);
    transform: translateY(-2px);
}

.bed-item.lower.occupied {
    background: linear-gradient(135deg, #ffe0e0 0%, #ffc8c8 100%);
    border-color: #e74c3c;
    color: #c0392b;
}

.bed-item.lower.occupied:hover {
    background: linear-gradient(135deg, #ffd0d0 0%, #ffb0b0 100%);
    border-color: #c0392b;
    box-shadow: 0 3px 6px rgba(192, 57, 43, 0.3);
    transform: translateY(-1px);
}

.bed-item.upper.available {
    background: linear-gradient(135deg, #e8f8e8 0%, #d1f0d1 100%);
    border-color: #27ae60;
    color: #229954;
}

.bed-item.upper.available:hover {
    background: linear-gradient(135deg, #d4f4d4 0%, #b8e8b8 100%);
    border-color: #229954;
    box-shadow: 0 4px 8px rgba(34, 153, 84, 0.3);
    transform: translateY(-2px);
}

.bed-item.lower.available {
    background: linear-gradient(135deg, #f0f8f0 0%, #e0f0e0 100%);
    border-color: #27ae60;
    color: #229954;
}

.bed-item.lower.available:hover {
    background: linear-gradient(135deg, #e0f4e0 0%, #c8e8c8 100%);
    border-color: #229954;
    box-shadow: 0 3px 6px rgba(34, 153, 84, 0.3);
    transform: translateY(-1px);
}

/* 入住信息显示区域 */
.checkin-info-display {
    margin-top: 20px;
}

.checkin-info-display .form-group {
    margin-bottom: 15px;
}

/* 只读输入框样式 - 全站统一 */
input[readonly],
textarea[readonly] {
    background-color: #f3f4f6 !important;
    border: 1px dashed #9ca3af !important;
    color: #4b5563 !important;
    cursor: not-allowed !important;
}

input[readonly]:hover,
textarea[readonly]:hover {
    background-color: #e5e7eb !important;
    border-color: #9ca3af !important;
}

input[readonly]:focus,
textarea[readonly]:focus {
    outline: none !important;
    border-color: #9ca3af !important;
    box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2) !important;
    background-color: #e5e7eb !important;
}

input[readonly]::placeholder,
textarea[readonly]::placeholder {
    color: #9ca3af !important;
}

.bed-number {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
}

.bed-position {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* 退房弹窗紧凑布局 */
.checkout-modal-content {
    max-width: 720px;
    max-height: 85vh;
}

.checkout-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

.checkout-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 14px 16px;
}

.checkout-section-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #495057;
    font-weight: 600;
    padding-bottom: 6px;
    border-bottom: 1px solid #dee2e6;
}

.checkout-info-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.checkout-info-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.checkout-info-item .label {
    color: #6c757d;
    flex-shrink: 0;
}

.checkout-info-item .value {
    color: #212529;
    font-weight: 500;
}

.checkout-info-item .value.amount {
    color: #e74c3c;
    font-weight: 600;
}

.checkout-actions-section {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
}

.checkout-form-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkout-form-row label {
    font-size: 13px;
    color: #495057;
    white-space: nowrap;
}

.checkout-form-row input[type="date"],
.checkout-form-row input[type="text"] {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    min-width: 140px;
}

.checkout-form-row input[type="text"] {
    min-width: 200px;
}

.checkout-form-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.checkout-form-actions .btn-secondary,
.checkout-form-actions .btn-primary {
    min-width: 80px;
    overflow: visible;
    text-overflow: clip;
}

#checkoutOrderSection.hidden {
    display: none;
}

/* 房间详情样式 */
.room-details {
    margin-top: 20px;
}

.bed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.bed-group-detail {
    display: flex;
    flex-direction: column;
    gap: 5px;
    border: 3px solid #ccc;
    border-radius: 10px;
    padding: 10px;
    background: #f0f0f0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
    transition: all 0.3s;
}

.bed-group-detail:hover {
    border-color: #667eea;
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

.bed-card-detail {
    border-radius: 6px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    min-height: 70px;
    border: 2px solid;
}

.bed-card-detail.upper {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1e9f1 100%);
    border-color: #b8dce8;
    margin-bottom: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.bed-card-detail.lower {
    background: linear-gradient(135deg, #f0f8f0 0%, #e0f0e0 100%);
    border-color: #c8e0c8;
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}

.bed-card-detail.upper.occupied {
    background: linear-gradient(135deg, #ffe8e8 0%, #ffd1d1 100%);
    border-color: #e74c3c;
}

.bed-card-detail.lower.occupied {
    background: linear-gradient(135deg, #ffe0e0 0%, #ffc8c8 100%);
    border-color: #e74c3c;
}

.bed-card-detail.upper.available {
    background: linear-gradient(135deg, #e8f8e8 0%, #d1f0d1 100%);
    border-color: #27ae60;
    cursor: pointer;
}

.bed-card-detail.lower.available {
    background: linear-gradient(135deg, #f0f8f0 0%, #e0f0e0 100%);
    border-color: #27ae60;
    cursor: pointer;
}

.bed-card-detail.available:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.bed-info {
    flex: 1;
}

.bed-info h4 {
    margin-bottom: 5px;
}

.bed-info p {
    margin: 3px 0;
    font-size: 14px;
    color: #666;
}

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

/* 价格显示样式 */
.price-display {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.price-display .price-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 15px;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
}

.price-display .monthly-price {
    border-left: 4px solid #667eea;
    color: #667eea;
}

.price-display .daily-price {
    border-left: 4px solid #f5576c;
    color: #f5576c;
}

/* 入住表单样式 */
.checkin-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.required {
    color: #e74c3c;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* 模态框中的按钮不应该占据100%宽度 */
.form-actions .btn-primary,
.form-actions .btn-secondary {
    width: auto;
    min-width: 100px;
    flex: 0 1 auto;
}

/* 搜索结果样式 */
.search-results {
    margin-top: 20px;
}

.search-result-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-info h4 {
    margin-bottom: 5px;
}

.search-result-info p {
    margin: 3px 0;
    font-size: 14px;
    color: #666;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .search-input {
        width: 100%;
    }
    
    .rooms-grid {
        grid-template-columns: 1fr;
    }
    
    .room-beds {
        grid-template-columns: 1fr;
    }
    
    .bed-grid {
        grid-template-columns: 1fr;
    }
}
