/* 医护移动端样式 - doctor.css */

/* 基础变量 */
:root {
    --primary-color: #1890FF;
    --primary-gradient: linear-gradient(135deg, #1890FF 0%, #096DD9 100%);
    --success-color: #52C41A;
    --warning-color: #FAAD14;
    --error-color: #F5222D;
    --urgent-color: #FF4D4F;

    /* 预警等级色彩 */
    --level-normal: #52C41A;
    --level-mild: #FAAD14;
    --level-moderate: #FF7A45;
    --level-severe: #F5222D;
    --level-critical: #FF4D4F;

    /* 中性色 */
    --text-primary: #262626;
    --text-secondary: #595959;
    --text-tertiary: #8C8C8C;
    --text-disabled: #BFBFBF;
    --border-color: #D9D9D9;
    --divider-color: #F0F0F0;
    --bg-color: #F5F5F5;
    --bg-white: #FFFFFF;
}

/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue',
                 Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-color);
}

/* 容器 */
.doctor-container {
    max-width: 414px;
    margin: 0 auto;
    background: var(--bg-color);
    min-height: 100vh;
    padding-bottom: 50px;
}

/* 顶部导航栏 */
.doctor-navbar {
    height: 44px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    max-width: 414px;
    margin: 0 auto;
}

.doctor-navbar-title {
    font-size: 18px;
    font-weight: 600;
}

.doctor-navbar-action {
    font-size: 16px;
    cursor: pointer;
}

/* 页面内容区域 */
.doctor-content {
    padding: 44px 0 0 0;
}

/* 头部信息区域（首页使用） */
.doctor-header {
    background: var(--primary-gradient);
    padding: 16px;
    color: white;
}

.doctor-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.doctor-header-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.doctor-header-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
}

.doctor-header-stat {
    text-align: center;
}

.doctor-header-stat-value {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.doctor-header-stat-label {
    font-size: 12px;
    opacity: 0.9;
}

/* 卡片 */
.doctor-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

.doctor-card-title {
    font-size: 16px;
    font-weight: 500;
}

.doctor-card-action {
    font-size: 14px;
    color: var(--primary-color);
    cursor: pointer;
}

/* 功能宫格 */
.doctor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px;
}

.doctor-grid-item {
    text-align: center;
    cursor: pointer;
}

.doctor-grid-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.doctor-grid-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 患者列表 */
.doctor-patient-list {
    padding: 0 16px;
}

.doctor-patient-item {
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

.doctor-patient-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.doctor-patient-info {
    flex: 1;
    min-width: 0;
}

.doctor-patient-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.doctor-patient-name {
    font-size: 16px;
    font-weight: 500;
}

.doctor-patient-tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.doctor-patient-detail {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.doctor-patient-status {
    display: flex;
    gap: 8px;
}

/* 预警卡片 */
.doctor-alert-card {
    background: #FFF1F0;
    border-left: 4px solid var(--error-color);
}

.doctor-alert-card.warning {
    background: #FFFBE6;
    border-left-color: var(--warning-color);
}

.doctor-alert-card.moderate {
    background: #FFF7E6;
    border-left-color: var(--level-moderate);
}

/* 标签 */
.doctor-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.doctor-tag.normal {
    background: #F6FFED;
    color: var(--success-color);
}

.doctor-tag.warning {
    background: #FFFBE6;
    color: var(--warning-color);
}

.doctor-tag.error {
    background: #FFF1F0;
    color: var(--error-color);
}

.doctor-tag.info {
    background: #E6F7FF;
    color: var(--primary-color);
}

/* 底部导航 */
.doctor-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 414px;
    margin: 0 auto;
    height: 50px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--divider-color);
    z-index: 1000;
}

.doctor-tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-tertiary);
}

.doctor-tabbar-item.active {
    color: var(--primary-color);
}

.doctor-tabbar-icon {
    font-size: 24px;
    position: relative;
}

.doctor-tabbar-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--error-color);
    color: white;
    border-radius: 10px;
    padding: 0 6px;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doctor-tabbar-label {
    font-size: 10px;
}

/* 按钮 */
.doctor-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    border: none;
    outline: none;
}

.doctor-btn-primary {
    background: var(--primary-color);
    color: white;
}

.doctor-btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.doctor-btn-danger {
    background: var(--error-color);
    color: white;
}

.doctor-btn-block {
    display: block;
    width: 100%;
}

/* 输入框 */
.doctor-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.doctor-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.doctor-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    outline: none;
}

.doctor-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 消息气泡 */
.doctor-message-list {
    padding: 12px 16px;
}

.doctor-message-item {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
}

.doctor-message-item.doctor {
    flex-direction: row-reverse;
}

.doctor-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.doctor-message-content {
    max-width: 70%;
}

.doctor-message-bubble {
    padding: 12px;
    border-radius: 12px;
    word-break: break-word;
}

.doctor-message-item.patient .doctor-message-bubble {
    background: #F5F5F5;
    color: var(--text-primary);
}

.doctor-message-item.doctor .doctor-message-bubble {
    background: var(--primary-color);
    color: white;
}

.doctor-message-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
    text-align: center;
}

/* 指标卡片 */
.doctor-indicator {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.doctor-indicator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.doctor-indicator-name {
    font-size: 14px;
    color: var(--text-secondary);
}

.doctor-indicator-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.doctor-indicator-value.abnormal {
    color: var(--error-color);
}

.doctor-indicator-range {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 时间轴 */
.doctor-timeline {
    padding: 0 16px;
}

.doctor-timeline-item {
    padding-left: 24px;
    position: relative;
    padding-bottom: 20px;
}

.doctor-timeline-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 6px;
    bottom: -6px;
    width: 2px;
    background: var(--divider-color);
}

.doctor-timeline-item:last-child::before {
    display: none;
}

.doctor-timeline-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.doctor-timeline-content {
    background: white;
    padding: 12px;
    border-radius: 8px;
}

/* 表单组 */
.doctor-form-group {
    margin-bottom: 16px;
}

.doctor-form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.doctor-form-required {
    color: var(--error-color);
    margin-right: 4px;
}

/* 空状态 */
.doctor-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-tertiary);
}

.doctor-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.doctor-empty-text {
    font-size: 14px;
}

/* 数据水印 */
.doctor-watermark {
    position: relative;
    overflow: hidden;
}

.doctor-watermark::after {
    content: attr(data-watermark);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 14px;
    color: rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* 统计数据 */
.doctor-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
}

.doctor-stat-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.doctor-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.doctor-stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.p-16 { padding: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
