/* 组件样式文件 */

/* 侧边栏样式 */
.hospital-sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #4a5568;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.hospital-brand {
    display: flex;
    align-items: center;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #667eea;
    object-fit: cover;
}

.brand-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-text p {
    font-size: 12px;
    color: #a0aec0;
    margin: 0;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-bottom: 4px;
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #a0aec0;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 0 25px 25px 0;
    margin-right: 20px;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #fff;
    transform: translateX(4px);
}

.nav-item.active .nav-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-item.active .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #fff;
    border-radius: 0 2px 2px 0;
}

.nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 18px;
    text-align: center;
}

.nav-link span {
    flex: 1;
    font-weight: 600;
    font-size: 18px;
}

.nav-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.nav-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #48bb78;
    animation: blink 2s infinite;
}

.nav-indicator.warning {
    background: #ed8936;
}

.nav-indicator.danger {
    background: #f56565;
    animation: blink-fast 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@keyframes blink-fast {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #4a5568;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.user-avatar {
    margin-right: 12px;
}

.user-avatar img {
    border-radius: 50%;
    border: 2px solid #667eea;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #a0aec0;
    margin: 0;
    background: rgba(102, 126, 234, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.admin-link {
    margin-top: 8px;
    margin-bottom: 0;
}

.admin-link a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.2s ease;
}

.admin-link a:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.5);
    color: #5a67d8;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.admin-link a:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(102, 126, 234, 0.2);
}

/* 通用模态框基础样式，供全站复用 */
.hospital-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: none; /* 默认隐藏，显示时使用flex */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 480px;
    width: 92%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #010101;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.modal-body {
    padding: 16px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.form-row label {
    font-size: 14px;
    color: #4a5568;
}

.form-row input[type="password"] {
    padding: 8px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
}

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

.btn-primary,
.btn-secondary {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background: #5a67d8;
    color: #fff;
    border-color: #5a67d8;
}

.btn-primary:hover {
    background: #4c51bf;
    border-color: #4c51bf;
}

.btn-secondary {
    background: #edf2f7;
    color: #2d3748;
    border-color: #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.form-message {
    margin-top: 10px;
    font-size: 14px;
    color: #e53e3e; /* 默认错误红色 */
}

.password-tips {
    margin: 12px 0;
    padding: 10px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #4a5568;
}

.password-tips p {
    margin: 0 0 6px 0;
    font-weight: 500;
}

.password-tips ul {
    margin: 0;
    padding-left: 16px;
    list-style-type: disc;
}

.password-tips li {
    margin-bottom: 2px;
    line-height: 1.4;
}

/* 修改密码链接样式 - 复用admin-link样式 */
.password-link {
    margin-top: 8px;
    margin-bottom: 0;
}

.password-link a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.2s ease;
}

.password-link a:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.5);
    color: #5a67d8;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.password-link a:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(102, 126, 234, 0.2);
}

/* 侧边栏操作按钮区域 */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.shift-data-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
    border: 1px solid #667eea;
    font-weight: 500;
}

.shift-data-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

.shift-data-btn i {
    margin-right: 8px;
    font-size: 16px;
}

.logout-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #a0aec0;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
    border: 1px solid #4a5568;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.logout-btn i {
    margin-right: 8px;
    font-size: 16px;
}

/* 图标字体样式 */
.icon-dashboard::before {
    content: '📊';
}

.icon-users::before {
    content: '👥';
}

.icon-bed::before {
    content: '🛏️';
}

.icon-building::before {
    content: '🏢';
}

.icon-list::before {
    content: '📋';
}

.icon-book::before {
    content: '📖';
}

.icon-logout::before {
    content: '🚪';
}

.icon-alert::before {
    content: '⚠️';
}

.icon-alert-triangle::before {
    content: '⚠️';
}

.icon-alert-circle::before {
    content: '🔔';
}

.icon-money::before {
    content: '💰';
}

.icon-chart::before {
    content: '📊';
}

.icon-plus::before {
    content: '➕';
}

.icon-search::before {
    content: '🔍';
}

.icon-menu::before {
    content: '☰';
}

.icon-user::before {
    content: '👤';
}

