/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 页面显示控制 */
.page {
    display: block;
}

.page.hidden {
    display: none;
}

.content-section.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

/* 选项卡样式 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #f5f7fa;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 36px;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 120px;
    background-color: white;
    border: 1px solid #eee;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    margin-top: 5px;
}

.dropdown-content a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

.dropdown-content a:hover {
    background-color: #f5f7fa;
}

.dropdown-menu {
    position: fixed;
    min-width: 120px;
    background-color: white;
    border: 1px solid #eee;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

.dropdown-menu a:hover {
    background-color: #f5f7fa;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab-btn:hover {
    background-color: #e8eaed;
}

.tab-btn.active {
    background-color: #409eff;
    color: white;
}

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

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

.login-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.login-link a {
    color: #409EFF;
    text-decoration: none;
}

.login-link a:hover {
    text-decoration: underline;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #409EFF;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.15);
}

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

.input-with-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-buttons input {
    flex: 1;
}

.input-buttons {
    display: flex;
    gap: 4px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .input-with-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-buttons {
        justify-content: flex-start;
    }
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background-color: #409EFF;
    color: white;
}

.btn-primary:hover {
    background-color: #66b1ff;
}

.btn-secondary {
    background-color: #909399;
    color: white;
}

.btn-secondary:hover {
    background-color: #a6a9ad;
}

.btn-info {
    background-color: #409EFF;
    color: white;
}

.btn-info:hover {
    background-color: #66b1ff;
}

.btn-filter {
    background-color: #f0f0f0;
    color: #606266;
    border: 1px solid #dcdfe6;
}

.btn-filter:hover {
    background-color: #e0e0e0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-warning {
    background-color: #E6A23C;
    color: white;
}

.btn-warning:hover {
    background-color: #f0b85a;
}

.btn-danger {
    background-color: #F56C6C;
    color: white;
}

.btn-danger:hover {
    background-color: #f88a8a;
}

/* 主界面布局 */
#mainPage {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 240px;
    background-color: #304156;
    color: white;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-header {
    padding: 20px;
    background-color: #263445;
    border-bottom: 1px solid #1f2d3d;
}

.sidebar-header h2 {
    font-size: 18px;
    color: white;
    text-align: center;
}

.sidebar-icon-wrapper {
    margin-bottom: 10px;
    text-align: center;
}

.sidebar-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
}

.sidebar-header.has-icon {
    text-align: center;
}

.sidebar-header.has-icon h2 {
    margin-top: 10px;
    font-size: 16px;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    padding: 10px 0;
}

.menu-item {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: #263445;
}

.menu-item.active {
    background-color: #1890ff;
}

.menu-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 20px;
    background-color: #263445;
    border-top: 1px solid #1f2d3d;
}

.user-info {
    margin-bottom: 15px;
    color: #bfcbd9;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 20px;
    transition: margin-left 0.3s;
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 101;
    background: #409EFF;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 20px;
    cursor: pointer;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 24px;
    color: #303133;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 0 1 300px;
    min-width: 150px;
    padding: 10px 16px;
    font-size: 14px;
    border: 2px solid #e8ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 42px;
    line-height: 22px;
    box-sizing: border-box;
}

.search-bar input:focus {
    border-color: #409EFF;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.15);
    outline: none;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.stat-card.patient-card {
    padding: 20px;
}

.patient-card-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    flex-shrink: 0;
}

.total-patient-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.patient-card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid #f0f0f0;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #303133;
}

.stat-label {
    font-size: 14px;
    color: #909399;
}

.patient-stats-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.detail-value {
    font-weight: 600;
    color: #4CAF50;
    font-size: 16px;
}

.detail-label {
    color: #909399;
}

/* 内容卡片 */
.content-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.content-card h3 {
    margin-bottom: 15px;
    color: #303133;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #EBEEF5;
}

.data-table th {
    background-color: #F5F7FA;
    font-weight: 600;
    color: #606266;
}

.data-table tr:hover {
    background-color: #F5F7FA;
}

/* 分页 */
.pagination {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.pagination .btn {
    min-width: 80px;
}

/* 弹窗样式 */
.modal, .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 10px;
    overflow-y: auto;
}

.modal.hidden {
    display: none;
}

.modal-content, .modal-dialog {
    background: white;
    border-radius: 10px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10000;
}

/* 收藏模态框特殊样式 - 基础样式 */
#collectionModal {
    /* 保持基础样式，主要靠JS动态设置 */
}

#collectionModal .modal-content {
    /* 保持基础样式，主要靠JS动态设置 */
}

/* 模板类模态窗的特殊样式 */
.modal-content.template-modal {
    max-width: 900px;
}

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

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

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #909399;
    line-height: 1;
}

.close-btn:hover {
    color: #409EFF;
}

.modal-body {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
    max-height: 65vh;
}

/* 模板选择器的响应式布局 */
.modal-body.template-layout {
    display: flex;
    flex-direction: row;
    height: 400px;
    gap: 0;
    padding: 10px;
}

.template-categories {
    width: 25%;
    min-width: 120px;
    flex-shrink: 0;
}

.template-projects {
    width: 25%;
    min-width: 120px;
    flex-shrink: 0;
}

.template-contents {
    flex: 1;
    min-width: 0;
}

/* 桌面端样式优化 */
@media (min-width: 768px) {
    .template-categories {
        width: 25% !important;
        min-width: 150px;
    }
    
    .template-projects {
        width: 25% !important;
        min-width: 150px;
    }
}

