/**
 * 老年肌少症营养干预与随访软件 - 自定义样式
 * 夕阳红色系：#E67E22 橙红、#D35400 深橙红、#FAD7A0 暖黄
 */

/* ========================================
   CSS变量定义
   ======================================== */
:root {
    --primary-color: #E67E22;
    --secondary-color: #D35400;
    --accent-color: #F39C12;
    --warm-yellow: #FAD7A0;
    --light-warm: #FEF5E7;
    --font-size-base: 16px;
}

/* ========================================
   全局样式
   ======================================== */
body {
    font-size: var(--font-size-base);
    line-height: 1.8;
    color: #333;
    background-color: #f8f9fa;
}

/* 大字体模式 */
body.font-large {
    --font-size-base: 20px;
}

body.font-large .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
}

body.font-large .form-control,
body.font-large .form-select {
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
}

/* ========================================
   导航栏样式
   ======================================== */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.4rem;
}

.nav-link {
    font-size: 1.1rem;
    padding: 0.75rem 1rem !important;
}

/* ========================================
   卡片样式
   ======================================== */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    background-color: var(--light-warm);
    border-bottom: 2px solid var(--warm-yellow);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* ========================================
   按钮样式
   ======================================== */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-size: 1.1rem;
    min-height: 44px; /* 老年友好触控区域 */
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
    min-height: 56px;
}

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

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: scale(1.02);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ========================================
   表单样式
   ======================================== */
.form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid #ddd;
    padding: 0.6rem 1rem;
    font-size: 1.1rem;
    min-height: 48px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(230, 126, 34, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

/* ========================================
   表格样式
   ======================================== */
.table {
    font-size: 1.05rem;
}

.table th {
    background-color: var(--light-warm);
    font-weight: 600;
    border-bottom: 2px solid var(--warm-yellow);
}

.table-hover tbody tr:hover {
    background-color: rgba(230, 126, 34, 0.05);
}

/* ========================================
   徽章样式
   ======================================== */
.badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    border-radius: 6px;
}

/* ========================================
   进度条样式
   ======================================== */
.progress {
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
}

/* ========================================
   警告框样式
   ======================================== */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-primary {
    background-color: rgba(230, 126, 34, 0.1);
    color: var(--secondary-color);
    border-left: 4px solid var(--primary-color);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
}

.alert-warning {
    background-color: rgba(243, 156, 18, 0.1);
    border-left: 4px solid var(--accent-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

/* ========================================
   页脚样式
   ======================================== */
footer {
    border-top: 3px solid var(--warm-yellow);
    margin-top: auto;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .table {
        font-size: 0.95rem;
    }
}

/* ========================================
   打印样式
   ======================================== */
@media print {
    .navbar,
    footer,
    .btn,
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        font-size: 14pt;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ========================================
   辅助类
   ======================================== */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* 圆角工具类 */
.rounded-lg {
    border-radius: 10px !important;
}

/* 阴影工具类 */
.shadow-sm-custom {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* 间距工具类 */
.mt-6 {
    margin-top: 4rem;
}

.mb-6 {
    margin-bottom: 4rem;
}

/* ========================================
   动画效果
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* ========================================
   加载动画
   ======================================== */
.spinner-border-primary {
    color: var(--primary-color);
}

/* ========================================
   空状态样式
   ======================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ========================================
   时间轴样式（用于随访记录）
   ======================================== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--warm-yellow);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid white;
}

/* ========================================
   统计数据卡片
   ======================================== */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 1rem;
    color: #666;
}

/* ========================================
   高对比度模式
   ======================================== */
body.high-contrast {
    --primary-color: #FF6600;
    --secondary-color: #CC3300;
    background-color: #000;
    color: #fff;
}

body.high-contrast .card {
    background-color: #222;
    border: 2px solid #444;
}

body.high-contrast .text-muted {
    color: #aaa !important;
}

body.high-contrast .form-control,
body.high-contrast .form-select {
    background-color: #333;
    border-color: #555;
    color: #fff;
}
