/* ===== 全局reset/normalize，兼容性增强 ===== */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  box-sizing: border-box;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1.5;
  font-family: 'Segoe UI', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
  background: var(--secondary-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
ol, ul {
  list-style: none;
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  border: 0;
  max-width: 100%;
  height: auto;
  display: block;
}
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}
/* ===== END reset/normalize ===== */

:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f6fa;
    --text-color: #2c3e50;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--secondary-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wrapper {
    display: flex;
    width: 100vw;
    min-height: 100vh;
    align-items: stretch;
    margin-top: 0 !important;
    background: var(--secondary-color);
}

/* 侧边栏样式 */
#sidebar {
    flex: 0 0 var(--sidebar-width);
    min-width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
    width: var(--sidebar-width) !important;
    background: white;
    color: var(--text-color);
    transition: none !important;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    margin-top: 0 !important;
    height: 100vh;
    overflow-y: auto;
}

#sidebar.active {
    min-width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width) !important;
    width: var(--sidebar-width) !important;
    text-align: left !important;
}

#sidebar.active .sidebar-header h3 {
    display: none;
}

#sidebar.active .sidebar-header strong {
    display: block;
}

#sidebar ul li a {
    padding: 15px;
    display: block;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
}

#sidebar ul li a:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

#sidebar ul li.active > a {
    background: var(--primary-color);
    color: white;
}

#sidebar ul li a i {
    margin-right: 10px;
    display: inline-block;
    font-size: 1.2em;
    margin-bottom: 0;
}

#sidebar ul li a span {
    display: inline;
}

.sidebar-header {
    padding: 20px;
    background: var(--primary-color);
    color: white;
}

/* 内容区域样式 */
#content {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
    margin-top: 0 !important;
    background: var(--secondary-color);
    display: flex;
    flex-direction: column;
}

/* 会议室卡片样式 */
.room-card {
    min-height: 220px;
    max-height: 220px;
    height: 220px;
    min-width: 300px;
    max-width: 366px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    margin-bottom: 24px;
    border: 2px solid transparent;
}

.room-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 8px 24px rgba(74,144,226,0.15);
    z-index: 2;
}

.room-card .card-body {
    padding: 20px;
}

.room-status {
    padding: 5px 16px;
    border-radius: 16px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    opacity: 0.92;
    animation: fadeIn 0.5s;
}

.status-available {
    background: linear-gradient(90deg, #00c97b 0%, #00a854 100%);
}

.status-occupied {
    background: linear-gradient(90deg, #ff5858 0%, #f5222d 100%);
}

.status-pending {
    background: linear-gradient(90deg, #4a90e2 0%, #1890ff 100%);
}

/* 表单样式 */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

.btn-primary, .btn-info {
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover, .btn-info:hover {
    background: #357abd;
    transform: scale(1.04);
}

.btn-primary:active, .btn-info:active {
    transform: scale(0.98);
}

/* 响应式设计 */
@media (max-width: 992px) {
    #sidebar {
        min-width: 180px !important;
        max-width: 180px !important;
        width: 180px !important;
    }
}

@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
        width: 100vw;
    }
    #sidebar {
        position: relative;
        width: 100vw !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        height: auto;
        box-shadow: none;
    }
    #content {
        width: 100vw;
        min-width: 0;
    }
}

/* 顶部banner优化 */
#main-banner {
    background: #e6f0fa !important; /* 浅蓝色 */
    margin-bottom: 0 !important;
    border-radius: 0;
    box-shadow: 0 2px 8px -4px rgba(37,99,235,0.06), 0 1px 0 #e5e7eb;
    border-bottom: 1px solid #cfd8dc; /* 柔和分割线 */
    position: relative;
}

#main-banner h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e40af;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.room-card[data-status="available"] {
    border-color: #00c97b;
}

.room-card[data-status="occupied"] {
    border-color: #ff5858;
}

.room-card[data-status="pending"] {
    border-color: #4a90e2;
}

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

.room-card .ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 auto;
        width: 33.33333333%;
    }
}

@media (min-width: 768px) {
    .row {
        margin-left: -12px;
        margin-right: -12px;
    }
}

.banner-user-link {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    color: #1e40af;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(30,64,175,0.1);
}

.banner-user-link:hover {
    background: rgba(255,255,255,0.95);
    color: #1e3a8a;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(30,64,175,0.15);
}

.btn-same {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.375rem;
}

.btn-outline-primary.btn-same:hover, .btn-outline-primary.btn-same:focus {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.btn-outline-danger.btn-same:hover, .btn-outline-danger.btn-same:focus {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-outline-primary,
.btn-outline-danger {
    transition: all 0.15s ease-in-out;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.25);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.25);
}

.container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem;
    padding-right: 1rem;
    margin: 0 auto;
    box-sizing: border-box;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.manage-users-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.manage-users-table th, .manage-users-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.manage-users-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.manage-users-table tbody tr {
    border-bottom: 1px solid #f1f3f4;
}

.manage-users-table tbody tr:hover {
    background: #f8f9fa;
}

.user-role-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-role-badge.bg-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
}

.user-role-badge.bg-warning {
    background: linear-gradient(135deg, #ffd93d 0%, #f6c90e 100%) !important;
}

.user-role-badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
}

/* ===== 浏览器兼容性修复 ===== */

/* IE 11 兼容性 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .wrapper {
        display: -ms-flexbox;
        -ms-flex-direction: row;
    }
    
    #content {
        -ms-flex: 1;
    }
    
    .room-card {
        display: -ms-flexbox;
        -ms-flex-direction: column;
    }
}

/* Safari 兼容性 */
@supports (-webkit-appearance: none) {
    .form-control {
        -webkit-appearance: none;
        border-radius: 0.375rem;
    }
    
    .btn {
        -webkit-appearance: none;
        border-radius: 0.375rem;
    }
}

/* Firefox 兼容性 */
@-moz-document url-prefix() {
    .room-card {
        transform: none;
    }
    
    .room-card:hover {
        transform: translateY(-6px);
    }
}

/* 移动端浏览器兼容性 */
@media (max-width: 576px) {
    /* 修复小屏幕上的布局问题 */
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .room-card {
        min-width: auto;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* 修复登录页面在小屏幕上的显示 */
    .d-flex.justify-content-center.align-items-center {
        min-height: 50vh;
        padding: 1rem;
    }
    
    .card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
        border-radius: 12px !important;
    }
    
    /* 修复侧边栏在小屏幕上的显示 */
    #sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
    }
    
    #sidebar.active {
        left: 0;
    }
    
    #content {
        margin-left: 0;
        width: 100%;
    }
}

/* 修复特定浏览器的字体渲染问题 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 修复 flexbox 在不同浏览器中的表现 */
.wrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
}

#content {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
}

/* 修复按钮在不同浏览器中的显示 */
.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* 修复表单控件在不同浏览器中的显示 */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* 修复卡片在不同浏览器中的显示 */
.card {
    position: relative;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
}

/* 修复登录页面特定问题 */
.login-container {
    min-height: 100vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 修复移动端触摸问题 */
@media (hover: none) and (pointer: coarse) {
    .room-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
}

/* 修复高分辨率屏幕显示 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .room-card {
        border-width: 0.5px;
    }
    
    .form-control {
        border-width: 0.5px;
    }
}

/* 修复打印样式 */
@media print {
    #sidebar {
        display: none;
    }
    
    #content {
        margin-left: 0;
        width: 100%;
    }
    
    .room-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
} 