/* 移动端左右布局 */
@media (max-width: 767px) {
    .modal, .modal-overlay {
        padding: 5px;
        z-index: 9999 !important;
    }
    
    .modal-content, .modal-dialog {
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .modal-content.template-modal {
        max-width: 100%;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .modal-body {
        padding: 10px;
    }
    
    .modal-body.template-layout {
        height: 50vh;
        min-height: 300px;
    }
    
    .modal-footer {
        padding: 12px 15px;
    }
    
    .template-categories, .template-projects, .template-contents {
        border-right: 1px solid #eee;
        border-bottom: none;
    }
    
    .template-categories:last-child,
    .template-projects:last-child,
    .template-contents:last-child {
        border-right: none;
    }
    
    /* 小屏幕上进一步缩小各区域宽度 */
    .template-categories {
        width: 30%;
        min-width: 100px;
    }
    
    .template-projects {
        width: 35%;
        min-width: 100px;
    }
    
    .template-contents {
        width: 35%;
    }
    
    /* 调整字体大小适应小屏幕 */
    .category-item, .project-item, .template-content-item {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* 超小屏幕（360px以下）优化 */
@media (max-width: 360px) {
    .modal-body.template-layout {
        height: 45vh;
        min-height: 250px;
    }
    
    .template-categories {
        width: 35%;
        min-width: 90px;
    }
    
    .template-projects {
        width: 35%;
        min-width: 90px;
    }
    
    .template-contents {
        width: 30%;
    }
    
    .category-item, .project-item, .template-content-item {
        padding: 6px 8px;
        font-size: 12px;
    }
}

.template-categories, .template-projects, .template-contents {
    overflow-y: auto;
    padding: 10px;
    border-right: 1px solid #eee;
    max-height: 100%;
}

.template-categories:last-child, 
.template-projects:last-child, 
.template-contents:last-child {
    border-right: none;
}

.template-content-item {
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-content-item:hover {
    background-color: #f5f7fa;
}

.template-content-item.selected {
    background-color: #e6f7ff;
    border: 1px solid #409eff;
}

.category-item, .project-item {
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
}

.category-item:hover, .project-item:hover {
    background-color: #f5f7fa;
}

.category-item.active, .project-item.active {
    background-color: #409EFF;
    color: white;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #EBEEF5;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #67C23A;
    color: white;
    padding: 15px 25px;
    border-radius: 6px;
    z-index: 2147483647 !important;  /* 使用最大可能的z-index值确保显示在最顶层 */
    animation: fadeIn 0.3s;
}

.toast.hidden {
    display: none;
}

.toast.error {
    background: #F56C6C;
}

.toast.warning {
    background: #E6A23C;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

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

/* 私密设置和开放详情样式 */
.privacy-section, .share-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.user-select-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 10px;
}

.user-item {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item:last-child {
    border-bottom: none;
}

.user-item.selected {
    background-color: #e6f7ff;
}

.user-info {
    flex: 1;
}

.user-info .name {
    font-weight: 600;
    color: #333;
}

.user-info .username {
    font-size: 12px;
    color: #999;
}

.user-date-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-date-controls input[type="date"] {
    padding: 10px 14px;
    border: 2px solid #e8ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.user-date-controls input[type="date"]:focus {
    border-color: #409EFF;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.15);
    outline: none;
}

.user-date-controls label {
    font-size: 12px;
    color: #666;
}

/* 治疗记录详情页的分享信息样式 */
.share-info-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f9ff;
    border-radius: 6px;
    border: 1px solid #bae7ff;
}

.share-info-item {
    padding: 10px 0;
    border-bottom: 1px solid #e1f3ff;
    display: flex;
    justify-content: space-between;
}

.share-info-item:last-child {
    border-bottom: none;
}

.share-info-item .user {
    font-weight: 600;
}

.share-info-item .dates {
    color: #666;
    font-size: 13px;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .search-bar {
        flex-direction: column;
        width: 100%;
    }
    
    .search-bar input {
        max-width: 100%;
        width: 100%;
        flex: none;
    }
    
    .login-box {
        padding: 30px 20px;
    }
    
    .login-box h1 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .content-card {
        padding: 15px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px;
        font-size: 13px;
    }
}

/* 图片上传容器 */
.image-upload-container {
    margin-top: 10px;
}

.upload-area {
    border: 2px dashed #D9D9D9;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #FAFAFA;
}

.upload-area:hover {
    border-color: #409EFF;
    background-color: #ECF5FF;
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.upload-text {
    color: #909399;
    font-size: 14px;
}

/* 图片预览 */
.image-preview {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-item {
    position: relative;
}

.image-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.image-item img:hover {
    border-color: #409EFF;
}

.image-delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #F56C6C;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.image-delete-btn:hover {
    background: #E64949;
}

/* 患者搜索下拉列表 */
.patient-search-group {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #E4E7ED;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #F2F6FC;
    transition: background-color 0.2s;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #ECF5FF;
}

.dropdown-item .item-main {
    font-weight: 500;
    color: #303133;
}

.dropdown-item .item-sub {
    font-size: 12px;
    color: #909399;
    margin-top: 2px;
}

/* 图片查看器 */
.image-viewer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483647 !important;  /* 使用最大可能的z-index值 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
}

.image-viewer-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    z-index: 2147483647 !important;
}

.image-viewer-content {
    position: relative !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    padding: 20px !important;
    z-index: 2147483647 !important;
}

.image-viewer-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.image-viewer-zoom-hint {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    white-space: nowrap;
}

.image-viewer-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 详情页面样式 */
.detail-section {
    background: #fafafa;
    padding: 15px;
    border-radius: 6px;
}

.detail-section h4 {
    color: #303133;
    margin-top: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    gap: 8px;
}

.detail-label {
    font-weight: 500;
    color: #606266;
    min-width: 100px;
}

.detail-value {
    color: #303133;
    flex: 1;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-gallery .image-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

/* 进度模态框样式 */
.progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.progress-container {
    position: relative;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.progress-container h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.progress-info {
    margin-bottom: 20px;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.progress-label {
    color: #666;
    font-size: 14px;
}

.progress-status {
    color: #409eff;
    font-size: 14px;
    font-weight: 500;
}

.progress-status.success {
    color: #67c23a;
}

.progress-status.error {
    color: #f56c6c;
}

.progress-bar-container {
    position: relative;
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #409eff, #67c23a);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.upload-details {
    max-height: 150px;
    overflow-y: auto;
    text-align: left;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.upload-details p {
    margin: 5px 0;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* 查询进度模态框样式 */
.query-progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.query-progress-modal .progress-message {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* 模板链接样式 */
.template-links {
    margin-top: 8px;
    display: flex;
    gap: 15px;
}

.template-links a {
    color: #409eff;
    font-size: 14px;
    text-decoration: none;
}

.template-links a:hover {
    text-decoration: underline;
}

/* 模板目录样式 */
.category-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: background-color 0.2s;
}

.category-item:hover {
    background-color: #f5f7fa;
}

.category-item.active {
    background-color: #ecf5ff;
    color: #409eff;
    font-weight: 500;
}

/* 模板项目项样式 */
.project-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: background-color 0.2s;
}

.project-item:hover {
    background-color: #f5f7fa;
}

.project-item.active {
    background-color: #ecf5ff;
    color: #409eff;
    font-weight: 500;
}

/* 模板内容项样式 */
.template-content-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.template-content-item:hover {
    border-color: #409eff;
    background-color: #f8fafc;
}

.template-content-item.selected {
    border-color: #409eff;
    background-color: #ecf5ff;
}

.template-content-item input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
}

.template-content-item .content-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.template-content-item .delete-btn {
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.template-content-item .delete-btn:hover {
    color: #f56c6c;
    background-color: #fef0f0;
}

/* 媒体展示样式 */
.media-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.media-section h4 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #303133;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.media-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.clickable-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.clickable-image:hover {
    transform: scale(1.05);
}

.video-player {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background-color: #000;
}

/* 随访记录区域样式 */
.followup-section {
    margin-top: 20px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}

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

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

/* 随访记录表格样式 */
.followup-tab {
    margin-top: 10px;
}

.followup-tab .search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}

.followup-tab .search-bar input[type="date"] {
    padding: 10px 14px;
    border: 2px solid #e8ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.followup-tab .search-bar input[type="date"]:focus {
    border-color: #409EFF;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.15);
    outline: none;
}

.result-completed {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 4px;
}

.followup-section .data-table {
    margin-bottom: 0;
}

.followup-section .data-table th,
.followup-section .data-table td {
    padding: 10px 12px;
    font-size: 14px;
}

.followup-section .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-wrapper input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8ecef;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.autocomplete-wrapper input:focus {
    outline: none;
    border-color: #409EFF;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.15);
}

/* 快捷查询随访记录搜索栏样式 */
.followup-quick-search {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.followup-quick-search .date-buttons {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .followup-quick-search {
        flex-direction: column;
        align-items: stretch;
    }
    
    .followup-quick-search input[type="date"] {
        width: 100%;
    }
    
    .followup-quick-search .date-buttons {
        display: flex;
        justify-content: flex-start;
        gap: 8px;
    }
    
    .followup-quick-search .date-buttons .btn {
        flex: 1;
        min-width: auto;
    }
}

/* 系统设置页面样式 */
.settings-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.settings-category {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    min-width: 280px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.settings-category h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.settings-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-buttons .btn {
    width: 100%;
    text-align: center;
}

/* 可编辑单元格样式 */
.editable-cell {
    cursor: pointer;
    position: relative;
    min-height: 32px;
    padding: 4px 8px !important;
}

.editable-cell:hover {
    background-color: #f0f7ff;
}

.editable-cell .cell-text {
    display: inline-block;
    min-height: 20px;
}

.editable-cell .cell-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #409eff;
    border-radius: 4px;
    outline: none;
    font-size: 14px;
    background: #fff;
}

.editable-cell .cell-input:focus {
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.editable-cell .cell-input.hidden {
    display: none;
}

.bg-light-green {
    background-color: #d4edda;
}

/* 公告栏样式 */
#announcementBar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}

/* 软件图标预览样式 */
.software-icon-preview {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
}

/* 公告栏设置模态框样式 */
.checkbox-group-item {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

/* 数据卡片样式 */
.data-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
}

.data-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.data-card h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #303133;
}

.data-card p {
    margin: 6px 0;
    font-size: 13px;
    color: #666;
}

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

.card-actions .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* 治疗记录表格响应式固定列样式 */
.treatment-table-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
}

.treatment-table-wrapper .data-table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

.treatment-table-wrapper .data-table th,
.treatment-table-wrapper .data-table td {
    white-space: nowrap;
}

/* 只固定治疗编号列（第一列） */
.treatment-table-wrapper .data-table th:first-child,
.treatment-table-wrapper .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.treatment-table-wrapper .data-table td:first-child {
    background-color: #fff;
}

/* 操作列宽度控制为一个按钮宽度 */
.treatment-table-wrapper .data-table th:last-child,
.treatment-table-wrapper .data-table td:last-child {
    min-width: 80px;
    max-width: 80px;
    width: 80px;
    padding: 8px 4px;
}

/* 行悬停效果 */
.treatment-table-wrapper .data-table tbody tr:hover td:first-child {
    background-color: #F5F7FA;
}

/* 移动端主页面宽度控制 */
@media (max-width: 768px) {
    #mainPage {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
        overflow-y: visible;
    }
    
    #mainPage .content-section {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        overflow-y: visible;
    }
}

/* 小屏幕手机主页面宽度控制 */
@media (max-width: 480px) {
    #mainPage {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
        overflow-y: visible;
    }
    
    #mainPage .content-section {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        overflow-y: visible;
    }
}

/* 治疗记录查询页面响应式布局 */
.treatment-tab#treatmentQuery {
    padding: 10px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

/* 治疗记录查询页面搜索栏 - PC端样式 */
.treatment-tab#treatmentQuery .search-bar {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

#treatmentQuery .search-bar input[type="text"] {
    flex: 0 1 300px;
    min-width: 150px;
    width: auto !important;
    max-width: none !important;
    padding: 10px 16px !important;
    border: 2px solid #e8ecef !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    height: 42px !important;
    line-height: 20px !important;
    display: inline-block !important;
    min-height: 42px !important;
    max-height: 42px !important;
    transition: all 0.3s ease;
}

/* 治疗记录查询页面搜索栏 - 移动端样式 */
@media (max-width: 768px) {
    .treatment-tab#treatmentQuery .search-bar {
        flex-direction: column;
        align-items: flex-start !important;
        justify-content: flex-start !important;
    }
    
    #treatmentQuery .search-bar input[type="text"] {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
    }
}

#treatmentQuery .search-bar input[type="text"]:focus {
    border-color: #409EFF !important;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.15) !important;
    outline: none;
}

