/* ========== 全局样式 ========== */
* {
*     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;
*                             background: #f0f2f5;
*                                 color: #333;
*                                     line-height: 1.6;
*                                     }
*
*                                     a {
*                                         color: #1890ff;
*                                             text-decoration: none;
*                                             }
*
*                                             a:hover {
*                                                 color: #40a9ff;
*                                                 }
*
*/* ========== 导航栏 ========== */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .brand {
    color: white;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar .brand .icon {
    font-size: 24px;
}

.navbar .nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.navbar .nav-links a {
    color: rgba(255, 255, 255, 0.85);
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 14px;
}

.navbar .nav-links a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.navbar .user-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-right: 10px;
}

/* ========== 容器 ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.container-sm {
    max-width: 500px;
    margin: 0 auto;
    padding: 24px;
}

/* ========== 闪现消息 ========== */
.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash.success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.flash.error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.flash.info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}

/* ========== 卡片 ========== */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 首页 ========== */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: -24px -24px 30px;
    border-radius: 0 0 30px 30px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 16px;
    font-weight: 700;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-buttons .btn {
    padding: 14px 36px;
    font-size: 16px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.feature-card {
    text-align: center;
    padding: 30px 20px;
}

.feature-card .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.feature-card p {
    color: #666;
    font-size: 14px;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.form-group label .required {
    color: #ff4d4f;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
}

.form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

select.form-control {
    appearance: auto;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #faad14 0%, #d48806 100%);
    color: white;
}

.btn-warning:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff4d4f 0%, #cf1322 100%);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: white;
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-white {
    background: white;
    color: #667eea;
    border: none;
    font-weight: 600;
}

.btn-white:hover {
    background: rgba(255,255,255,0.9);
    color: #764ba2;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

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

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.intake::before {
    background: linear-gradient(90deg, #52c41a, #95de64);
}

.stat-card.output::before {
    background: linear-gradient(90deg, #faad14, #ffd666);
}

.stat-card.balance::before {
    background: linear-gradient(90deg, #1890ff, #69c0ff);
}

.stat-card.balance-negative::before {
    background: linear-gradient(90deg, #ff4d4f, #ff7875);
}

.stat-card .stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-card.intake .stat-value {
    color: #52c41a;
}

.stat-card.output .stat-value {
    color: #faad14;
}

.stat-card.balance .stat-value {
    color: #1890ff;
}

.stat-card.balance-negative .stat-value {
    color: #ff4d4f;
}

.stat-card .stat-unit {
    font-size: 14px;
    font-weight: 400;
    color: #999;
    margin-left: 2px;
}

/* ========== 表格 ========== */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

table tr:hover {
    background: #f9f9ff;
}

table tr:last-child td {
    border-bottom: none;
}

/* ========== 类型标签 ========== */
.type-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.type-tag.intake {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.type-tag.output {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

/* ========== 日期选择 ========== */
.date-picker-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}

.date-picker-bar label {
    font-weight: 500;
    font-size: 14px;
    color: #555;
}

.date-picker-bar input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
}

.date-picker-bar input[type="date"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* ========== 双栏布局 ========== */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ========== 分类统计 ========== */
.type-stat-list {
    list-style: none;
    padding: 0;
}

.type-stat-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.type-stat-list li:last-child {
    border-bottom: none;
}

.type-stat-list .type-name {
    font-size: 14px;
    color: #333;
}

.type-stat-list .type-amount {
    font-size: 14px;
    font-weight: 600;
}

/* ========== 趋势图简单样式 ========== */
.trend-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 200px;
    padding: 20px 0;
    justify-content: space-around;
}

.trend-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.trend-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 150px;
}

.trend-bar {
    width: 20px;
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.5s;
}

.trend-bar.intake-bar {
    background: linear-gradient(180deg, #95de64, #52c41a);
}

.trend-bar.output-bar {
    background: linear-gradient(180deg, #ffd666, #faad14);
}

.trend-date {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.trend-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.trend-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}

.trend-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.trend-legend-dot.intake {
    background: #52c41a;
}

.trend-legend-dot.output {
    background: #faad14;
}

/* ========== 病人列表(医生端) ========== */
.patient-row {
    cursor: pointer;
    transition: background 0.2s;
}

.patient-row:hover {
    background: #f0f5ff !important;
}

.bed-badge {
    display: inline-block;
    background: #e6f7ff;
    color: #1890ff;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #91d5ff;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #bbb;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 13px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
        height: auto;
        flex-direction: column;
        padding: 12px 16px;
        gap: 8px;
    }

    .navbar .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .container {
        padding: 16px;
    }

    .hero {
        padding: 50px 16px;
        margin: -16px -16px 20px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 15px;
    }

    .two-columns {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .date-picker-bar {
        flex-direction: column;
        align-items: stretch;
    }

    table th, table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .trend-bar {
        width: 14px;
    }
}
