/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

body {
    background-color: #cccccc; /* 页边距外的灰色 */
    min-height: 100vh;
    font-family: 'WenQuanYiPixel', 'Courier New', Courier, monospace;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

/* 60px页边距 */
.page-margin {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 60px;
    background-color: #cccccc;
    z-index: 1;
}

.left-margin {
    left: 0;
}

.right-margin {
    right: 0;
}

/* 主容器 */
.main-container {
    position: relative;
    max-width: calc(100% - 120px); /* 减去左右边距 */
    margin: 0 60px;
    min-height: 100vh;
    z-index: 2;
    background-color: #ffffff;
}

/* 顶部区域 */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: #ffffff;
    border-bottom: 2px solid #e0e0e0;
    height: 120px;
}

/* 左侧医院标志和标题 */
.hospital-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hospital-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border: 3px solid #1e90ff;
    border-radius: 8px;
    image-rendering: pixelated;
}

.hospital-title h1 {
    color: #1e90ff;
    font-size: 2.8rem;
    font-weight: bold;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.hospital-title h2 {
    color: #666666;
    font-size: 1.1rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: scaleY(0.9);
    display: inline-block;
    line-height: 0.9;
}

/* 右侧日期和滚动屏 */
.right-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    width: 500px;
}

.date-display {
    background-color: #1e90ff;
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    align-self: flex-end;
    margin-right: 50px;
}

/* 滚动展示屏 */
.marquee-container {
    width: 350px;
    height: 50px;
    background-color: #000000;
    border: 4px solid #8b0000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin-right: 0;
}

/* 主标签页容器（蓝色区域） */
.tabs-container {
    margin: 20px;
    background-color: #1e90ff; /* 蓝色背景 */
    border-radius: 1px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.2);
    min-height: 650px;
}

/* 标签页导航 */
.main-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    background-color: #f0f8ff;
    padding: 5px;
    border-radius: 1px;
}

.tab-btn {
    flex: 1;
    padding: 15px 10px;
    border: none;
    background-color: #e0e0e0; /* 灰白色 */
    color: #666666;
    font-size: 1.3rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    border-radius: 1px;
    letter-spacing: 1px;
}

.tab-btn:hover {
    background-color: #d0d0d0;
    color: #333333;
}