#treatmentQuery .search-bar .search-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 0;
    overflow: visible;
}

.treatment-tab#treatmentQuery .search-bar .btn {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 8px;
}

/* 治疗记录页面刷新下拉菜单特殊样式 */
.treatment-tab#treatmentQuery .search-bar .dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 150px;
    max-width: 250px;
    z-index: 9999;
    background: white;
    border: 1px solid #eee;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.treatment-tab#treatmentQuery .search-bar .dropdown-content a {
    display: block;
    padding: 12px 15px;
    text-align: left;
}

.treatment-tab#treatmentQuery .content-card {
    padding: 15px;
    overflow: visible;
    max-width: 100%;
    box-sizing: border-box;
}

.treatment-tab#treatmentQuery .pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    gap: 10px;
}

.treatment-tab#treatmentQuery .pagination .btn {
    padding: 8px 15px;
    min-width: auto;
}

.treatment-tab#treatmentQuery .pagination .pagination-info {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 14px;
}

/* 平板设备响应式 */
@media (max-width: 1024px) {
    .treatment-tab#treatmentQuery {
        overflow: visible;
    }
    
    .treatment-tab#treatmentQuery .search-bar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        overflow: visible;
    }
    
    .treatment-tab#treatmentQuery .search-bar input[type="text"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 12px !important;
        font-size: 14px !important;
        height: 42px !important;
        line-height: 22px !important;
        box-sizing: border-box !important;
        display: block !important;
    }
    
    .treatment-tab#treatmentQuery .search-bar .search-actions {
        width: 100%;
        justify-content: flex-start;
        overflow: visible;
    }
    
    .treatment-tab#treatmentQuery .search-bar .dropdown {
        position: relative;
    }
    
    .treatment-tab#treatmentQuery .search-bar .dropdown-content {
        position: fixed;
        left: 0;
        z-index: 9999;
        background: white;
        border: 1px solid #eee;
        border-radius: 5px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .treatment-tab#treatmentQuery .content-card {
        overflow: visible;
    }
}

