/* 曹主任爱学习论文小网站 - 移动端样式 */
:root {
    --primary: #2f9e6b;
    --primary-dark: #1e7a51;
    --primary-light: #e4f3ea;
    --bg: #e9f3ed;
    --card-bg: #f5faf7;
    --text: #20302a;
    --text-muted: #5c6b63;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    max-width: 640px;
    margin: 0 auto;
    min-height: 100vh;
}

/* 导航栏 - 蓝色渐变 */
.navbar {
    max-width: 640px;
    margin: 0 auto;
    background: linear-gradient(135deg, #2f9e6b 0%, #1e7a51 100%) !important;
}

/* 粉色装饰符号（仅抬头使用） */
.pink-deco {
    color: #ffc1d8;
    font-size: 0.95em;
}

.navbar-brand {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 状态栏 */
.status-bar {
    background: var(--primary-light);
    padding: 6px 16px;
    font-size: 0.78rem;
    color: var(--primary);
    text-align: center;
}

/* 页面切换 */
.page { display: none; padding: 0; }
.page.active { display: block; }

/* 搜索栏 */
.search-bar {
    padding: 10px 12px;
    background: #f5faf7;
    border-bottom: 1px solid #e8eaed;
    position: sticky;
    top: 56px;
    z-index: 10;
}
.search-bar .input-group-text { border-right: 0; }
.search-bar .form-control { border-left: 0; }
.search-bar .form-control:focus { box-shadow: none; border-color: #dee2e6; }

/* 分类模式切换 */
.category-mode-toggle {
    display: flex;
    padding: 6px 12px;
    gap: 8px;
    background: #f5faf7;
    border-bottom: 1px solid #e8eaed;
}
.mode-btn {
    flex: 1;
    padding: 6px 10px;
    border: 1.5px solid #c2d7f5;
    border-radius: 8px;
    background: #f5faf7;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 分类标签 */
.category-tabs {
    display: flex;
    overflow-x: auto;
    padding: 8px 12px;
    gap: 8px;
    background: #f5faf7;
    border-bottom: 1px solid #e8eaed;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
    flex-shrink: 0;
    padding: 5px 14px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: #f5faf7;
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.cat-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 按日期模式：下拉选择器 */
.date-select {
    flex: 1;
    min-width: 160px;
    max-width: 320px;
    padding: 7px 12px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: #f5faf7;
    color: var(--text-color);
    font-size: 0.86rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.date-select:focus { border-color: var(--primary); }

/* 论文列表 */
.paper-list { padding: 8px 0 80px; }

.paper-card {
    background: var(--card-bg);
    margin: 8px 12px;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    border-left: 3px solid transparent;
}
.paper-card:active { transform: scale(0.98); }
.paper-card:hover { box-shadow: 0 2px 8px rgba(26,115,232,0.15); }

.paper-card .p-journal {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.paper-card .p-title-cn {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text);
    margin-bottom: 4px;
}

.paper-card .p-title-en {
    font-size: 0.82rem;
    color: #5a6573;
    line-height: 1.4;
    margin-bottom: 5px;
}
.paper-card .p-title-cn.trans-pending {
    color: var(--text-muted);
    font-weight: 500;
    font-style: italic;
}

/* 没翻译：单行英文原文 + 小提示 */
.paper-card .p-title-cn.p-title-pending {
    color: var(--text);
    font-weight: 700;
    margin-bottom: 2px;
}
.paper-card .p-trans-tip {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.paper-card .p-trans-tip i {
    font-size: 0.78rem;
    color: var(--primary);
}

.paper-card .p-abstract {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.paper-card .p-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

/* 标签统一蓝色系 */
.paper-card .p-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
}
.paper-card .p-tag.research { background: var(--primary-light); color: var(--primary-dark); }
.paper-card .p-tag.ai { background: var(--primary-light); color: var(--primary-dark); }
.paper-card .p-tag.score { background: var(--primary-light); color: var(--primary-dark); }

/* 期刊IF标签 */
.paper-card .p-if {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: #e4f3ea;
    color: var(--primary-dark);
    white-space: nowrap;
}
.paper-card .p-if.high { background: var(--primary-light); color: var(--primary-dark); }
.paper-card .p-if.top { background: var(--primary-dark); color: white; }

/* 详情页IF标签 */
.detail-if {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary-dark);
    white-space: nowrap;
}

.paper-card .p-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 详情页 */
.detail-header { padding: 12px 16px 0; }
#detailContent { padding: 0 16px 80px; }

.detail-title-cn {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 6px;
}

.detail-title-en {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 12px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.detail-tag {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 12px;
}
.detail-tag.disease { background: var(--primary-light); color: var(--primary); }
.detail-tag.research { background: var(--primary-light); color: var(--primary-dark); }

.detail-section {
    background: #f5faf7;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.detail-section h6 {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-section p {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0;
    white-space: pre-wrap;
}

/* 详情各板块统一蓝色左边框 */
.detail-section.ai-summary { border-left: 3px solid var(--primary); }
.detail-section.translation { border-left: 3px solid var(--primary); }
.detail-section.advice { border-left: 3px solid var(--primary); }
.detail-section.clinical { border-left: 3px solid var(--primary); }
.detail-section.inspiration { border-left: 3px solid var(--primary); }

.detail-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.8;
}
.detail-meta strong { color: var(--text); }

/* 加载动画 */
.spinner-border { width: 2rem; height: 2rem; }

/* AI按钮 */
.ai-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 12px;
}
.ai-btn:disabled { opacity: 0.6; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; }

/* 底部安全区 */
.paper-list::after, #detailContent::after {
    content: '';
    display: block;
    height: 40px;
}

/* 工具类 */
.d-none { display: none !important; }

/* ==================== 电子木鱼功德组件 ==================== */
.muyu-widget {
    position: fixed;
    right: 14px;
    bottom: 18px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.muyu-merit {
    background: rgba(255,255,255,0.96);
    border: 1.5px solid var(--primary);
    border-radius: 14px;
    padding: 2px 10px;
    margin-bottom: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.muyu-merit-label { font-size: 0.7rem; color: var(--text-muted); }
.muyu-merit-num { font-size: 1.05rem; font-weight: 800; color: var(--primary); }
.muyu-btn {
    background: linear-gradient(135deg, #e8a85a 0%, #c8853f 100%);
    border: 3px solid #8a5a22;
    border-radius: 50%;
    width: 78px; height: 78px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.22);
    transition: transform 0.08s ease;
    position: relative;
    padding: 0;
}
.muyu-btn:active { transform: scale(0.9); }
.muyu-btn .muyu-fish { width: 48px; height: 42px; display: block; }
.muyu-btn .muyu-tip {
    font-size: 0.62rem;
    color: #5a3a12;
    margin-top: 1px;
    font-weight: 700;
    line-height: 1;
}
.muyu-float {
    position: fixed;
    right: 46px;
    bottom: 112px;
    color: #b8742a;
    font-weight: 800;
    font-size: 1.15rem;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
    pointer-events: none;
    opacity: 0;
}
.muyu-float.show { animation: muyuFloat 0.85s ease-out; }
@keyframes muyuFloat {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50px) scale(1.1); }
}
@media (max-width: 640px) {
    .muyu-btn { width: 68px; height: 68px; }
    .muyu-btn .muyu-fish { width: 42px; height: 36px; }
    .muyu-float { right: 40px; bottom: 100px; }
}

/* ==================== 新增组件样式 ==================== */
/* 日期分组标题 */
.date-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 12px 14px 4px;
    padding-bottom: 4px;
    border-bottom: 1px dashed #c2d7f5;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.85rem;
}
.date-header small {
    font-weight: 500;
    font-size: 0.7rem;
    color: #c8853f;
}

/* JAAD 特殊案例标签（暖金色，区别于蓝色系） */
.paper-card .p-tag.jaad { background: #fff3e0; color: #c8853f; border: 1px solid #ffd9a8; }
.detail-tag.jaad { background: #fff3e0 !important; color: #c8853f !important; border: 1px solid #ffd9a8; }

/* 每日一签 */
.daily-quote {
    margin: 8px 12px;
    background: linear-gradient(135deg, #eaf3ff 0%, #f3e9ff 100%);
    border: 1px solid #d7c2ef;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.daily-quote .dq-mark {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8a5a22;
    white-space: nowrap;
    flex-shrink: 0;
}
.daily-quote .dq-text {
    font-size: 0.8rem;
    color: #444;
    line-height: 1.4;
    flex: 1;
}
.daily-quote .dq-refresh {
    font-size: 0.9rem;
    color: var(--primary);
    flex-shrink: 0;
}

/* 樱花飘落背景 */
.sakura-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.sakura-petal {
    position: absolute;
    top: -24px;
    will-change: transform, opacity;
    animation-name: sakuraFall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
@keyframes sakuraFall {
    0%   { transform: translateY(-24px) translateX(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.8; }
    100% { transform: translateY(105vh) translateX(40px) rotate(360deg); opacity: 0.15; }
}
