:root {
    --primary: #2d2d2d;
    --primary-dark: #1a1a1a;
    --accent: #a18cd1;
    --danger: #ff6b6b;
    --success: #51cf66;
    --warning: #ffd43b;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.18);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.75);
}

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

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    background: #1a1a1a;
}

/* 背景渐变与气泡 */
.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 50%, #2d2d2d 100%);
}

.bg-bubbles {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-bubbles span {
    position: absolute;
    bottom: -80px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    animation: rise 20s infinite ease-in;
}

.bg-bubbles span:nth-child(1) { left: 10%; width: 60px; height: 60px; animation-duration: 18s; animation-delay: 0s; }
.bg-bubbles span:nth-child(2) { left: 30%; width: 100px; height: 100px; animation-duration: 24s; animation-delay: 3s; }
.bg-bubbles span:nth-child(3) { left: 55%; width: 50px; height: 50px; animation-duration: 16s; animation-delay: 6s; }
.bg-bubbles span:nth-child(4) { left: 75%; width: 90px; height: 90px; animation-duration: 22s; animation-delay: 1s; }
.bg-bubbles span:nth-child(5) { left: 90%; width: 70px; height: 70px; animation-duration: 19s; animation-delay: 4s; }

@keyframes rise {
    0% { transform: translateY(0) scale(1); opacity: 0.6; }
    100% { transform: translateY(-120vh) scale(1.4); opacity: 0; }
}

/* 玻璃卡片 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: 20px;
}

/* H5 首页 */
.h5-page {
    padding: 16px;
}

.h5-main {
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 40px;
    overflow-x: hidden;
}

.welcome-card {
    margin-bottom: 16px;
    padding: 24px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand.center {
    flex-direction: column;
    text-align: center;
    gap: 10px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
}

.brand-logo.small {
    width: 44px;
    height: 44px;
    font-size: 18px;
    background: rgba(0, 0, 0, 0.25);
}

.brand-logo.small img {
    border-radius: 10px;
}

.brand-logo.login-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
}

.brand-logo.login-logo img {
    border-radius: 12px;
}

.brand-info h1 {
    font-size: 18px;
    font-weight: 600;
}

.brand-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 首页欢迎区紧凑布局 */
.welcome-brand {
    align-items: center;
}

.welcome-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
}

.welcome-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.welcome-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.welcome-info h1 {
    font-size: 16px;
    font-weight: 600;
}

.welcome-info h2 {
    font-size: 22px;
    font-weight: 700;
}

.welcome-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 0;
}

.brand-info a, .h5-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.brand-info a:hover, .h5-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.welcome-text {
    margin-top: 18px;
}

.welcome-text h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.welcome-text p {
    font-size: 14px;
    color: var(--text-muted);
}

/* 用户信息卡片 */
.user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px 20px;
}

.user-avatar {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.user-avatar img,
.user-avatar-img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

#userCardMount:empty {
    display: none;
}

/* 默认头像：黑底 + 白色「宠」字 + 灰色外圈（图2样式） */
.user-avatar-fallback {
    display: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #ffffff;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    border: 3px solid rgba(255, 255, 255, 0.32);
    box-sizing: border-box;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
}

.user-tip {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 表单 */
.form-card {
    padding: 22px 20px;
    overflow: hidden;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.required {
    color: var(--danger);
}

input, select, textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    outline: none;
    transition: all 0.25s ease;
    min-width: 0;
}

/* 移动端 datetime-local 默认过宽，强制与表单其他字段一致 */
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
    display: block;
    width: 100%;
    max-width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

input:focus, select:focus, textarea:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

select option {
    background: #2d2d2d;
    color: #fff;
}

textarea {
    resize: vertical;
    min-height: 70px;
}

/* 事由标签 */
.reason-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.reason-tags span {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
}

.reason-tags span.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* 人数步进器 */
.number-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.number-stepper button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
}

