/* PMH Portal 前端样式 */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.pmh-frontend-page,
body.pmh-login-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f3f4f6;
    color: #111827;
    line-height: 1.6;
}

/* 登录页面样式 */
.pmh-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f5f5f5;
}

.pmh-login-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.pmh-login-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.pmh-login-header {
    background: white;
    color: #2c3e50;
    padding: 35px 30px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.pmh-login-header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.pmh-login-header p {
    font-size: 18px;
    color: #7f8c8d;
    margin-top: 10px;
}

.pmh-login-content {
    padding: 30px;
}

.pmh-login-content form {
    margin: 0;
}

.pmh-login-content label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.pmh-login-content input[type="text"],
.pmh-login-content input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

.pmh-login-content input[type="text"]:focus,
.pmh-login-content input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.pmh-login-content input[type="checkbox"] {
    margin-right: 5px;
}

.pmh-login-content input[type="submit"] {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.pmh-login-content input[type="submit"]:hover {
    transform: translateY(-2px);
}

.pmh-success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
}

/* 容器 */
.pmh-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* 顶部导航 */
.pmh-navbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.pmh-navbar-brand {
    display: flex;
    align-items: center;
    height: 100%;
    overflow: hidden;
}

.pmh-navbar-brand a {
    display: flex;
    align-items: center;
    height: 100%;
}

.pmh-navbar-brand img {
    height: 60px;
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

.pmh-navbar-brand h1 {
    font-size: 20px;
    color: #667eea;
    font-weight: 700;
}

.pmh-navbar-menu {
    display: flex;
    gap: 5px;
}

.pmh-nav-link {
    padding: 8px 16px;
    color: #6b7280;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.pmh-nav-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.pmh-nav-link.active {
    background: #ede9fe;
    color: #667eea;
}

.pmh-navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.pmh-user-role {
    background: #ede9fe;
    color: #667eea;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.pmh-btn-logout {
    color: #dc2626;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.pmh-btn-logout:hover {
    background: #fef2f2;
}

/* 主内容区 */
.pmh-main-content {
    padding: 30px;
}

.pmh-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.pmh-page-header h2 {
    font-size: 28px;
    color: #111827;
    margin-bottom: 5px;
}

.pmh-subtitle {
    color: #6b7280;
    font-size: 14px;
}

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

.pmh-stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pmh-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pmh-stat-icon {
    font-size: 36px;
}

.pmh-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
}

.pmh-stat-label {
    font-size: 14px;
    color: #6b7280;
}

.pmh-stat-supervisor {
    border-left: 4px solid #667eea;
}

/* 卡片 */
.pmh-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pmh-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #111827;
}

.pmh-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.pmh-card-header h3 {
    margin-bottom: 0;
}

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

.pmh-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pmh-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pmh-btn-secondary {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.pmh-btn-secondary:hover {
    background: #f9fafb;
}

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

/* 快捷操作 */
.pmh-quick-actions {
    margin-top: 30px;
}

.pmh-quick-actions h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #111827;
}

.pmh-action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.pmh-action-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: #111827;
}

.pmh-action-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pmh-action-icon {
    font-size: 32px;
}

.pmh-action-text {
    font-weight: 600;
}

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

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

.pmh-table thead {
    background: #f9fafb;
}

.pmh-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.pmh-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.pmh-table tbody tr:hover {
    background: #f9fafb;
}

/* 模态框 */
.pmh-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pmh-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.pmh-modal-header h3 {
    font-size: 18px;
    color: #111827;
}

.pmh-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.pmh-modal-close:hover {
    background: #f3f4f6;
}

.pmh-modal-body {
    padding: 24px;
}

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

.pmh-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.pmh-form-group small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

.pmh-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.pmh-input:focus {
    outline: none;
    border-color: #667eea;
}

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

.pmh-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Checkbox组 */
.pmh-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pmh-checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pmh-checkbox-label:hover {
    background: #f9fafb;
    border-color: #667eea;
}

.pmh-checkbox-label input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Lambert 图表 */
.pmh-chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
}

.pmh-chart-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 16px;
}

.pmh-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.pmh-legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

/* v5.6.5: 虚线图例样式（用于临床分界） */
.pmh-legend-line {
    display: inline-block;
    width: 20px;
    height: 2px;
    background-image: repeating-linear-gradient(
        to right,
        rgba(107, 114, 128, 0.6) 0px,
        rgba(107, 114, 128, 0.6) 4px,
        transparent 4px,
        transparent 8px
    );
}

/* 提示信息 */
.pmh-hint {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

.pmh-info-banner {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    color: #1e40af;
}

.pmh-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 20px 0;
}

.pmh-success {
    background: #d1fae5;
    border: 1px solid #10b981;
    padding: 16px;
    border-radius: 6px;
    color: #065f46;
}

/* 空状态 */
.pmh-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

.pmh-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

.pmh-error {
    background: #fee2e2;
    border: 1px solid #dc2626;
    padding: 16px;
    border-radius: 6px;
    color: #991b1b;
    text-align: center;
}

/* 已分配列表 */
.pmh-assigned-list h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.pmh-simple-list {
    list-style: none;
    padding: 0;
}

.pmh-simple-list li {
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 14px;
    color: #374151;
}

/* 响应式 */
@media (max-width: 768px) {
    .pmh-navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
    }
    
    .pmh-navbar-menu {
        width: 100%;
        order: 3;
        margin-top: 12px;
    }
    
    .pmh-main-content {
        padding: 16px;
    }
    
    .pmh-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .pmh-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .pmh-form-row {
        grid-template-columns: 1fr;
    }
    
    .pmh-modal-content {
        max-width: 100%;
    }
}
