/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 容器样式 */
.container {
    max-width: 1000px;
    margin: 20px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.logo-icon {
    font-size: 3em;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.header-text {
    text-align: left;
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header .subtitle {
    font-size: 1.1em;
    opacity: 0.95;
    font-weight: 300;
}

/* 主内容区 */
main {
    padding: 40px;
}

/* 信息提示横幅 */
.info-banner {
    background: linear-gradient(135deg, #e3f2fd 0%, #e8eaf6 100%);
    border-left: 5px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.info-content {
    flex: 1;
}

.info-content strong {
    color: #667eea;
    font-size: 1.1em;
    display: block;
    margin-bottom: 10px;
}

.info-content ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.info-content li {
    margin: 5px 0;
    line-height: 1.6;
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #555;
    font-size: 15px;
}

.form-group .required {
    color: #e74c3c;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fafafa;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

/* 文件上传 */
.file-input {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    cursor: pointer;
}

.file-hint {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

/* 粘贴区域 */
.paste-area {
    margin-top: 10px;
    padding: 30px;
    border: 3px dashed #667eea;
    border-radius: 8px;
    text-align: center;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9ff;
    user-select: none;
    outline: none;
}

.paste-area:hover {
    background: #eef0ff;
    border-color: #764ba2;
    transform: scale(1.02);
}

.paste-area:focus {
    background: #eef0ff;
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.paste-area-focused {
    background: #eef0ff;
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.paste-area-dragover {
    background: #dde3ff;
    border-color: #27ae60;
    transform: scale(1.05);
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.preview-image-wrapper {
    position: relative;
    display: inline-block;
}

.preview-image-wrapper img {
    max-width: 150px;
    max-height: 150px;
    border: 2px solid #ddd;
    border-radius: 5px;
    object-fit: cover;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    border: 2px solid white;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
}

.remove-image-btn:hover {
    background: #c0392b;
    transform: scale(1.2);
}

/* 临时消息提示 */
.temp-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.temp-message.show {
    opacity: 1;
    transform: translateX(0);
}

.temp-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.temp-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.image-preview img {
    max-width: 150px;
    max-height: 150px;
    border: 2px solid #ddd;
    border-radius: 5px;
    object-fit: cover;
}

/* 表单分区 */
.form-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid #eee;
    position: relative;
}

.form-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h2::before {
    content: '📋';
    font-size: 1.2em;
}

/* 按钮样式 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-link {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-link:hover {
    background: #667eea;
    color: white;
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

/* 表单操作区 */
.form-actions {
    margin-top: 35px;
    text-align: center;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 消息提示 */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* 页脚 */
footer {
    background: #34495e;
    color: white;
    text-align: center;
    padding: 20px;
}

footer p {
    margin: 5px 0;
}

.footer-note {
    font-size: 0.85em;
    opacity: 0.8;
    color: #ecf0f1;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo-icon {
    font-size: 3.5em;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

.login-header h1 {
    color: #667eea;
    margin-bottom: 5px;
    font-size: 1.8em;
}

.login-subtitle {
    color: #888;
    font-size: 1.1em;
}

/* 管理后台样式 */
.dashboard-container {
    min-height: 100vh;
    background: white;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-logo .logo-icon {
    font-size: 2em;
}

.dashboard-header h1 {
    font-size: 1.6em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.dashboard-main {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 筛选区域 */
.filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
}

/* 病例列表 */
.cases-section h2 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
}

.cases-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.case-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.case-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.case-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.case-card h3 {
    color: #667eea;
    font-size: 1.2em;
}

.case-type-badge {
    background: #3498db;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85em;
}

.case-type-badge.并发症 {
    background: #e74c3c;
}

.case-type-badge.新技术 {
    background: #27ae60;
}

.case-type-badge.急性心梗 {
    background: #f39c12;
}

.case-card-body {
    color: #666;
    font-size: 0.9em;
}

.case-card-body p {
    margin: 8px 0;
}

.case-text-preview {
    color: #888;
    font-style: italic;
    margin-top: 10px;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 900px;
    width: 100%;
    margin: 40px auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.detail-section p,
.detail-section textarea {
    color: #555;
    line-height: 1.8;
    white-space: pre-wrap;
}

.detail-section textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

.detail-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.detail-images img {
    max-width: 200px;
    max-height: 200px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    object-fit: cover;
}

.detail-images img:hover {
    border-color: #667eea;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.loading {
    text-align: center;
    color: #888;
    padding: 40px;
}

/* 响应式设计 */
@media (max-width: 768px) {

    .container,
    .dashboard-main {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }

    .filter-section {
        flex-direction: column;
    }

    .cases-list {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}