.icon-lock::before {
    content: '🔒';
}

.icon-eye::before {
    content: '👁️';
}

.icon-eye-off::before {
    content: '🙈';
}

.icon-arrow-right::before {
    content: '→';
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f7fafc;
    color: #2d3748;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fff;
}

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

.form-control.error {
    border-color: #f56565;
}

.form-error {
    color: #f56565;
    font-size: 12px;
    margin-top: 4px;
}

.form-help {
    color: #718096;
    font-size: 12px;
    margin-top: 4px;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 8px;
}

.btn-group .btn {
    flex: 1;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: #667eea;
    color: #fff;
}

.badge-success {
    background: #48bb78;
    color: #fff;
}

.badge-warning {
    background: #ed8936;
    color: #fff;
}

.badge-danger {
    background: #f56565;
    color: #fff;
}

.badge-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

/* 进度条 */
.progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 1000;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2d3748;
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
}

.pagination-item {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    color: #4a5568;
    transition: all 0.2s;
    font-size: 14px;
}

.pagination-item:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.pagination-item.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 公共布局样式（未登录用户） */
.public-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.public-header .hospital-brand {
    display: flex;
    align-items: center;
}

.public-header .brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 16px;
    border: 2px solid #667eea;
}

.public-header .brand-text h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.public-header .brand-text p {
    font-size: 12px;
    color: #a0aec0;
    margin: 0;
    font-weight: 500;
}

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

.login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.login-btn:hover {
    background: transparent;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.login-btn i {
    font-size: 16px;
}

.public-content {
    flex: 1;
    background: #f5f7fa;
}

/* 公共首页样式调整 */
.public-layout .hospital-dashboard {
    padding: 20px;
    /*max-width: 1200px;*/
    margin: 0 auto;
}

.public-layout .main-content {
    margin-left: 0;
}

/* 公共页面的数据看板调整 */
.public-layout .quick-actions {
    display: none;
    /* 隐藏快速操作，因为需要登录 */
}

.public-layout .widget-header .view-all {
    display: none;
    /* 隐藏查看全部链接 */
}

/* 添加访客提示 */
.visitor-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 16px 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.visitor-notice h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.visitor-notice p {
    margin: 0 0 12px 0;
    opacity: 0.9;
    font-size: 14px;
}

.visitor-notice .notice-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.visitor-notice .btn {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.visitor-notice .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.visitor-notice .btn-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.visitor-notice .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        padding: 12px 16px;
    }

    .public-header .brand-text h1 {
        font-size: 18px;
    }

    .public-header .brand-logo {
        width: 40px;
        height: 40px;
        margin-right: 12px;
    }

    .login-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .visitor-notice {
        margin: 10px;
        padding: 12px 16px;
    }

    .visitor-notice .notice-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .public-header .hospital-brand {
        justify-content: center;
    }
}

/* 系统介绍样式 */
.system-info {
    margin-top: 30px;
    padding: 30px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.info-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.info-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.info-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 12px 0;
}

.info-card p {
    font-size: 14px;
    color: #718096;
    line-height: 1.6;
    margin: 0;
}

.contact-info {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.contact-info h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 12px 0;
}

.contact-info>p {
    font-size: 14px;
    color: #718096;
    margin: 0 0 20px 0;
}

.contact-details {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.contact-details span {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
    padding: 8px 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.contact-details span:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .info-card {
        padding: 20px;
    }

    .info-icon {
        font-size: 36px;
        margin-bottom: 12px;
    }

    .contact-info {
        padding: 20px;
    }

    .contact-details {
        flex-direction: column;
        gap: 12px;
    }
}

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

    .system-info {
        margin-top: 20px;
        padding: 20px 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hospital-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .hospital-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-header {
        padding: 20px 16px;
    }

    .brand-text h3 {
        font-size: 16px;
    }

    .nav-link {
        padding: 10px 16px;
        margin-right: 16px;
    }

    .sidebar-footer {
        padding: 16px;
    }

    .modal {
        width: 95%;
        margin: 20px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px 20px;
    }
}

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

    .btn-group {
        flex-direction: column;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .modal {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }
}