/* ============================================================
   page-index.css - 首页(现代简约风)专属样式
   加载在所有通用样式【之后】；复用 variables.css 主题变量，换主题仍生效。
   不删任何按钮/功能；只改外观。范围：头部+侧栏全页统一，正文区限定 #dashboardView。
   ============================================================ */

/* 字体：无外链，系统栈，更现代观感 */
.home-page {
    --pi-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    font-family: var(--pi-font);
}

/* ===== 背景：仅用主题底色（不覆盖用户可选背景图，背景图由 background.js 动态设置） ===== */

/* ==================== 顶部导航 ==================== */
.home-page .top-header {
    padding: 10px 24px !important;
    height: 48px !important;
    background: var(--card-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
/* 顶部不再显示应用名/图标（用户要求去掉，避免观感廉价） */

/* 主题切换：分段胶囊，保留原主题 */
.home-page #themeSwitcherInline {
    gap: 2px !important;
    padding: 3px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--app-bg);
}
.home-page .theme-btn-inline {
    border: none !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
    padding: 4px 11px !important;
    border-radius: 999px !important;
    font-size: 0.8rem !important;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.home-page .theme-btn-inline:hover { color: var(--text-primary) !important; }
.home-page .theme-btn-inline.active {
    background: var(--card-bg) !important;
    color: var(--theme-primary) !important;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}
.home-page .header-right .notification-btn,
.home-page .header-right .btn { border-radius: 10px !important; }

/* ==================== 主体布局 ==================== */
.home-page .main-layout { background: transparent; }
.home-page .content-area {
    padding: 24px 28px 40px !important;
}

/* ==================== 侧边栏 ==================== */
.home-page .sidebar-nav {
    padding: 18px 12px !important;
    background: var(--card-bg) !important;
    border-right: 1px solid var(--border-color) !important;
}
.home-page .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px !important;
    margin: 3px 0;
    border-radius: 11px;
    color: var(--text-secondary) !important;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.16s ease;
}
.home-page .nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.02rem;
    color: var(--text-secondary);
    transition: all 0.16s ease;
}
.home-page .nav-item:hover,
.home-page .nav-item.active {
    background: var(--hover-bg) !important;
    color: var(--theme-primary) !important;
}
.home-page .nav-item:hover i,
.home-page .nav-item.active i { color: var(--theme-primary); }
.home-page .nav-item.active { font-weight: 600; }

/* ===== 以下正文样式限定在首页 Dashboard 视图 ===== */

/* 页面标题 */
.home-page #dashboardView .view-header { margin-bottom: 22px; }
.home-page #dashboardView .view-header h2 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}
.home-page #dashboardView .view-header h2 i {
    color: var(--theme-primary);
    font-size: 1.3rem;
}

/* 欢迎卡片 */
.home-page #dashboardView .welcome-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-left: 4px solid var(--theme-primary) !important;
    border-radius: 14px !important;
    padding: 26px 30px !important;
    box-shadow: var(--shadow-sm) !important;
    margin-bottom: 22px !important;
}
.home-page #dashboardView .welcome-card .welcome-text h3 {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    letter-spacing: 0.3px;
}
.home-page #dashboardView .welcome-card .welcome-text p {
    color: var(--text-secondary) !important;
    font-size: 0.92rem !important;
    margin-top: 5px;
}
.home-page #dashboardView .welcome-stat {
    text-align: center;
    padding: 10px 20px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--card-bg) 60%, rgba(var(--theme-primary-rgb), 0.05));
    border: 1px solid var(--border-color);
}
.home-page #dashboardView .welcome-stat .stat-value {
    display: block;
    font-size: 1.9rem !important;
    font-weight: 800 !important;
    color: var(--theme-primary) !important;
}
.home-page #dashboardView .welcome-stat .stat-label {
    font-size: 0.82rem !important;
    color: var(--text-secondary) !important;
    margin-top: 2px;
}

/* 主 CTA（进入工作台） */
.home-page #dashboardView .pi-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 17px 24px;
    border: none;
    border-radius: 14px;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--theme-primary), color-mix(in srgb, var(--theme-primary) 78%, #8a7aff));
    box-shadow: 0 8px 22px rgba(var(--theme-primary-rgb), 0.30);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 18px;
    text-decoration: none;
}
.home-page #dashboardView .pi-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(var(--theme-primary-rgb), 0.38);
}
.home-page #dashboardView .pi-cta i { font-size: 0.95rem; opacity: 0.9; }

/* 统计卡片 */
.home-page #dashboardView .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px !important;
    margin-bottom: 24px !important;
}
.home-page #dashboardView .stat-card {
    display: flex !important;
    align-items: center;
    gap: 14px;
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    padding: 18px !important;
    box-shadow: var(--shadow-sm) !important;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-page #dashboardView .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md) !important;
}
.home-page #dashboardView .stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--theme-primary);
    background: color-mix(in srgb, var(--theme-primary) 14%, var(--card-bg));
    flex-shrink: 0;
}
.home-page #dashboardView .stat-card .stat-number {
    display: block;
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    line-height: 1.1;
}
.home-page #dashboardView .stat-card .stat-name {
    color: var(--text-secondary) !important;
    font-size: 0.84rem !important;
}

/* 分区块标题 */
.home-page #dashboardView .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 14px;
}
.home-page #dashboardView .section-title i { color: var(--theme-primary); }
.home-page #dashboardView .heatmap-section > h4,
.home-page #dashboardView .recent-section .section-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 14px;
}
.home-page #dashboardView .heatmap-section > h4 i,
.home-page #dashboardView .recent-section .section-header h4 i { color: var(--theme-primary); }

/* 热力图 + 最近编辑 */
.home-page #dashboardView .heatmap-section,
.home-page #dashboardView .recent-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.home-page #dashboardView .recent-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.home-page #dashboardView .recent-section .section-header h4 {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}
.home-page #dashboardView .recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.home-page #dashboardView .recent-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-weight: 600;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}
.home-page #dashboardView .recent-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}
.home-page #dashboardView .recent-table tbody tr { transition: background 0.15s ease; }
.home-page #dashboardView .recent-table tbody tr:hover { background: var(--table-hover); }
.home-page #dashboardView .recent-table tbody tr:last-child td { border-bottom: none; }
.home-page #dashboardView .recent-table .empty-hint { text-align: center; color: var(--text-secondary); padding: 30px 0 !important; }

/* 热力图微调 */
.home-page #dashboardView .heatmap-container .day-cell,
.home-page #dashboardView .heatmap-container td,
.home-page #dashboardView .heatmap-container .heat-cell { border-radius: 3px; }