/* 手机设备响应式 */
@media (max-width: 768px) {
    .treatment-tab#treatmentQuery {
        padding: 5px;
        overflow: visible;
    }
    
    .treatment-tab#treatmentQuery .search-bar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 10px;
        overflow: visible;
    }
    
    .treatment-tab#treatmentQuery .search-bar input[type="text"] {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        padding: 10px 12px !important;
        font-size: 14px !important;
        height: 42px !important;
        line-height: 22px !important;
        box-sizing: border-box !important;
        display: block !important;
    }
    
    .treatment-tab#treatmentQuery .search-bar .search-actions {
        width: 100%;
        justify-content: flex-start;
        overflow: visible;
    }
    
    .treatment-tab#treatmentQuery .search-bar .btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .treatment-tab#treatmentQuery .search-bar .dropdown-content {
        position: fixed;
        left: 0;
        z-index: 9999;
        background: white;
        border: 1px solid #eee;
        border-radius: 5px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .treatment-tab#treatmentQuery .content-card {
        padding: 10px;
        overflow: visible;
    }
    
    .treatment-tab#treatmentQuery .treatment-table-wrapper {
        font-size: 12px;
    }
    
    .treatment-tab#treatmentQuery .data-table th,
    .treatment-tab#treatmentQuery .data-table td {
        padding: 8px 10px;
    }
    
    .treatment-tab#treatmentQuery .pagination {
        flex-wrap: wrap;
    }
    
    .treatment-tab#treatmentQuery .pagination .btn {
        padding: 8px 15px;
    }
    
    .treatment-tab#treatmentQuery .pagination .pagination-info {
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* 小屏幕手机响应式 */
@media (max-width: 480px) {
    .treatment-tab#treatmentQuery {
        padding: 5px;
    }
    
    .treatment-tab#treatmentQuery .search-bar input[type="text"] {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .treatment-tab#treatmentQuery .search-bar .search-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .treatment-tab#treatmentQuery .search-bar .btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .treatment-tab#treatmentQuery .data-table th,
    .treatment-tab#treatmentQuery .data-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .treatment-tab#treatmentQuery .treatment-table-wrapper .data-table th:first-child,
    .treatment-tab#treatmentQuery .treatment-table-wrapper .data-table td:first-child {
        min-width: 60px;
    }
    
    .treatment-tab#treatmentQuery .treatment-table-wrapper .data-table th:nth-child(2),
    .treatment-tab#treatmentQuery .treatment-table-wrapper .data-table td:nth-child(2) {
        min-width: 60px;
        left: 60px;
    }
    
    .treatment-tab#treatmentQuery .treatment-table-wrapper .data-table th:nth-child(3),
    .treatment-tab#treatmentQuery .treatment-table-wrapper .data-table td:nth-child(3) {
        min-width: 60px;
        left: 120px;
    }
    
    .treatment-tab#treatmentQuery .treatment-table-wrapper .data-table th:last-child,
    .treatment-tab#treatmentQuery .treatment-table-wrapper .data-table td:last-child {
        min-width: 100px;
    }
}