.number-stepper input {
    flex: 1;
    text-align: center;
    padding: 8px;
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    padding: 15px;
    margin-top: 8px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.h5-footer {
    text-align: center;
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 12px;
}

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 340px;
    width: 100%;
    text-align: center;
    padding: 32px 24px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-close:active {
    background: rgba(255, 255, 255, 0.22);
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #2b8a3e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 6px 18px rgba(81, 207, 102, 0.35);
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 22px;
}

/* 管理后台 */
.admin-page {
    min-height: 100vh;
    padding: 0;
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 20px 20px;
    padding: 16px 24px;
    margin-bottom: 20px;
}

.admin-actions {
    display: flex;
    gap: 12px;
}

.btn-outline, .btn-primary, .btn-mini {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-outline {
    padding: 9px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
    padding: 9px 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.btn-mini {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-mini.danger {
    color: var(--danger);
    border-color: rgba(255, 107, 107, 0.3);
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.admin-main.center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 36px 30px;
}

.login-form {
    margin-top: 24px;
}

.login-tip {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
    padding: 22px 16px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 图表区 */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.chart-card {
    padding: 20px;
}

.chart-card h3 {
    font-size: 15px;
    margin-bottom: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.chart-wrap {
    position: relative;
    width: 100%;
    overflow-x: auto;
}

.chart-wrap canvas {
    display: block;
    max-width: 100%;
}

/* 筛选 */
.filter-card {
    margin-bottom: 16px;
    padding: 16px 20px;
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-row input, .filter-row select {
    width: auto;
    min-width: 140px;
    flex: 1;
}

/* 表格 */
.table-card {
    padding: 0;
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th, .data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.data-table th {
    font-weight: 500;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.data-table small {
    color: var(--text-muted);
    font-size: 12px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.badge-warning { background: rgba(255, 212, 59, 0.18); color: var(--warning); }
.badge-success { background: rgba(81, 207, 102, 0.18); color: var(--success); }
.badge-info { background: rgba(255, 255, 255, 0.12); color: #fff; }
.badge-muted { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

.action-btns {
    display: flex;
    gap: 6px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.pagination span {
    color: var(--text-muted);
    font-size: 13px;
    margin-right: 8px;
}

.pagination button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
}

.pagination button.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
}

/* 响应式 */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .admin-header {
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .filter-row input, .filter-row select {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 会议室开关 */
.switch-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    transition: 0.3s;
}

.slider:before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.switch input:checked + .slider {
    background: linear-gradient(135deg, #555, #222);
}

.switch input:checked + .slider:before {
    transform: translateX(24px);
}

.switch-label {
    font-size: 15px;
    color: var(--text-muted);
}

/* 会议室列表 */
.room-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.room-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 10px 0;
}

.room-item {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.2s ease;
}

.room-item:hover, .room-item.active {
    background: rgba(255, 255, 255, 0.16);
    border-color: #555;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.room-item.active {
    background: linear-gradient(135deg, rgba(45, 45, 45, 0.8), rgba(26, 26, 26, 0.6));
}

.room-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.room-info strong {
    font-size: 15px;
    font-weight: 600;
}

.room-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.room-item small {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

/* 会议室管理后台 */
.room-manager {
    margin-bottom: 20px;
}

.room-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.room-card {
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
}

.room-card.disabled {
    opacity: 0.55;
}

.room-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.room-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.room-card .room-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.room-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .room-form-row {
        grid-template-columns: 1fr;
    }
}

.booking-list {
    margin-top: 16px;
}

.booking-list h4 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.booking-list ul {
    list-style: none;
}

.booking-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.booking-list li span {
    color: var(--text-muted);
    font-size: 12px;
}

/* 微信基础分享缩略图：隐藏显示但保留在 DOM 中 */
.wechat-share-thumb {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 300px;
    height: 300px;
    opacity: 0;
    pointer-events: none;
}
