@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* 核心色彩 - 项目专员端采用充满活力的翡翠绿，象征协助与执行 */
    --primary-gradient: linear-gradient(135deg, #2BA471 0%, #17A05D 100%);
    --bg-gradient: radial-gradient(circle at top right, #F0F9F4 0%, #F5F7FA 100%);
    
    --primary-color: #2BA471;
    --primary-light: #EAF7F1;
    --primary-soft: rgba(43, 164, 113, 0.08);
    
    --success-color: #2BA471;
    --warning-color: #E37318;
    --danger-color: #D54941;
    --info-color: #0052D9;
    
    --text-main: #1D2129;
    --text-secondary: #4E5969;
    --text-muted: #86909C;
    
    /* 玻璃拟态效果 */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(20px);
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 48px rgba(43, 164, 113, 0.12);
    
    --safe-area-bottom: env(safe-area-inset-bottom);
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, system-ui, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

/* 容器 */
.container {
    padding: 20px;
    padding-bottom: calc(100px + var(--safe-area-bottom));
}

/* 顶部导航栏 */
.header {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
}

.header h1 { font-size: 18px; font-weight: 700; flex: 1; text-align: center; }

.back-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-soft);
    border-radius: 50%;
    color: var(--primary-color);
    cursor: pointer;
}

/* 列表卡片设计 */
.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

/* 统计小方格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stats-item {
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
}

.stats-value { font-size: 20px; font-weight: 700; color: var(--primary-color); }
.stats-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* 网格入口 */
.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.action-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    transition: transform 0.2s;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

.action-btn:active .action-icon { transform: scale(0.92); }

.action-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* 颜色变体 */
.bg-green { background: linear-gradient(135deg, #2BA471 0%, #17A05D 100%); }
.bg-blue { background: linear-gradient(135deg, #0052D9 0%, #003EB3 100%); }
.bg-orange { background: linear-gradient(135deg, #FF9F43 0%, #FF6B00 100%); }
.bg-purple { background: linear-gradient(135deg, #7367F0 0%, #4E44BD 100%); }
.bg-teal { background: linear-gradient(135deg, #00CFE8 0%, #0097A7 100%); }
.bg-rose { background: linear-gradient(135deg, #EA5455 0%, #B22222 100%); }

/* 任务列表项 */
.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--glass-border);
}

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

.priority-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}
.priority-high { background: #FDEEEE; color: #D54941; }
.priority-med { background: #FFF2E6; color: #E37318; }
.priority-low { background: #EAF7F1; color: #2BA471; }

/* 异常/警示状态全局标注 - 增强版 */
.is-abnormal {
    background: #FFF2F0 !important;
    border: 1.5px solid #FFCCC7 !important;
    box-shadow: 0 4px 15px rgba(213, 73, 65, 0.12) !important;
    position: relative;
    overflow: hidden;
}

.is-abnormal::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: #D54941;
}

/* 针对不同容器的微调 */
.todo-item.is-abnormal {
    margin: 8px -20px;
    padding: 16px 20px;
    border-radius: 12px;
    border-bottom: none;
}

.patient-list-card.is-abnormal, .task-card.is-abnormal {
    border-width: 1px;
    border-style: solid;
}

.todo-info { flex: 1; }
.todo-title { font-size: 14px; font-weight: 600; color: var(--text-main); }
.todo-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.todo-action {
    padding: 6px 12px;
    background: var(--primary-soft);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* 数据报表增强样式 */
.report-item-v2 {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: all 0.2s;
}
.report-item-v2:active {
    background-color: rgba(0,0,0,0.02);
    transform: scale(0.99);
}
.report-item-v2:last-child { border-bottom: none; }

.file-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.05);
}

.report-info {
    flex: 1;
}
.report-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}
.report-meta {
    display: flex;
    gap: 6px;
    align-items: center;
}
.report-tag {
    font-size: 10px;
    padding: 1px 6px;
    background: #F0F2F5;
    color: var(--text-muted);
    border-radius: 4px;
    font-weight: 500;
}

.download-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 16px;
    transition: all 0.2s;
    border: 1px solid rgba(43, 164, 113, 0.1);
}
.download-btn:active {
    transform: scale(0.85);
    background: var(--primary-color);
    color: white;
}

/* 底部 Tab 栏 */
.tab-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-width: 500px;
    margin: 0 auto;
    height: calc(64px + var(--safe-area-bottom));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    padding-bottom: var(--safe-area-bottom);
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-muted);
    font-size: 11px;
    text-decoration: none;
}

.tab-item.active { color: var(--primary-color); font-weight: 600; }
.tab-icon { font-size: 22px; margin-bottom: 2px; }

/* 动画 */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-up { animation: slideUp 0.5s ease-out forwards; }

.badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--danger-color); color: white;
    font-size: 10px; padding: 2px 5px; border-radius: 10px;
    min-width: 18px; text-align: center;
}

/* 统一标题样式 */
.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    margin: 32px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 12px;
    position: relative;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.section-title span {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-color);
    background: var(--primary-soft);
    padding: 2px 10px;
    border-radius: 10px;
}

.hidden { display: none !important; }