.treatment-table-wrapper .data-table tbody tr:hover td:last-child {
    background-color: #F5F7FA;
}

/* 快捷查询随访记录表格响应式固定列样式 */
.followup-quick-table-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
}

.followup-quick-table-wrapper .data-table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

.followup-quick-table-wrapper .data-table th,
.followup-quick-table-wrapper .data-table td {
    white-space: nowrap;
}

/* 只固定患者姓名列（第一列） */
.followup-quick-table-wrapper .data-table th:first-child,
.followup-quick-table-wrapper .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.followup-quick-table-wrapper .data-table td:first-child {
    background-color: #fff;
}

/* 操作列宽度控制为一个按钮宽度 */
.followup-quick-table-wrapper .data-table th:last-child,
.followup-quick-table-wrapper .data-table td:last-child {
    min-width: 80px;
    max-width: 80px;
    width: 80px;
    padding: 8px 4px;
}

/* 行悬停效果 */
.followup-quick-table-wrapper .data-table tbody tr:hover td:first-child {
    background-color: #F5F7FA;
}

.followup-quick-table-wrapper .data-table tbody tr:hover td:last-child {
    background-color: #F5F7FA;
}

/* 快捷查询随访记录页面响应式布局 */
.followup-tab#followupQuick {
    padding: 10px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.followup-tab#followupQuick .search-bar {
    display: block !important;
    margin-bottom: 15px;
}

.followup-tab#followupQuick .search-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

/* 快捷查询随访记录页面移动端响应式 */
@media (max-width: 768px) {
    .followup-tab#followupQuick {
        padding: 5px;
    }
    
    .followup-tab#followupQuick .data-table th,
    .followup-tab#followupQuick .data-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .followup-tab#followupQuick .followup-quick-table-wrapper .data-table th:first-child,
    .followup-tab#followupQuick .followup-quick-table-wrapper .data-table td:first-child {
        min-width: 60px;
    }
    
    .followup-tab#followupQuick .followup-quick-table-wrapper .data-table th:last-child,
    .followup-tab#followupQuick .followup-quick-table-wrapper .data-table td:last-child {
        min-width: 100px;
    }
}

/* 查询随访记录表格响应式固定列样式 */
.followup-query-table-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
}

.followup-query-table-wrapper .data-table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

.followup-query-table-wrapper .data-table th,
.followup-query-table-wrapper .data-table td {
    white-space: nowrap;
}

/* 只固定患者姓名列（第一列） */
.followup-query-table-wrapper .data-table th:first-child,
.followup-query-table-wrapper .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.followup-query-table-wrapper .data-table td:first-child {
    background-color: #fff;
}

/* 操作列宽度控制为一个按钮宽度 */
.followup-query-table-wrapper .data-table th:last-child,
.followup-query-table-wrapper .data-table td:last-child {
    min-width: 80px;
    max-width: 80px;
    width: 80px;
    padding: 8px 4px;
}

/* 行悬停效果 */
.followup-query-table-wrapper .data-table tbody tr:hover td:first-child {
    background-color: #F5F7FA;
}

.followup-query-table-wrapper .data-table tbody tr:hover td:last-child {
    background-color: #F5F7FA;
}

/* 查询随访记录页面响应式布局 */
.followup-tab#followupQuery {
    padding: 10px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.followup-tab#followupQuery .search-bar {
    display: block !important;
    margin-bottom: 15px;
}

/* 查询随访记录页面移动端响应式 */
@media (max-width: 768px) {
    .followup-tab#followupQuery {
        padding: 5px;
    }
    
    .followup-tab#followupQuery .data-table th,
    .followup-tab#followupQuery .data-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .followup-tab#followupQuery .followup-query-table-wrapper .data-table th:first-child,
    .followup-tab#followupQuery .followup-query-table-wrapper .data-table td:first-child {
        min-width: 60px;
    }
    
    .followup-tab#followupQuery .followup-query-table-wrapper .data-table th:last-child,
    .followup-tab#followupQuery .followup-query-table-wrapper .data-table td:last-child {
        min-width: 100px;
    }
}

