/* 首页兼容的CSS变量 */
:root {
    --card-bg: #ffffff;
    --text-muted: #64748b;
}

:root[data-theme="dark"] {
    --card-bg: #1e293b;
    --text-muted: #94a3b8;
}

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

body {
    background-color: var(--color-bg);
    min-height: 100vh;
}

/* ==================== 导航条样式 ==================== */
.navbar {
    background-color: var(--color-bg);
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.navbar-brand {
    display: flex;
    margin: 10px auto;
    align-items: center;
    transform: rotate(-4deg);
}

.navbar-brand a {
    display: flex;
    align-items: center;
    width: 100%;
    height: 80px;
}

.navbar-brand a img {
    width: 250px;
    filter: drop-shadow(2px 2px 1px var(--color-shadow));
}

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

/* ==================== 区块标题 ==================== */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-text);
}

/* 标题包装器 - 用于标题和提示图标的布局 */
.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
}

/* 标题包装器内的标题，移除底部margin */
.section-title-wrapper .section-title {
    margin-bottom: 0;
}

/* ==================== 学习足迹区域 ==================== */
.stats-section {
    margin-bottom: 64px;
    padding-top: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-card-inner {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

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

.stat-card-link:hover .stat-icon-bg {
    color: rgba(0, 0, 0, 0.06);
    transform: rotate(-15deg) scale(1.05);
}

::root[data-theme="dark"] .stat-card-link:hover .stat-icon-bg {
    color: rgba(255, 255, 255, 0.05);
}

.stat-card-inner .stat-icon-bg {
    position: absolute;
    right: 38px;
    font-size: 100px;
    color: rgba(0, 0, 0, 0.04);
    pointer-events: none;
    user-select: none;
    transform: rotate(-15deg);
    z-index: 0;
}

.stat-card-inner .stat-label {
    font-size: 0.9rem;
    color: var(--color-text);
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.stat-card-inner .stat-arrow {
    font-size: 1.4rem;
    color: #4CAF50;
    opacity: 0.6;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.stat-card-link:hover .stat-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* ==================== 累计成就区域 ==================== */
.achievement-section {
    margin-bottom: 64px;
}

/* 累计阅读卡片 - 参考首页样式 */
.level-card {
    background: var(--color-surface);
    border: 1px solid #4CAF50;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

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

.level-header {
    display: flex;
    align-items: stretch;
    gap: 16px;
}

.level-badge {
    height: auto;
    width: auto;
    max-height: 86px;
    flex-shrink: 0;
    align-self: center;
}

.level-progress-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-next {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.level-next-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.next-label {
    font-size: 0.75rem;
    color: #8e8e8e;
}

.next-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4CAF50;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #CDDC39 0%, #8BC34A 50%, #4CAF50 100%);
    border-radius: 3px;
    transition: width 1s ease-out;
}

/* 暗色模式 */
::root[data-theme="dark"] .stat-card-inner .stat-icon-bg {
    color: rgba(255, 255, 255, 0.03);
}

::root[data-theme="dark"] .stat-card-inner .stat-label {
    color: #e0e0e0;
}

/* 暗色模式 */
::root[data-theme="dark"] .level-card {
    background: var(--color-bg);
    border-color: #71ef74;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

::root[data-theme="dark"] .level-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

::root[data-theme="dark"] .next-value {
    color: #66BB6A;
}

::root[data-theme="dark"] .progress-fill {
    background: linear-gradient(90deg, #DCE775 0%, #9CCC65 50%, #66BB6A 100%);
}

/* 其他成就卡片 */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.achievement-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.achievement-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.achievement-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(76, 175, 80, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.achievement-icon .material-symbols-outlined {
    font-size: 20px;
    color: #4CAF50;
}

::root[data-theme="dark"] .achievement-icon {
    background: linear-gradient(135deg, rgba(102, 187, 106, 0.15) 0%, rgba(102, 187, 106, 0.08) 100%);
}

::root[data-theme="dark"] .achievement-icon .material-symbols-outlined {
    color: #66BB6A;
}

.achievement-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.achievement-label {
    font-size: 0.75rem;
    color: #8e8e8e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.achievement-value {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.achievement-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.achievement-unit {
    font-size: 0.7rem;
    font-weight: 400;
    color: #888888;
}

::root[data-theme="dark"] .achievement-num {
    color: #ffffff;
}

::root[data-theme="dark"] .achievement-unit {
    color: #999999;
}

/* ==================== 打卡日历区域 ==================== */
.calendar-section {
    margin-bottom: 64px;
    background: var(--color-surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.section-header {
    margin-bottom: 0;
}

/* 今日快照 */
.today-snapshot {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
}

/* 今日快照滚动提示 */
.today-snapshot.show-scroll-hint::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to left, var(--color-surface), transparent);
    pointer-events: none;
    z-index: 10;
    animation: scrollHintPulse 2s ease-in-out infinite;
}

.today-snapshot.show-scroll-hint::before {
    content: '›››';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 14px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 11;
    animation: scrollHintPulse 2s ease-in-out infinite;
}

.snapshot-metric {
    padding: 10px 16px 10px 20px;
    background: var(--color-surface);
    border-radius: 0;
    position: relative;
}

.snapshot-metric::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #4CAF50;
    border-radius: 0 2px 2px 0;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.snapshot-metric .metric-label {
    font-size: 0.8rem;
    color: #8e8e8e;
    font-weight: 500;
}

.metric-value-row {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.snapshot-metric .metric-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.snapshot-metric .metric-unit {
    font-size: 0.65rem;
    color: #8e8e8e;
    font-weight: 400;
}

/* 暗色模式优化 */
::root[data-theme="dark"] .snapshot-metric {
    background: var(--color-bg);
}

::root[data-theme="dark"] .snapshot-metric::before {
    background: #66BB6A;
}

/* 热力图容器 */
.heatmap-wrapper {
    width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    position: relative;
}

/* 热力图滚动提示 - 显示在左侧，因为内容滚动到最右边 */
.heatmap-wrapper.show-scroll-hint::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(to right, var(--color-surface), transparent);
    pointer-events: none;
    z-index: 10;
    animation: scrollHintPulse 2s ease-in-out infinite;
}

.heatmap-wrapper.show-scroll-hint::before {
    content: '‹‹‹';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 18px;
    font-weight: 300;
    opacity: 0.5;
    pointer-events: none;
    z-index: 11;
    animation: scrollHintPulse 2s ease-in-out infinite;
}

/* 固定定位的滚动提示元素 - 热力图（左侧提示）*/
.fixed-scroll-hint-heatmap {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: none;
}

.fixed-scroll-hint-heatmap.show {
    opacity: 1;
}

.fixed-scroll-hint-heatmap .scroll-hint-gradient {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: linear-gradient(to right, var(--color-surface), transparent);
    animation: scrollHintPulse 2s ease-in-out infinite;
}

.fixed-scroll-hint-heatmap .scroll-hint-arrow {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #000;
    font-size: 28px;
    font-weight: 300;
    opacity: 1;
    animation: none;
}

::root[data-theme="dark"] .fixed-scroll-hint-heatmap .scroll-hint-arrow {
    color: #fff;
}

/* 固定定位的滚动提示元素 - 今日快照（右侧提示）*/
.fixed-scroll-hint-today {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: none;
}

.fixed-scroll-hint-today.show {
    opacity: 1;
}

.fixed-scroll-hint-today .scroll-hint-gradient {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: linear-gradient(to left, var(--color-surface), transparent);
    animation: scrollHintPulse 2s ease-in-out infinite;
}

.fixed-scroll-hint-today .scroll-hint-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #000;
    font-size: 28px;
    font-weight: 300;
    opacity: 1;
    animation: none;
}

::root[data-theme="dark"] .fixed-scroll-hint-today .scroll-hint-arrow {
    color: #fff;
}

/* 美化滚动条 */
.heatmap-wrapper::-webkit-scrollbar {
    height: 8px;
}

.heatmap-wrapper::-webkit-scrollbar-track {
    background: var(--color-bg);
    border-radius: 4px;
}

.heatmap-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.heatmap-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* 热力图图例 - 固定在右下角 */
.calendar-section {
    position: relative;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 8px 12px;
    background: var(--color-surface);
    border-radius: 6px;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
    margin-top: 10px;
    align-self: flex-end;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: help;
    position: relative;
}

.legend-color-box {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

/* PC端显示完整文字 */
.legend-text-full {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

/* 暗色模式下的图例 */
::root[data-theme="dark"] .heatmap-legend {
    background: var(--color-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

::root[data-theme="dark"] .legend-text-full {
    color: #aaa;
}

:root[data-theme="dark"] .legend-color-box {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 深色模式下图例未打卡颜色 */
:root[data-theme="dark"] .legend-item:first-child .legend-color-box {
    background-color: #1a1a1a !important;
}

/* ==================== 图例 Tooltip 样式 ==================== */

.legend-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    min-width: max-content;
    max-width: 180px;
    padding: 8px 12px;
    background-color: var(--card-bg);
    color: var(--color-text);
    font-size: 0.75rem;
    line-height: 1.4;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    pointer-events: none;
    white-space: nowrap;
    text-align: center;
}

.legend-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* 移动端点击显示 tooltip */
@media (hover: none) {
    .legend-tooltip {
        cursor: pointer;
    }

    .legend-tooltip.active::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) scale(1);
    }
}

/* 移动端隐藏图例 */
@media (max-width: 768px) {
    .heatmap-legend {
        display: none;
    }
}

/* 添加移动端文字的data属性 */
.legend-item:first-child .legend-text-full {
    --mobile-text: "少";
}

.legend-item:last-child .legend-text-full {
    --mobile-text: "多";
}

.heatmap-container {
    width: 1400px;
    height: 220px;
}

/* ==================== 阅读趋势区域 ==================== */
.trend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.trend-header .section-title {
    margin-bottom: 0;
}

.trend-tabs.history-tabs {
    display: inline-flex;
    gap: 3px;
    background: rgba(0, 0, 0, 0.05);
    padding: 5px;
    border-radius: 16px;
}

:root[data-theme="dark"] .trend-tabs.history-tabs {
    background: rgba(255, 255, 255, 0.1);
}

.trend-tabs.history-tabs .history-tab {
    border: none;
    background: transparent;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 1.03rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.trend-tabs.history-tabs .history-tab.active {
    background: var(--card-bg);
    color: var(--color-text);
    box-shadow: 0 2px 4px var(--color-shadow);
}

.trend-section {
    margin-bottom: 48px;
    background: var(--color-surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.trend-section .chart-container {
    width: 100%;
    height: 280px;
}

/* ==================== 其他样式（保留） ==================== */
.review-section {
    margin-bottom: 32px;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.review-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--color-surface);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

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

.review-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(76, 175, 80, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.review-icon img {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(51%) sepia(36%) saturate(7273%) hue-rotate(83deg) brightness(94%) contrast(89%);
}

.review-icon .material-symbols-outlined {
    font-size: 22px;
    color: #4CAF50;
}

.review-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.review-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.review-desc {
    font-size: 0.8rem;
    color: #8e8e8e;
}

.review-arrow {
    font-size: 1.2rem;
    color: #4CAF50;
    font-weight: 600;
}

.checkin-section {
    margin-bottom: 32px;
    background: var(--color-surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.checkin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.checkin-tabs {
    display: flex;
    gap: 4px;
    background: var(--color-bg);
    padding: 4px;
    border-radius: 10px;
}

.checkin-tab {
    border: none;
    background: transparent;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.checkin-tab.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.checkin-tab:hover:not(.active) {
    color: var(--color-text);
}

.checkin-content {
    min-height: 100px;
}

.checkin-panel {
    display: none;
}

.checkin-panel.active {
    display: block;
}

.checkin-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.checkin-item-card {
    background: var(--color-bg);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

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

.checkin-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(76, 175, 80, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checkin-item-icon .material-symbols-outlined {
    font-size: 20px;
    color: #4CAF50;
}

.checkin-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.checkin-item-label {
    font-size: 0.75rem;
    color: #8e8e8e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checkin-item-value {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.checkin-value-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
}

.checkin-value-unit {
    font-size: 0.75rem;
    font-weight: 400;
    color: #888;
}

.checkin-total-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkin-total-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.checkin-empty {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: center;
    padding: 32px 0;
}

.checkin-empty::before {
    content: "📊";
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}

.chart-section {
    margin-bottom: 32px;
    background: var(--color-surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.no-data-tip {
    font-size: 0.8rem;
    color: var(--color-warning);
    font-style: italic;
}

.chart-container {
    height: 280px;
    width: 100%;
}

.more-stats-section {
    margin-bottom: 32px;
    background: var(--color-surface);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.coming-soon {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-top: 10px;
}

/* Tooltip样式 */
.tip-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tip-wrapper img {
    width: 16px;
    height: 16px;
    display: block;
}

.tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-bg);
    color: var(--color-text);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
    z-index: 100;
    min-width: 120px;
    max-width: 250px;
    text-align: center;
    line-height: 1.3;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: var(--color-border) transparent transparent transparent;
}

.tip-wrapper:hover .tooltip {
    opacity: 1;
    pointer-events: auto;
}

/* 昵称编辑输入框 */
.nickname-input {
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    font-size: 1.2rem;
    color: var(--color-text);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.nickname-input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
    outline: none;
    background-color: var(--color-bg);
}

/* 抖动动画 */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

.error {
    border: 2px solid var(--color-warning);
    animation: shake 0.3s ease;
}

.display-none {
    display: none;
}

/* ==================== 动画效果 ==================== */

/* 滚动提示呼吸灯效果 */
@keyframes scrollHintPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

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

.stat-card-inner {
    animation: fadeInUp 0.4s ease-out;
}

.stat-card-inner:nth-child(1) { animation-delay: 0s; }
.stat-card-inner:nth-child(2) { animation-delay: 0.05s; }
.stat-card-inner:nth-child(3) { animation-delay: 0.1s; }
.stat-card-inner:nth-child(4) { animation-delay: 0.15s; }

/* ==================== 响应式设计 ==================== */

/* 数据更新提示 */
.data-update-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    padding: 12px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    opacity: 0.7;
}

.data-update-note .material-symbols-outlined {
    font-size: 18px;
}

@media (max-width: 768px) {
    .journey-container {
        padding: 16px;
    }



    .journey-header {
        padding: 20px 16px;
        margin-bottom: 24px;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card-inner {
        padding: 14px 16px;
        gap: 8px;
    }

    .stat-card-inner .stat-icon-bg {
        font-size: 52px;
        right: 26px;
        bottom: -6px;
    }

    .stat-card-inner .stat-label {
        font-size: 0.85rem;
    }

    .stat-card-inner .stat-arrow {
        font-size: 1.2rem;
    }

    .level-card {
        padding: 14px;
    }

    .level-badge {
        max-height: 100px;
    }

    .next-label {
        font-size: 0.7rem;
    }

    .next-value {
        font-size: 0.8rem;
    }

    .level-header {
        gap: 12px;
    }

    .achievement-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .achievement-card {
        padding: 12px 14px;
    }

    .achievement-icon {
        width: 32px;
        height: 32px;
    }

    .achievement-icon .material-symbols-outlined {
        font-size: 18px;
    }

    .achievement-num {
        font-size: 1.1rem;
    }

    .achievement-label {
        font-size: 0.7rem;
    }

    .calendar-section {
        padding: 16px;
    }

    .today-snapshot {
        flex-wrap: nowrap;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 4px 4px 4px;
        justify-content: flex-start;
    }

    /* 移动端今日快照滚动提示调整 */
    .today-snapshot.show-scroll-hint::before {
        right: 12px;
        font-size: 12px;
    }

    .today-snapshot.show-scroll-hint::after {
        width: 30px;
    }

    /* 移动端热力图滚动提示调整 - 左侧显示 */
    .heatmap-wrapper.show-scroll-hint::before {
        left: 8px;
        font-size: 14px;
    }

    .heatmap-wrapper.show-scroll-hint::after {
        width: 40px;
    }

    .snapshot-metric {
        flex: 0 0 auto;
    }

    .snapshot-metric .metric-label {
        font-size: 0.65rem;
    }

    .snapshot-metric .metric-num {
        font-size: 1rem;
    }

    .snapshot-metric .metric-unit {
        font-size: 0.6rem;
    }

    .heatmap-wrapper {
        overflow-x: auto;
    }



    .trend-section {
        padding: 12px 0px;
    }

    .trend-header {
        margin-bottom: 20px;
    }

    .trend-tabs.history-tabs {
        padding: 3px;
        border-radius: 14px;
        gap: 5px;
    }

    .trend-tabs.history-tabs .history-tab {
        padding: 4px 10px;
        font-size: 0.75rem;
        border-radius: 10px;
    }

    .trend-section .chart-container {
        height: 200px;
    }

    .chart-section {
        padding: 16px;
    }

    .chart-container {
        height: 220px;
    }

    .more-stats-section {
        padding: 24px 16px;
    }

    /* 移动端tooltip优化 */
    .tip-wrapper .tooltip {
        position: fixed !important;
        bottom: auto !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 280px !important;
        width: 90% !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
        min-width: auto !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        text-align: center !important;
    }

    .tip-wrapper .tooltip::after {
        display: none !important;
    }

    .tip-wrapper {
        position: relative;
    }

    .tip-wrapper .tooltip {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .tip-wrapper.tapped .tooltip {
        opacity: 1;
        visibility: visible;
    }

    .tip-wrapper .tooltip.auto-hiding {
        animation: fadeOut 0.4s ease-out forwards;
    }

    @keyframes fadeOut {
        0% { opacity: 1; visibility: visible; }
        70% { opacity: 1; visibility: visible; }
        100% { opacity: 0; visibility: hidden; }
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.3rem;
    }

    .stats-grid {
        gap: 8px;
    }

    .stat-card-inner {
        padding: 12px 14px;
    }

    .stat-card-inner .stat-icon-bg {
        font-size: 48px;
        right: 22px;
        bottom: -4px;
    }

    .stat-card-inner .stat-label {
        font-size: 0.8rem;
    }

    .stat-card-inner .stat-arrow {
        font-size: 1.1rem;
    }

    .next-label {
        font-size: 0.65rem;
    }

    .next-value {
        font-size: 0.75rem;
    }

    .achievement-metrics {
        gap: 10px;
    }

    .metric-value {
        font-size: 1.1rem;
    }

    .heatmap-wrapper {
        overflow-x: auto;
    }

    .trend-section .chart-container {
        height: 180px;
    }

    .chart-container {
        height: 200px;
    }
}

/* 大屏幕优化 */
@media (min-width: 1200px) {
    .journey-container {
        padding: 24px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .checkin-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .trend-section .chart-container {
        height: 320px;
    }
}

/* 侧边栏按钮隐藏（小屏幕） */
@media screen and (max-width: 768px) {
    .sidebar-toggle-btn {
        display: none !important;
    }
}

/* ==================== 英文模式字体调整 ==================== */
html[lang="en"] .stat-card-inner .stat-label {
    font-size: 1rem;
}

html[lang="en"] .next-label {
    font-size: 0.85rem;
}

html[lang="en"] .next-value {
    font-size: 0.95rem;
}

html[lang="en"] .snapshot-metric .metric-label {
    font-size: 0.8rem;
}

html[lang="en"] .snapshot-metric .metric-unit {
    font-size: 0.75rem;
}

/* 英文模式移动端字体 */
@media (max-width: 768px) {
    html[lang="en"] .stat-card-inner .stat-label {
        font-size: 0.95rem;
    }

    html[lang="en"] .next-label {
        font-size: 0.8rem;
    }

    html[lang="en"] .next-value {
        font-size: 0.9rem;
    }

    html[lang="en"] .snapshot-metric .metric-label {
        font-size: 0.75rem;
    }

    html[lang="en"] .snapshot-metric .metric-unit {
        font-size: 0.7rem;
    }
}

/* ==================== 标题提示图标 ==================== */
.section-tip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    cursor: help;
    position: relative;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.section-tip-icon:hover {
    color: var(--color-text);
}

.section-tip-icon .material-symbols-outlined {
    font-size: 18px;
}

/* Tooltip 样式 */
.section-tip-icon::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    min-width: max-content;
    max-width: 200px;
    padding: 8px 12px;
    background-color: var(--card-bg);
    color: var(--color-text);
    font-size: 0.8rem;
    line-height: 1.4;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.section-tip-icon:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* 移动端点击显示 tooltip */
@media (hover: none) {
    .section-tip-icon {
        cursor: pointer;
    }

    .section-tip-icon.active::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) scale(1);
    }
}
