/* 全局样式 */
:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #E8F5E9;
    --secondary-color: #2196f3;
    --secondary-light: #bbdefb;
    --tertiary-color: #ff9800;
    --danger-color: #f44336;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #E0E0E0;
    --background-color: #f8f9fa;
    --gray-light: #F5F5F5;
    --gray: #9E9E9E;
    --gray-dark: #616161;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    background-color: var(--gray-light);
    margin: 0;
    padding: 0;
    font-size: 16px;
}

/* 适合老年人的文字样式 */
.text-large {
    font-size: 18px;
}

.text-xl {
    font-size: 20px;
}

.text-xxl {
    font-size: 24px;
}

/* 通用组件样式 */
.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--background-color);
}

.content-container {
    flex: 1;
    padding: 16px;
}

/* 标题栏 */
.header {
    background-color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

/* 底部导航 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--gray);
    font-size: 12px;
    text-decoration: none;
}

.tab-item.active {
    color: var(--primary-color);
}

.tab-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.tab-label {
    font-size: 14px;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* 按钮样式 */
.btn {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.1s ease, transform 0.1s ease;
}

.btn:active {
    background-color: var(--primary-dark);
    transform: scale(0.98);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-tertiary {
    background-color: var(--tertiary-color);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:active {
    background-color: var(--primary-light);
}

.btn-large {
    font-size: 18px;
    padding: 14px 24px;
}

.btn-full {
    width: 100%;
}

/* 输入框样式 */
.input-group {
    margin-bottom: 16px;
}

.input-label {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 16px;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--primary-color);
    outline: none;
}

.input-focused {
    border-color: var(--primary-color);
}

/* 列表样式 */
.list {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.list-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-icon {
    margin-right: 16px;
    font-size: 24px;
    color: var(--primary-color);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.list-item-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.list-item-right {
    color: var(--gray);
    display: flex;
    align-items: center;
}

/* 图标样式 */
.icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-large {
    width: 32px;
    height: 32px;
    font-size: 20px;
}

.icon-circle {
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.badge-danger {
    background-color: #ffebee;
    color: var(--danger-color);
}

.badge-warning {
    background-color: #fff3e0;
    color: var(--warning-color);
}

.badge-success {
    background-color: #e8f5e9;
    color: var(--success-color);
}

/* 辅助类 */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--secondary-color);
}

.text-tertiary {
    color: var(--tertiary-color);
}

.text-danger {
    color: var(--danger-color);
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

/* 健康数据显示 */
.health-data-card {
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.health-data-value {
    font-size: 32px;
    font-weight: bold;
    margin-right: 8px;
}

.health-data-unit {
    font-size: 16px;
    color: var(--text-secondary);
}

.health-data-title {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.health-data-icon {
    margin-right: 16px;
    font-size: 28px;
}

/* 状态指示器 */
.status-normal {
    color: var(--success-color);
}

.status-warning {
    color: var(--warning-color);
}

.status-danger {
    color: var(--danger-color);
}

/* 特殊按钮 */
.emergency-button {
    background-color: var(--danger-color);
    color: white;
    padding: 16px;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* 健康日历 */
.calendar {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-title {
    font-size: 18px;
    font-weight: bold;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    text-align: center;
    padding: 8px;
    border-radius: 8px;
}

.calendar-day.active {
    background-color: var(--primary-color);
    color: white;
}

.calendar-day.has-event {
    position: relative;
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

/* 药品提醒样式 */
.medication-card {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.medication-icon {
    width: 48px;
    height: 48px;
    background-color: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.medication-icon i {
    font-size: 24px;
    color: var(--primary-color);
}

.medication-content {
    flex: 1;
}

.medication-name {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}

.medication-time {
    font-size: 14px;
    color: var(--text-secondary);
}

.medication-dosage {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 500;
}

/* 进度条样式 */
.progress-bar {
    height: 8px;
    background-color: var(--primary-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 底部安全区域 - 适配iPhone刘海屏 */
.safe-area-bottom {
    height: env(safe-area-inset-bottom, 0);
    background-color: white;
}

/* 顶部安全区域 - 适配iPhone刘海屏 */
.safe-area-top {
    height: env(safe-area-inset-top, 0);
    background-color: white;
}

/* 页面过渡动画 */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s, transform 0.3s;
}

.page-exit {
    opacity: 1;
}

.page-exit-active {
    opacity: 0;
    transition: opacity 0.3s;
}

/* 特殊样式 - 专为老年人设计 */
.high-contrast-text {
    font-weight: 500;
}

.touch-target {
    min-height: 44px; /* 按照无障碍标准，触摸目标至少44x44pt */
}

/* 消息提示 */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 16px;
    z-index: 1000;
}

/* 引导提示 */
.tutorial-tip {
    background-color: var(--primary-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.tutorial-tip-title {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.tutorial-tip-content {
    color: var(--text-secondary);
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 36px;
    height: 36px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 用于辅助识别的状态颜色 */
.color-normal { color: #4caf50; }
.color-caution { color: #ff9800; }
.color-warning { color: #f44336; }
.bg-normal { background-color: #e8f5e9; }
.bg-caution { background-color: #fff3e0; }
.bg-warning { background-color: #ffebee; }

/* 突出显示重要信息 */
.highlight-box {
    background-color: #fff9c4;
    border-left: 4px solid #fbc02d;
    padding: 16px;
    margin: 16px 0;
    border-radius: 8px;
}

/* 适配不同设备 */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
        margin: 0 auto;
    }
}

/* 老年人友好的滚动条 */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 无障碍焦点样式 */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* iPhone状态栏 */
.status-bar {
    height: 44px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 14px;
}

.status-bar-time {
    font-weight: 500;
}

.status-bar-icons {
    display: flex;
    align-items: center;
}

.status-bar-icon {
    margin-left: 6px;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1); }
    100% { transform: scale(1); }
} 