/* 快捷查询预约记录表格响应式固定列样式 */
.appointment-quick-table-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
}

.appointment-quick-table-wrapper .data-table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

.appointment-quick-table-wrapper .data-table th,
.appointment-quick-table-wrapper .data-table td {
    white-space: nowrap;
}

/* 固定第一列（预约编号） */
.appointment-quick-table-wrapper .data-table th:first-child,
.appointment-quick-table-wrapper .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.appointment-quick-table-wrapper .data-table td:first-child {
    background-color: #fff;
}

/* 固定第二列（患者姓名） */
.appointment-quick-table-wrapper .data-table th:nth-child(2),
.appointment-quick-table-wrapper .data-table td:nth-child(2) {
    position: sticky;
    left: 80px;
    z-index: 19;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.appointment-quick-table-wrapper .data-table td:nth-child(2) {
    background-color: #fff;
}

/* 操作列宽度控制为一个按钮宽度 */
.appointment-quick-table-wrapper .data-table th:last-child,
.appointment-quick-table-wrapper .data-table td:last-child {
    min-width: 80px;
    max-width: 80px;
    width: 80px;
    padding: 8px 4px;
}

/* 行悬停效果 */
.appointment-quick-table-wrapper .data-table tbody tr:hover td:first-child,
.appointment-quick-table-wrapper .data-table tbody tr:hover td:nth-child(2) {
    background-color: #F5F7FA;
}

.appointment-quick-table-wrapper .data-table tbody tr:hover td:last-child {
    background-color: #F5F7FA;
}

/* 快捷查询预约记录页面响应式布局 */
.appointment-tab#appointmentQuick {
    padding: 10px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.appointment-tab#appointmentQuick .search-bar {
    display: block !important;
    margin-bottom: 15px;
}

/* 快捷查询预约记录搜索栏样式 */
.appointment-quick-search {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.appointment-quick-search input[type="date"] {
    min-width: 280px;
    padding: 10px 14px;
    border: 2px solid #e8ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.appointment-quick-search input[type="date"]:focus {
    border-color: #409EFF;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.15);
    outline: none;
}

.appointment-quick-search .date-buttons {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    .appointment-quick-search {
        flex-direction: column;
        align-items: stretch;
    }
    
    .appointment-quick-search input[type="date"] {
        width: 100%;
    }
    
    .appointment-quick-search .date-buttons {
        display: flex;
        justify-content: flex-start;
        gap: 8px;
    }
    
    .appointment-quick-search .date-buttons .btn {
        flex: 1;
        min-width: auto;
    }
    
    .appointment-tab#appointmentQuick {
        padding: 5px;
    }
    
    .appointment-tab#appointmentQuick .data-table th,
    .appointment-tab#appointmentQuick .data-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .appointment-tab#appointmentQuick .appointment-quick-table-wrapper .data-table th:first-child,
    .appointment-tab#appointmentQuick .appointment-quick-table-wrapper .data-table td:first-child {
        min-width: 60px;
    }
    
    .appointment-tab#appointmentQuick .appointment-quick-table-wrapper .data-table th:nth-child(2),
    .appointment-tab#appointmentQuick .appointment-quick-table-wrapper .data-table td:nth-child(2) {
        min-width: 60px;
        left: 60px;
    }
    
    .appointment-tab#appointmentQuick .appointment-quick-table-wrapper .data-table th:last-child,
    .appointment-tab#appointmentQuick .appointment-quick-table-wrapper .data-table td:last-child {
        min-width: 100px;
    }
}

/* 查询预约记录表格响应式固定列样式 */
.appointment-query-table-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
}

.appointment-query-table-wrapper .data-table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

.appointment-query-table-wrapper .data-table th,
.appointment-query-table-wrapper .data-table td {
    white-space: nowrap;
}

/* 固定第一列（预约编号） */
.appointment-query-table-wrapper .data-table th:first-child,
.appointment-query-table-wrapper .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.appointment-query-table-wrapper .data-table td:first-child {
    background-color: #fff;
}

/* 固定第二列（患者姓名） */
.appointment-query-table-wrapper .data-table th:nth-child(2),
.appointment-query-table-wrapper .data-table td:nth-child(2) {
    position: sticky;
    left: 80px;
    z-index: 19;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.appointment-query-table-wrapper .data-table td:nth-child(2) {
    background-color: #fff;
}

/* 操作列宽度控制为一个按钮宽度 */
.appointment-query-table-wrapper .data-table th:last-child,
.appointment-query-table-wrapper .data-table td:last-child {
    min-width: 80px;
    max-width: 80px;
    width: 80px;
    padding: 8px 4px;
}

/* 行悬停效果 */
.appointment-query-table-wrapper .data-table tbody tr:hover td:first-child,
.appointment-query-table-wrapper .data-table tbody tr:hover td:nth-child(2) {
    background-color: #F5F7FA;
}

.appointment-query-table-wrapper .data-table tbody tr:hover td:last-child {
    background-color: #F5F7FA;
}

/* 查询预约记录页面响应式布局 */
.appointment-tab#appointmentQuery {
    padding: 10px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.appointment-tab#appointmentQuery .search-bar {
    display: block !important;
    margin-bottom: 15px;
}

