/* ========================================
   "护航"医院免陪护系统 - 合并样式表
   ======================================== */

/* ========== 全局重置和变量 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1E3A8A;
    --primary-light: #3B82F6;
    --primary-dark: #1E40AF;
    --secondary-color: #059669;
    --secondary-light: #10B981;
    --danger-color: #DC2626;
    --warning-color: #F59E0B;
    --success-color: #10B981;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --text-white: #FFFFFF;
    --bg-primary: #F9FAFB;
    --bg-white: #FFFFFF;
    --bg-light: #F3F4F6;
    --bg-dark: #111827;
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* ========== 容器 ========== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ========== 卡片样式 ========== */
.card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* ========== 按钮样式 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-white);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-white);
}

.btn-danger:hover {
    background: #B91C1C;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-small {
    padding: 8px 20px;
    font-size: 14px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ========== 表单样式 ========== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-input, .form-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--bg-white);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* ========== 导航栏 ========== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.navbar-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
}

.navbar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.navbar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.navbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ========== 标签/徽章 ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }

/* ========== 列表样式 ========== */
.list-item {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin-bottom: 4px;
}

.list-item:hover {
    background-color: var(--bg-light);
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    background: var(--bg-light);
}

/* ========== 登录页面样式 ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 50%, #1E40AF 100%);
    padding: 20px;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>');
    opacity: 0.3;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

.role-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    background: var(--bg-light);
    padding: 6px;
    border-radius: 12px;
}

.role-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-weight: 600;
}

.role-tab:hover {
    color: var(--primary-color);
    background: rgba(30, 58, 138, 0.05);
}

.role-tab.active {
    color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-sm);
}

/* ========== 页面头部 ========== */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 48px 24px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>');
    opacity: 0.3;
}

.page-header-content {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.page-subtitle {
    font-size: 17px;
    opacity: 0.95;
}

/* ========== 视图切换 ========== */
.view-page {
    display: none;
}

.view-page.active {
    display: block;
}

/* ========== 服务按钮 ========== */
.service-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.service-btn {
    padding: 28px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.service-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.service-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.service-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-title {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-change {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========== 患者/警报卡片 ========== */
.patient-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.patient-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.patient-name {
    font-size: 18px;
    font-weight: 600;
}

.patient-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.alert-item {
    padding: 20px;
    background: white;
    border-left: 4px solid var(--warning-color);
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
}

.alert-item.urgent {
    border-left-color: var(--danger-color);
    background: linear-gradient(90deg, #FEF2F2 0%, white 100%);
}

.alert-info { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 4px; }
.alert-time { font-size: 14px; color: var(--text-secondary); }

/* ========== 呼叫任务 ========== */
.call-task {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
}

.call-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.call-type { font-size: 18px; font-weight: 600; }
.call-time { font-size: 14px; color: var(--text-secondary); }
.call-patient { margin-top: 8px; font-size: 14px; color: var(--text-secondary); }

/* ========== 实时消息接收区域 ========== */
.message-receive-card {
    position: relative;
    overflow: hidden;
}

.message-receive-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}

.message-receive-card.nurse-messages::before {
    background: linear-gradient(90deg, #E74C3C, #F39C12);
}

.message-receive-card.caregiver-messages::before {
    background: linear-gradient(90deg, #50C878, #4A90E2);
}

.message-receive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.message-receive-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #FAFBFC;
}

.message-receive-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: messageSlideIn 0.3s ease;
}

.message-receive-item:last-child { border-bottom: none; }
.message-receive-item:hover { background: white; }
.message-receive-item.new-message {
    background: linear-gradient(90deg, #FEF3C7 0%, #FFFBEB 100%);
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.message-content { flex: 1; }
.message-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.message-detail { font-size: 14px; color: var(--text-secondary); }
.message-time { font-size: 13px; color: var(--text-light); margin-left: 12px; }
.message-empty { padding: 40px 20px; text-align: center; color: var(--text-secondary); }
.message-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

.message-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.message-type-badge.urgent { background: #FEE2E2; color: #DC2626; }
.message-type-badge.infusion { background: #FEF3C7; color: #D97706; }
.message-type-badge.service { background: #D1FAE5; color: #059669; }

/* ========== 健康图表 ========== */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.health-chart-card {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.health-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.health-chart-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.health-current-value { font-size: 22px; font-weight: 700; color: var(--primary-color); }
.health-chart-container { height: 120px; width: 100%; margin-bottom: 8px; }
.health-chart-svg { width: 100%; height: 100%; }
.health-chart-path { fill: none; stroke: var(--primary-color); stroke-width: 2.5; stroke-linecap: round; }
.health-chart-area { fill: var(--primary-color); fill-opacity: 0.1; }
.health-chart-point { fill: var(--primary-color); stroke: white; stroke-width: 2; }
.health-chart-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-light); }

/* ========== 支付相关 ========== */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.payment-method {
    padding: 24px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.payment-method:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.payment-method.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.05) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.payment-icon { font-size: 32px; margin-bottom: 8px; }
.payment-name { font-weight: 500; }

.payment-info {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.payment-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.payment-info-item:last-child { border-bottom: none; }
.info-label { font-size: 14px; color: var(--text-secondary); }
.info-value { font-size: 15px; font-weight: 600; }

.password-input {
    width: 100%;
    padding: 16px;
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-light);
}

.password-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text { font-size: 14px; color: var(--text-secondary); text-align: center; }

/* ========== 订单相关 ========== */
.order-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.order-card:hover {
    box-shadow: var(--shadow-md);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.order-number { font-size: 16px; font-weight: 600; }

.order-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.order-status.pending { background: #FEF3C7; color: #92400E; }
.order-status.paid { background: #D1FAE5; color: #065F46; }
.order-status.completed { background: #DBEAFE; color: #1E40AF; }

.order-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.order-item { display: flex; flex-direction: column; gap: 4px; }
.order-item-label { font-size: 12px; color: var(--text-secondary); }
.order-item-value { font-size: 15px; font-weight: 600; }

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.order-time { font-size: 13px; color: var(--text-secondary); }
.order-actions { display: flex; gap: 8px; }

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-text { font-size: 16px; }

/* ========== 开关 ========== */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--success-color); }
input:checked + .slider:before { transform: translateX(26px); }

/* ========== 工具类 ========== */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--secondary-color); }
.text-danger { color: var(--danger-color); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }

/* ========== 动画 ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 12px;
        height: auto;
        padding: 16px 20px;
    }
    .navbar-actions { flex-wrap: wrap; justify-content: center; }
    .container { padding: 20px 16px; }
    .login-card { padding: 32px 24px; }
    .page-header { padding: 32px 20px; }
    .page-title { font-size: 28px; }
    .card { padding: 24px 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .health-grid { grid-template-columns: 1fr; }
}
