:root {
    --primary: #FF4D4D;
    --primary-light: #FFEDED;
    --secondary: #E6F7FF;
    --text: #333;
    --text-muted: #666;
    --bg: #F9FAFB;
    --white: #FFFFFF;
    
    --excellent: #52c41a;
    --fair: #1890ff;
    --poor: #faad14;
    --critical: #f5222d;

    /* 病历卡片专用 - 借鉴 demo-package */
    --card-gradient: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    --card-shadow: 0 10px 30px rgba(45, 52, 54, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
    background: var(--primary-light);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(255, 77, 77, 0.1);
}

.logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.tagline {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: 10px;
    border-left: 1px solid #ddd;
    padding-left: 10px;
}

nav {
    display: flex;
    align-items: center;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.btn-install {
    background: var(--primary);
    color: var(--white) !important;
    padding: 10px 20px;
    border-radius: 50px;
    transition: transform 0.2s, background 0.3s;
}

.btn-install:hover {
    transform: scale(1.05);
    background: #FF3333;
}

/* Sections */
section {
    padding: 60px 0;
    scroll-margin-top: 100px; /* 补偿吸顶 header 的高度 */
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 40px;
    text-align: center;
}

/* Stats */
.stats-section {
    background: linear-gradient(135deg, var(--primary), #FF7A7A);
    color: var(--white);
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

.stats-section::before,
.stats-section::after {
    position: absolute;
    font-size: 140px;
    opacity: 0.15;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    line-height: 1;
    mix-blend-mode: soft-light;
    filter: brightness(1.8) contrast(1.2);
}

.stats-section::before {
    content: "🦞";
    top: -10px;
    left: -10px;
    transform: rotate(-20deg);
}

.stats-section::after {
    content: "🏥";
    bottom: -20px;
    right: -10px;
    transform: rotate(15deg);
}

.stats-section .container {
    position: relative;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 600px;
    margin: 0 auto;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.25);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.2);
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 4px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
}

/* Marquee */
.marquee-container {
    background: var(--secondary);
    padding: 12px 0;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 1px solid #BDE3FF;
}

.marquee {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 30s linear infinite;
    font-size: 14px;
    font-weight: 600;
    color: #005A94;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* Symptoms Grid */
.symptoms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.symptom-card {
    background: var(--white);
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.03);
    border: 2px solid transparent;
    transition: all 0.3s;
}

.symptom-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-light);
    box-shadow: 0 15px 40px rgba(255, 77, 77, 0.1);
}

.symptom-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.symptom-card h3 {
    margin-bottom: 12px;
    color: var(--text);
}

.symptom-card p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Records Wall - 病历卡片部分借鉴 demo-package */
.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.filters select {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #ddd;
    outline: none;
    font-size: 14px;
}

.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    min-height: 400px;
}

/* ==================== 病历墙与卡片样式 ==================== */
.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    min-height: 400px;
}