/* 查询预约记录页面移动端响应式 */
@media (max-width: 768px) {
    .appointment-tab#appointmentQuery {
        padding: 5px;
    }
    
    .appointment-tab#appointmentQuery .data-table th,
    .appointment-tab#appointmentQuery .data-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .appointment-tab#appointmentQuery .appointment-query-table-wrapper .data-table th:first-child,
    .appointment-tab#appointmentQuery .appointment-query-table-wrapper .data-table td:first-child {
        min-width: 60px;
    }
    
    .appointment-tab#appointmentQuery .appointment-query-table-wrapper .data-table th:nth-child(2),
    .appointment-tab#appointmentQuery .appointment-query-table-wrapper .data-table td:nth-child(2) {
        min-width: 60px;
        left: 60px;
    }
    
    .appointment-tab#appointmentQuery .appointment-query-table-wrapper .data-table th:last-child,
    .appointment-tab#appointmentQuery .appointment-query-table-wrapper .data-table td:last-child {
        min-width: 100px;
    }
}

/* 患者管理表格响应式固定列样式 */
.patients-table-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
}

.patients-table-wrapper .data-table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

.patients-table-wrapper .data-table th,
.patients-table-wrapper .data-table td {
    white-space: nowrap;
}

/* 固定第一列（患者编号） */
.patients-table-wrapper .data-table th:first-child,
.patients-table-wrapper .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.patients-table-wrapper .data-table td:first-child {
    background-color: #fff;
}

/* 固定第二列（姓名） */
.patients-table-wrapper .data-table th:nth-child(2),
.patients-table-wrapper .data-table td:nth-child(2) {
    position: sticky;
    left: 80px;
    z-index: 19;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.patients-table-wrapper .data-table td:nth-child(2) {
    background-color: #fff;
}

/* 操作列宽度控制为一个按钮宽度 */
.patients-table-wrapper .data-table th:last-child,
.patients-table-wrapper .data-table td:last-child {
    min-width: 80px;
    max-width: 80px;
    width: 80px;
    padding: 8px 4px;
}

/* 行悬停效果 */
.patients-table-wrapper .data-table tbody tr:hover td:first-child,
.patients-table-wrapper .data-table tbody tr:hover td:nth-child(2) {
    background-color: #F5F7FA;
}

.patients-table-wrapper .data-table tbody tr:hover td:last-child {
    background-color: #F5F7FA;
}

/* 患者管理页面响应式布局 */
#patients {
    padding: 10px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

#patients .search-bar {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

#patients .search-bar input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid #e8ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#patients .search-bar input:focus {
    border-color: #409EFF;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.15);
    outline: none;
}

#patients .search-bar .btn {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 8px;
}

/* 患者管理页面移动端响应式 */
@media (max-width: 768px) {
    #patients {
        padding: 5px;
    }
    
    #patients .search-bar {
        flex-direction: column;
        padding: 12px;
    }
    
    #patients .search-bar input {
        width: 100%;
        min-width: unset;
        margin-bottom: 5px;
    }
    
    #patients .search-bar .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    #patients .data-table th,
    #patients .data-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    #patients .patients-table-wrapper .data-table th:first-child,
    #patients .patients-table-wrapper .data-table td:first-child {
        min-width: 60px;
    }
    
    #patients .patients-table-wrapper .data-table th:nth-child(2),
    #patients .patients-table-wrapper .data-table td:nth-child(2) {
        min-width: 60px;
        left: 60px;
    }
    
    #patients .patients-table-wrapper .data-table th:last-child,
    #patients .patients-table-wrapper .data-table td:last-child {
        min-width: 100px;
    }
}

/* 仪表盘 - 最近患者表格响应式固定列样式 */
.recent-patients-table-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
}

.recent-patients-table-wrapper .data-table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

.recent-patients-table-wrapper .data-table th,
.recent-patients-table-wrapper .data-table td {
    white-space: nowrap;
}

/* 固定第一列（患者编号） */
.recent-patients-table-wrapper .data-table th:first-child,
.recent-patients-table-wrapper .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.recent-patients-table-wrapper .data-table td:first-child {
    background-color: #fff;
}

/* 操作列宽度控制为一个按钮宽度 */
.recent-patients-table-wrapper .data-table th:last-child,
.recent-patients-table-wrapper .data-table td:last-child {
    min-width: 80px;
    max-width: 80px;
    width: 80px;
    padding: 8px 4px;
}

/* 行悬停效果 */
.recent-patients-table-wrapper .data-table tbody tr:hover td:first-child {
    background-color: #F5F7FA;
}

.recent-patients-table-wrapper .data-table tbody tr:hover td:last-child {
    background-color: #F5F7FA;
}

/* 仪表盘 - 最近预约表格响应式固定列样式 */
.recent-appointments-table-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
}

.recent-appointments-table-wrapper .data-table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

.recent-appointments-table-wrapper .data-table th,
.recent-appointments-table-wrapper .data-table td {
    white-space: nowrap;
}

/* 固定第一列（患者姓名） */
.recent-appointments-table-wrapper .data-table th:first-child,
.recent-appointments-table-wrapper .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.recent-appointments-table-wrapper .data-table td:first-child {
    background-color: #fff;
}