.tab-btn.active {
    background-color: #ffffff; /* 选中时白色 */
    color: #1e90ff;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 内容区域 */
.tab-content {
    background-color: #ffffff; /* 内容区白色背景 */
    border-radius: 8px;
    min-height: 550px;
    position: relative;
}

.page-content {
    display: none;
    min-height: 550px;
}

.page-content.active {
    display: flex;
}

/* 左侧竖向标签 - 浅蓝色 */
.left-sidebar {
    width: 200px;
    background-color: #e6f7ff; /* 浅蓝色 */
    padding: 20px 10px;
    border-right: 2px solid #87ceeb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-btn {
    padding: 12px 15px;
    border: none;
    background-color: #f8f8f8;
    color: #666666;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.3s;
    border-radius: 2px;
    border: 2px solid #d0d0d0;
    text-align: center;
}

.sidebar-btn:hover {
    background-color: #e6f7ff;
    color: #1e90ff;
    border-color: #87ceeb;
}

.sidebar-btn.active {
    background-color: #1e90ff;
    color: #ffffff;
    font-weight: bold;
    border-color: #1e90ff;
}

/* 右侧内容区 */
.right-content {
    flex: 1;
    padding: 30px;
    background-color: #ffffff;
    min-height: 550px;
    overflow-y: auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* 表格样式 - 字体加大 */
.records-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.records-table th {
    background-color: #e6f7ff;
    color: #1e90ff;
    padding: 15px;
    text-align: left;
    border: 1px solid #87ceeb;
    font-weight: bold;
    font-size: 1.3rem;
}

.records-table td {
    padding: 15px;
    border: 1px solid #e0e0e0;
    background-color: #ffffff;
    font-size: 1.1rem;
}

.records-table tr:nth-child(even) td {
    background-color: #f8f8f8;
}

.records-table tr:hover td {
    background-color: #f0f8ff;
}

.room-link {
    color: #1e90ff;
    font-weight: bold;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
    font-size: 1.2rem;
}

.room-link:hover {
    color: #ff4500;
}

/* 药品库存网格 */
.medicine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.medicine-item {
    background-color: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s;
    text-align: center;
}

.medicine-item:hover {
    border-color: #87ceeb;
    box-shadow: 0 2px 8px rgba(135, 206, 235, 0.2);
}

.medicine-name {
    color: #1e90ff;
    font-weight: bold;
    font-size: 1.3rem;
}

.medicine-stock {
    color: #666666;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

/* 药品多选按钮样式 */
.medicine-multiselect {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 300px;
    min-height: 40px;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background-color: #ffffff;
}

/* 多选下拉菜单样式 */
.multiselect-container {
    position: relative;
    width: 200px;
}

.multiselect-display {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    background-color: white;
    min-height: 40px;
    font-size: 0.9rem;
    color: #666666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multiselect-display:hover:not([style*="pointer-events: none"]) {
    border-color: #1e90ff;
    background-color: #f8f8f8;
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 2px solid #1e90ff;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 2px;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f0f8ff;
    color: #1e90ff;
}

.dropdown-item.selected {
    background-color: #e6f7ff;
    color: #1e90ff;
    font-weight: bold;
}

.dropdown-item.selected::after {
    content: "✓";
    color: #1e90ff;
    font-weight: bold;
    margin-left: 5px;
}

/* 不同类型的不同颜色 */
.dropdown-item.medicine-type {
    border-left: 3px solid #4CAF50;
}

.dropdown-item.medicine-type.selected {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.dropdown-item.surgery-type {
    border-left: 3px solid #f44336;
}

.dropdown-item.surgery-type.selected {
    background-color: #ffebee;
    color: #c62828;
}

.dropdown-item.activity-type {
    border-left: 3px solid #2196F3;
}

.dropdown-item.activity-type.selected {
    background-color: #e3f2fd;
    color: #1565c0;
}

.medicine-option {
    padding: 6px 12px;
    border: 2px solid #cccccc;
    border-radius: 4px;
    background-color: #f8f8f8;
    color: #666666;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    min-width: 60px;
    text-align: center;
}

.medicine-option:hover:not(:disabled) {
    border-color: #1e90ff;
    color: #1e90ff;
    background-color: #f0f8ff;
}

.medicine-option.selected {
    border-color: #1e90ff;
    background-color: #1e90ff;
    color: #ffffff;
    font-weight: bold;
}

.medicine-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #e0e0e0;
    background-color: #f0f0f0;
    color: #999999;
}

.medicine-option.selected:disabled {
    background-color: #32cd32;
    border-color: #228b22;
    color: #ffffff;
}
.take-btn {
    padding: 10px 20px;
    background-color: #1e90ff;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    font-weight: bold;
}

.take-btn:hover:not(:disabled) {
    background-color: #0066cc;
    transform: translateY(-2px);
}

.take-btn.taken {
    background-color: #32cd32;
}

.take-btn:disabled {
    background-color: #cccccc;
    color: #999999;
    cursor: not-allowed;
}

/* 医嘱容器 */
.orders-container {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-exam-message {
    font-size: 1.3rem;
    color: #ff4444;
    text-align: center;
    padding: 40px;
    font-weight: bold;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
}

.order-item {
    background-color: #ffffff;
    border-left: 5px solid #1e90ff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.order-item h4 {
    color: #1e90ff;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.order-detail {
    color: #333333;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

/* 病房详情 - 调整布局 */
.patient-detail-container {
    display: flex;
    gap: 40px;
    height: 100%;
}

.patient-info-section {
    flex: 1;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    position: relative; /* 添加相对定位 */
}

.patient-image-container {
    width: 100%;
    height: 280px;
    background-color: #f0f8ff;
    border: 3px solid #87ceeb;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.patient-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    image-rendering: auto; /* 允许浏览器优化 */
    transition: opacity 0.3s ease;
    opacity: 1;
}


.clean-btn {
    background-color: #1e90ff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 20px;
}

.clean-btn:hover:not(:disabled) {
    background-color: #1e90ff;
}

.clean-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.no-treatment-message {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
    background: #f9f9f9;
    border-radius: 8px;
}
.cabinet-options {
    text-align: center;
    padding: 20px;
}

.cabinet-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* 使用和确认弹窗相同的按钮样式 */
.game-confirm-btn {
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    border: 2px solid #333;
    background: #f0f0f0;
    border-radius: 4px;
    min-width: 80px;
}

.game-confirm-btn:hover {
    background: #ddd;
    transform: translateY(-1px);
}

.game-confirm-btn:active {
    transform: translateY(0);
}

/* 对话系统样式 */
#dialogue-system {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    font-family: 'WenQuanYiPixel', 'Courier New', Courier, monospace;
}

.dialogue-container {
    position: relative;
    width: 350px;
    height: 240px;
}

.dialogue-bubble {
    position: absolute;
    color: white; /* 文字始终白色 */
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px; /* 字体更大 */
    line-height: 1.4;
    max-width: 320px;
    word-wrap: break-word;
    border: 1px solid;
    box-shadow: 0 2px 10px;
    transition: all 1s ease;
    opacity: 1;
}
/* 四个位置的具体定位和背景色变浅 */
#dialogue-pos-1 { bottom: 180px; background: rgba(185, 185, 185, 0.616); }   /* 最上面 - 最浅 */
#dialogue-pos-2 { bottom: 120px; background: rgba(74, 74, 74, 0.834); }    /* 第二行 - 中等 */
#dialogue-pos-3 { bottom: 60px; background: rgb(59, 58, 58); }     /* 第三行 - 较深 */
#dialogue-pos-4 { bottom: 0px; background: rgba(0, 0, 0, 0.9); }      /* 最下面 - 最深 */
/* 隐藏状态 */
.dialogue-bubble.hidden {
    opacity: 0;
    transform: translateY(20px);
}


.patient-image-placeholder {
    font-size: 1.3rem;
    color: #666666;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}

/* 图片加载动画 */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}
/* .patient-image-container:not(:has(.patient-image.loaded)) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
} */

/* 图片名称覆盖层 */
.patient-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 12px 15px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* 例行检查按钮在图片下方 */
.examine-section {
    width: 100%;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.examine-btn {
    padding: 12px 40px;
    background-color: #1e90ff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.2rem;
    transition: all 0.2s;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(30, 144, 255, 0.2);
}

.examine-btn:hover:not(:disabled) {
    background-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(30, 144, 255, 0.3);
}

.examine-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.examining {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}

/* 体征容器上移 - 修改为绝对定位 */
.vitals-container {
    display: none;
    flex-direction: column;
    gap: 1px;
    padding: 15px;
    background-color: #ffffff; /* 改为白色背景，与图片一致 */
    border-radius: 1px;
    border: 2px solid #a7a4a4; /* 灰色边框 */
    width: 100%;
    position: absolute; /* 使用绝对定位 */
    top: 280px; /* 精确控制与上方蓝框的距离 */
    left: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.vitals-container.show {
    display: flex;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.vital-row {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 1.1rem;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.vital-row:last-child {
    border-bottom: none;
}

.vital-label {
    width: 100px;
    color: #666666;
    font-weight: bold;
}

.vital-value {
    flex: 1;
    color: #333333;
    font-family: 'Courier New', monospace;
}

/* 治疗表单 */
.treatment-form-section {
    flex: 1;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    position: relative;
}

.treatment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.treatment-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.treatment-row:last-child {
    border-bottom: none;
}

.treatment-label {
    width: 120px;
    color: #666666;
    font-weight: bold;
    font-size: 1.1rem;
}

.treatment-options {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.checkbox-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    transform: scale(1.2);
}

.checkbox-label {
    cursor: pointer;
    user-select: none;
    font-size: 1.1rem;
}

.medicine-dropdown {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    min-width: 150px;
    background-color: #ffffff;
    transition: all 0.2s;
}

.medicine-dropdown:disabled {
    background-color: #f0f0f0;
    color: #999999;
    cursor: not-allowed;
    border-color: #d0d0d0;
}

.medicine-dropdown:focus:not(:disabled) {
    border-color: #1e90ff;
    outline: none;
    box-shadow: 0 0 5px rgba(30, 144, 255, 0.3);
}

/* 药品警告样式 */
.medicine-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #856404;
    font-size: 0.95rem;
    line-height: 1.4;
}

.medicine-warning strong {
    color: #856404;
    font-size: 1rem;
}

/* 治疗表单禁用状态 */
.treatment-form.disabled {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.treatment-form.disabled::after {
    content: "需要先取药";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 10;
}

/* 确认治疗按钮右移 */
.submit-treatment {
    margin-top: 20px;
    padding: 12px 30px;
    background-color: #1e90ff;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.1rem;
    transition: all 0.2s;
    font-weight: bold;
    position: absolute;
    right: 20px; /* 右移 */
    bottom: 20px; /* 保持底部位置 */
    box-shadow: 0 2px 4px rgba(30, 144, 255, 0.2);
}

.submit-treatment:hover:not(:disabled) {
    background-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(30, 144, 255, 0.3);
}

.submit-treatment:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 员工休息室 */
.staff-room-wrapper {
    width: 100%;
    height: 550px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
}

.staff-room-bg {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    cursor: pointer;
    image-rendering: pixelated;
    display: block;
    margin: 0 auto;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-container {
        max-width: 100%;
        margin: 0 20px;
    }
    
    .page-margin {
        display: none;
    }
    
    .right-header {
        width: 400px;
    }
    
    .marquee-container {
        width: 300px;
    }
    
    .patient-detail-container {
        flex-direction: column;
    }
    
    .patient-info-section {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 20px;
    }
    
    .hospital-header {
        flex-direction: column;
        text-align: center;
    }
    
    .hospital-title h1 {
        font-size: 2rem;
    }
    
    .hospital-title h2 {
        font-size: 0.9rem;
    }
    
    .right-header {
        width: 100%;
        align-items: center;
    }
    
    .date-display {
        margin-right: 0;
        align-self: center;
    }
    
    .marquee-container {
        width: 100%;
    }
    
    .tabs-container {
        margin: 10px;
        padding: 10px;
    }
    
    .main-tabs {
        flex-direction: column;
    }
    
    .page-content {
        flex-direction: column;
    }
    
    .left-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
    }
    
    .orders-grid {
        grid-template-columns: 1fr;
    }
    
    .staff-room-wrapper {
        height: 400px;
    }
}