.record-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: cardAppear 0.5s ease-out backwards;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    min-height: 320px; /* 最小高度 */
    max-height: 500px; /* 最大高度 */
    cursor: pointer;
}

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.record-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.record-header {
    padding: 18px 20px;
    background: var(--card-gradient);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.record-avatar {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.record-info {
    flex: 1;
}

.record-title {
    font-weight: 700;
    font-size: 15px;
    display: block;
}

.record-time {
    font-size: 11px;
    opacity: 0.85;
}

.health-badge {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

.record-body {
    padding: 22px 22px 10px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
    overflow: hidden; /* 防止溢出 */
}

.report-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-section label {
    font-size: 13px;
    font-weight: 800;
    color: #1A1A1A;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-section label::before {
    content: "";
    width: 3px;
    height: 14px;
    background: #E0E0E0;
    border-radius: 10px;
}

.condition-msg {
    font-size: 14px;
    color: #4A4A4A;
    line-height: 1.6;
    padding-left: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 5; /* 限制显示行数，可根据需要调整 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.6em; /* 至少显示一行 */
}

.prescription-section {
    background: #F7F8FA;
    padding: 10px 14px; /* 减小内边距 */
    border-radius: 12px;
    min-height: 40px; /* 降低最小高度 */
    display: flex;
    flex-direction: column;
    margin-top: auto;
}

.prescription-section label { color: var(--primary); font-size: 12px; } /* 缩小标签字体 */
.prescription-section label::before { background: var(--primary); height: 12px; }

.prescription-msg {
    font-size: 13px; /* 略微缩小文字 */
    color: #1A1A1A;
    font-weight: 600;
    margin-top: 2px; /* 减小间距 */
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0 10px 0; /* 调整内边距适应沉底 */
    border-top: 1px solid #F0F0F0;
    margin-top: 8px; /* 与处方框保持微小间距 */
}

.health-score-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 14px;
}

.score-excellent { color: var(--excellent); }
.score-fair { color: var(--fair); }
.score-poor { color: var(--poor); }
.score-critical { color: var(--critical); }

.discharge-stamp {
    font-size: 14px; /* 增大字体 */
    padding: 4px 12px; /* 增加内边距 */
    border: 2.5px solid #ccc; /* 加粗边框 */
    color: #ccc;
    border-radius: 6px;
    font-weight: 900;
    text-transform: uppercase;
    transform: rotate(-12deg); /* 稍微增加旋转角度 */
    letter-spacing: 1px; /* 增加字间距 */
    white-space: nowrap;
    opacity: 0.8;
}

.stamp-excellent { border-color: var(--excellent); color: var(--excellent); }
.stamp-fair { border-color: var(--fair); color: var(--fair); }
.stamp-poor { border-color: var(--poor); color: var(--poor); }
.stamp-critical { border-color: var(--critical); color: var(--critical); }

/* ==================== 模态框样式 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 30px;
    padding: 40px;
    position: relative;
    transform: translateY(30px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 30px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover { color: var(--primary); }

.modal-record-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.modal-avatar-large {
    font-size: 50px;
    background: #F8F9FA;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
}

.modal-header-info h2 { font-size: 24px; margin: 0; }
.modal-header-info p { color: #999; margin-top: 5px; }

.modal-divider { height: 1px; background: #eee; margin-bottom: 30px; }
.modal-section { margin-bottom: 25px; }
.modal-section h3 { font-size: 13px; color: #999; margin-bottom: 12px; text-transform: uppercase; }
.modal-text-content { font-size: 16px; line-height: 1.8; color: #333; }
.prescription-highlight { background: var(--primary-light); color: #d00; padding: 15px; border-radius: 12px; font-weight: 600; }
.modal-footer-stats { display: flex; gap: 10px; margin-top: 30px; }
.stat-pill { background: #F8F9FA; padding: 6px 12px; border-radius: 8px; font-size: 12px; color: #999; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.pagination button {
    padding: 8px 24px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: var(--white);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Install Section - Minimalist Style */
.install-section {
    background-color: var(--bg);
    padding: 60px 0;
}

.minimal-install-card {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.minimal-install-card p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.shortcut-copy-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 12px 12px 12px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.shortcut-copy-box:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.shortcut-copy-box code {
    color: #334155;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 20px;
}

.copy-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: #FF3333;
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: #10b981;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
    background: #fff;
    border-top: 1px solid #eee;
}

.footer-info {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.footer-link:hover {
    color: #FF3333;
    text-decoration: underline;
}

.separator {
    color: #ddd;
    margin: 0 5px;
}

.author, .xiaohongshu, .welcome {
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 992px) {
    .records-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    header .container {
        padding: 0 20px;
    }

    .tagline {
        display: none; /* 在移动端隐藏口号以节省空间 */
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 84px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 30px;
        gap: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 100;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .nav-links a {
        font-size: 18px;
        width: 100%;
        text-align: center;
        padding: 10px;
    }

    .btn-install {
        width: 200px;
        margin: 0 auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .section-title {
        font-size: 24px;
    }

    .shortcut-copy-box {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }

    .shortcut-copy-box code {
        margin-right: 0;
        width: 100%;
        text-align: center;
        white-space: normal;
        word-break: break-all;
    }

    .copy-btn {
        width: 100%;
    }

    .modal-content {
        padding: 25px;
        width: 95%;
    }

    .modal-record-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .modal-avatar-large {
        width: 60px;
        height: 60px;
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 20px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .records-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .filters {
        width: 100%;
    }

    .filters select {
        width: 100%;
    }

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