/* 仪表盘页面移动端响应式 */
@media (max-width: 768px) {
    #dashboard .data-table th,
    #dashboard .data-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    #dashboard .recent-patients-table-wrapper .data-table th:first-child,
    #dashboard .recent-patients-table-wrapper .data-table td:first-child,
    #dashboard .recent-appointments-table-wrapper .data-table th:first-child,
    #dashboard .recent-appointments-table-wrapper .data-table td:first-child {
        min-width: 60px;
    }
    
    #dashboard .recent-patients-table-wrapper .data-table th:last-child,
    #dashboard .recent-patients-table-wrapper .data-table td:last-child,
    #dashboard .recent-appointments-table-wrapper .data-table th:last-child,
    #dashboard .recent-appointments-table-wrapper .data-table td:last-child {
        min-width: 100px;
    }
}

/* 收藏记录表格响应式固定列样式 */
.collections-table-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
}

.collections-table-wrapper .data-table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

.collections-table-wrapper .data-table th,
.collections-table-wrapper .data-table td {
    white-space: nowrap;
}

/* 固定患者姓名列（第二列，因为第一列隐藏） */
.collections-table-wrapper .data-table th:nth-child(2),
.collections-table-wrapper .data-table td:nth-child(2) {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.collections-table-wrapper .data-table td:nth-child(2) {
    background-color: #fff;
}

/* 操作列宽度控制为一个按钮宽度 */
.collections-table-wrapper .data-table th:last-child,
.collections-table-wrapper .data-table td:last-child {
    min-width: 80px;
    max-width: 80px;
    width: 80px;
    padding: 8px 4px;
}

/* 行悬停效果 */
.collections-table-wrapper .data-table tbody tr:hover td:nth-child(2) {
    background-color: #F5F7FA;
}

.collections-table-wrapper .data-table tbody tr:hover td:last-child {
    background-color: #F5F7FA;
}

/* 收藏记录页面响应式布局 */
#collections {
    padding: 10px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

#collections .search-bar {
    display: block !important;
    margin-bottom: 15px;
}

/* 收藏记录页面移动端响应式 */
@media (max-width: 768px) {
    #collections {
        padding: 5px;
    }
    
    #collections .data-table th,
    #collections .data-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    #collections .collections-table-wrapper .data-table th:nth-child(2),
    #collections .collections-table-wrapper .data-table td:nth-child(2) {
        min-width: 60px;
    }
    
    #collections .collections-table-wrapper .data-table th:last-child,
    #collections .collections-table-wrapper .data-table td:last-child {
        min-width: 100px;
    }
}

/* 用户信息管理表格响应式固定列样式 */
.user-manage-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-sizing: border-box;
}

.user-manage-table-wrapper .data-table {
    width: auto;
    min-width: 100%;
    table-layout: auto;
}

.user-manage-table-wrapper .data-table th,
.user-manage-table-wrapper .data-table td {
    white-space: nowrap;
}

/* 固定用户名列（第一列） */
.user-manage-table-wrapper .data-table th:first-child,
.user-manage-table-wrapper .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #F5F7FA;
    min-width: 80px;
    box-shadow: 2px 0 3px rgba(0,0,0,0.1);
}

.user-manage-table-wrapper .data-table td:first-child {
    background-color: #fff;
}

/* 密码列设置更大的最小宽度，确保输入框有足够空间 */
.user-manage-table-wrapper .data-table th:nth-child(5),
.user-manage-table-wrapper .data-table td:nth-child(5) {
    min-width: 150px;
}

/* 密码列输入框特殊样式 */
.user-manage-table-wrapper .data-table td:nth-child(5) .cell-input {
    min-width: 130px;
    width: 130px;
    position: relative;
    z-index: 25;
}

/* 操作列宽度控制为一个按钮宽度 */
.user-manage-table-wrapper .data-table th:last-child,
.user-manage-table-wrapper .data-table td:last-child {
    min-width: 80px;
    max-width: 80px;
    width: 80px;
    padding: 8px 4px;
}

/* 行悬停效果 */
.user-manage-table-wrapper .data-table tbody tr:hover td:first-child {
    background-color: #F5F7FA;
}

.user-manage-table-wrapper .data-table tbody tr:hover td:last-child {
    background-color: #F5F7FA;
}

/* 用户信息管理页面移动端响应式 */
@media (max-width: 768px) {
    #userManageModal .user-manage-table-wrapper .data-table th,
    #userManageModal .user-manage-table-wrapper .data-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    #userManageModal .user-manage-table-wrapper .data-table th:first-child,
    #userManageModal .user-manage-table-wrapper .data-table td:first-child {
        min-width: 60px;
    }
    
    /* 移动端密码列保持足够宽度 */
    #userManageModal .user-manage-table-wrapper .data-table th:nth-child(5),
    #userManageModal .user-manage-table-wrapper .data-table td:nth-child(5) {
        min-width: 140px;
    }
    
    /* 移动端密码列输入框样式 */
    #userManageModal .user-manage-table-wrapper .data-table td:nth-child(5) .cell-input {
        min-width: 120px;
        width: 120px;
        font-size: 12px;
        padding: 3px 6px;
    }
    
    #userManageModal .user-manage-table-wrapper .data-table th:last-child,
    #userManageModal .user-manage-table-wrapper .data-table td:last-child {
        min-width: 100px;
    }
}

/* OCR下拉菜单样式 */
.ocr-dropdown {
    display: inline-flex;
}

.ocr-dropdown .dropdown-item:hover {
    background-color: #f5f7fa;
    color: #409EFF;
}

.ocr-dropdown-menu {
    box-sizing: border-box;
}

.ocr-dropdown-menu .dropdown-item:active {
    background-color: #ecf5ff;
}