/* 首页样式 - 继承 member-common.css 统一规范 */

/* 首页导航栏扩展 - 搜索框布局 */
#nav-top {
    height: auto;
    padding: 12px 0;
}

#nav-top .nav-content {
    max-width: 1000px;
    flex-wrap: wrap;
    gap: 10px;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.nav-actions {
    display: flex;
    gap: 8px;
}

.nav-action {
    color: var(--text-inverse);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
    background: rgba(255,255,255,0.1);
    font-size: 14px;
}

.nav-action:hover, .nav-action:active {
    background: rgba(255,255,255,0.2);
}

/* 首页内容区 - 使用统一 main 规范 */
main {
    max-width: 1000px;
    margin: 16px auto 0;
    padding: 15px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    margin: 30px 0 16px;
    padding-left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    font-size: 18px;
}

.section-date {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 8px;
}

/* ==================== 历史上的今日好文推荐 ==================== */
.history-today-section {
    margin: 16px 0 0;
}

.history-today-section.hidden {
    display: none;
}

.history-today-shuffle {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-bg-light, rgba(93,137,166,0.08));
    border: 1px solid var(--primary-border, rgba(93,137,166,0.15));
    border-radius: 14px;
    padding: 3px 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.5;
}

.history-today-shuffle:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.history-today-shuffle i {
    font-size: 11px;
}

.history-today-card {
    display: flex;
    align-items: stretch;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px var(--primary-shadow);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.history-today-card:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 16px var(--primary-shadow-md);
    transform: translateY(-2px);
}

.history-today-badge {
    width: 90px;
    flex-shrink: 0;
    background: var(--primary-gradient, var(--primary));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    color: #fff;
    gap: 4px;
}

.history-today-badge-year {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.history-today-badge-label {
    font-size: 11px;
    opacity: 0.85;
    letter-spacing: 1px;
}

.history-today-body {
    flex: 1;
    min-width: 0;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.history-today-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-today-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.history-today-tag {
    display: inline-block;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--primary-bg-light, rgba(93,137,166,0.08));
    color: var(--primary);
    font-weight: 500;
    line-height: 1.6;
}

.history-today-meta .fa-pen-nib {
    margin-right: 2px;
    font-size: 11px;
}

.history-today-dot {
    opacity: 0.4;
}

.history-today-score .fa-medal {
    color: var(--accent-gold, #c4984a);
    margin-right: 2px;
    font-size: 11px;
}

.history-today-intro {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .history-today-badge {
        width: 76px;
        padding: 14px 8px;
    }
    .history-today-badge-year {
        font-size: 22px;
    }
    .history-today-body {
        padding: 12px 14px;
        gap: 5px;
    }
    .history-today-title {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .history-today-badge {
        width: 66px;
        padding: 12px 6px;
    }
    .history-today-badge-year {
        font-size: 20px;
    }
    .history-today-badge-label {
        font-size: 10px;
    }
    .history-today-body {
        padding: 10px 12px;
        gap: 4px;
    }
    .history-today-title {
        font-size: 14px;
    }
    .history-today-intro {
        font-size: 12px;
    }
}

/* 仪表板 - 6列网格：3个栏目各2列，排行榜/标签各3列 */
.dashboard {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.dashboard-card:hover {
    border-color: var(--primary-lighter);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.dashboard-card:active {
    transform: scale(0.998);
}

/* 栏目卡片 - 居中图标+文字，各占2列 */
.love-category {
    grid-column: span 2;
    padding: 18px 10px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.love-category i {
    color: var(--primary);
    font-size: 28px;
    margin-bottom: 8px;
}

.love-category p {
    margin: 0;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.today-update {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--primary);
    background: var(--primary-shadow);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 排行榜/标签/推文 - 各占2列，一行三个 */
.dashboard-card-link {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.dashboard-card-link h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.dashboard-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: var(--primary-shadow);
    color: var(--primary);
}

.dashboard-card-arrow {
    display: none;
}

/* 系统公告 */
.site-notice-bar {
    background: var(--primary);
    color: var(--text-inverse);
    padding: 12px 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px var(--primary-shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: noticeSlideIn 0.4s ease-out;
}

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

.site-notice-bar .notice-icon {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 14px;
    opacity: 0.9;
}

.site-notice-bar .notice-body {
    flex: 1;
    min-width: 0;
}

.site-notice-bar .notice-item {
    padding: 4px 0;
    font-size: 14px;
    line-height: 1.6;
}

.site-notice-bar .notice-item + .notice-item {
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 4px;
    padding-top: 8px;
}

.site-notice-bar .notice-item .nt-title {
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-notice-bar .notice-item .nt-title .nt-badge {
    display: inline-block;
    background: rgba(255,255,255,0.3);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.site-notice-bar .notice-item .nt-content {
    font-size: 13px;
    opacity: 0.9;
}

.site-notice-bar .notice-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.2s;
    line-height: 1;
}

.site-notice-bar .notice-close:hover {
    color: var(--text-inverse);
}

@media (max-width: 768px) {
    .site-notice-bar {
        margin: 0 0 14px;
        border-radius: 10px;
        padding: 10px 12px;
    }
}

/* 今日好文推荐网格 */
.recommend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.novel-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px var(--primary-shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.novel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px var(--primary-shadow-md);
    border-color: var(--primary);
}

.novel-skeleton {
    cursor: default;
    pointer-events: none;
}

.novel-skeleton:hover {
    transform: none;
    box-shadow: 0 2px 8px var(--primary-shadow);
    border-color: var(--border-color);
}

.novel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.novel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-sort {
    background: var(--primary-shadow);
    color: var(--primary);
}

.novel-author {
    font-size: 13px;
    color: var(--text-muted);
}

.novel-intro {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.novel-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tag-item {
    padding: 1px 7px;
    background: var(--primary-bg);
    color: var(--accent-color);
    border-radius: 4px;
    font-size: 11px;
}

.novel-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.novel-score {
    color: var(--primary);
    font-weight: 600;
}

.novel-score i {
    margin-right: 2px;
    font-size: 11px;
}

/* 最近阅读 */
.reading-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reading-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 2px 6px var(--primary-shadow);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s;
}

.reading-item:hover {
    transform: translateX(4px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-shadow-md);
}

.reading-progress-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) var(--progress), var(--border-light) var(--progress));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.reading-progress-ring::after {
    content: '';
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-card);
    position: absolute;
}

.reading-progress-text {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
    z-index: 1;
}

.reading-info {
    flex: 1;
    min-width: 0;
}

.reading-novel {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reading-chapter {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reading-meta {
    text-align: right;
    flex-shrink: 0;
}

.reading-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.reading-progress-bar {
    margin-top: 4px;
    height: 3px;
    background: var(--border-light);
    border-radius: 2px;
    width: 80px;
    margin-left: auto;
    overflow: hidden;
}

.reading-progress-fill {
    height: 100%;
    width: var(--progress, 0%);
    background: var(--primary);
    border-radius: 2px;
}

.reading-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 2px 6px var(--primary-shadow);
}

.reading-empty i {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

.reading-empty a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.reading-login-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 28px;
    background: var(--primary);
    color: #fff !important;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.reading-login-btn:hover {
    opacity: 0.85;
}

.reading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-row {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 2px 6px var(--primary-shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}

.skeleton-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--primary-border) 25%, var(--primary-bg) 50%, var(--primary-border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-lines {
    flex: 1;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary-border) 25%, var(--primary-bg) 50%, var(--primary-border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line-short {
    width: 60%;
    margin-top: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.empty-recommend {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: 10px;
}

/* 响应式 */
@media (max-width: 1024px) {
    .recommend-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #nav-top .nav-content {
        flex-direction: column;
    }
    .search-box {
        width: 100%;
        max-width: 100%;
    }
    .dashboard {
        gap: 10px;
    }
    .love-category {
        padding: 14px 8px;
    }
    .love-category i { font-size: 24px; }
    .love-category p { font-size: 13px; }
    .recommend-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .novel-card {
        padding: 14px;
    }
    .dashboard-card-link {
        padding: 12px 14px;
        gap: 10px;
    }
    .dashboard-card-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .dashboard {
        gap: 8px;
    }
    .love-category {
        padding: 12px 6px;
    }
    .love-category i { font-size: 22px; margin-bottom: 6px; }
    .love-category p { font-size: 12px; }
    .recommend-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* 主题切换面板 */
.theme-float-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: themePanelFadeIn 0.2s ease;
}
@keyframes themePanelFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.theme-float-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
}
.theme-float-content {
    position: relative;
    background: var(--bg-card);
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: themePanelSlideUp 0.3s ease;
}
@keyframes themePanelSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.theme-float-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--divider);
}
.theme-float-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.theme-float-header h3 i {
    margin-right: 8px;
    color: var(--primary);
}
.theme-float-close {
    width: 36px; height: 36px;
    border: none;
    background: var(--border-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
}
.theme-float-close:hover {
    background: var(--primary);
    color: var(--text-inverse);
}
.theme-float-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px 20px 20px;
}
.theme-float-option {
    border: 2px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
    background: var(--bg-card-hover);
}
.theme-float-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--primary-shadow);
}
.theme-float-option.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-shadow);
}
.theme-float-card-preview {
    height: 42px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-float-card-preview .theme-float-check {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}
.theme-float-option.active .theme-float-card-preview .theme-float-check {
    opacity: 1;
    transform: scale(1);
}
.theme-float-card-body {
    padding: 10px 6px 12px;
    text-align: center;
}
.theme-float-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.theme-float-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 400px) {
    .theme-float-content {
        width: 95%;
        border-radius: 16px;
    }
    .theme-float-options {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px 14px 16px;
    }
    .theme-float-card-preview {
        height: 36px;
    }
    .theme-float-card-body {
        padding: 8px 4px 10px;
    }
    .theme-float-card-name {
        font-size: 13px;
    }
    .theme-float-card-desc {
        font-size: 10px;
    }
}

/* ==================== 搜索框样式（从内联提取） ==================== */
.search-box form { position: relative; margin: 0 15px;}
.search-box input[name="q"] {
    width: 100%;
    padding: 8px 44px 8px 15px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    font-size: 14px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    outline: none;
}
.search-box input[name="q"]::placeholder {
    color: rgba(255,255,255,0.6);
}
.search-box button[type="submit"] {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-inverse);
    cursor: pointer;
    padding: 8px;
    font-size: 15px;
}

/* 骨架屏宽度变体 */
.skeleton-w55 { width: 55%; }
.skeleton-w60 { width: 60%; }
.skeleton-w65 { width: 65%; }
.skeleton-w70 { width: 70%; }
.skeleton-w75 { width: 75%; }
.skeleton-w80 { width: 80%; }
.skeleton-w100 { width: 100%; }

/* 骨架屏卡片行样式 */
.novel-skeleton .skeleton-line { margin-bottom: 4px; }
.novel-skeleton .skeleton-line:first-child { height: 18px; margin-bottom: 10px; }
.novel-skeleton .skeleton-line:nth-child(2) { height: 14px; margin-bottom: 6px; }
.novel-skeleton .skeleton-line:nth-child(3) { height: 14px; }
.novel-skeleton .skeleton-line:nth-child(4) { height: 14px; margin-bottom: 12px; }
.novel-skeleton .skeleton-line:nth-child(5) { height: 12px; }

/* 空推荐 */
.empty-recommend { grid-column: 1 / -1; }
.empty-recommend i { font-size: 36px; display: block; margin-bottom: 10px; }

/* 推荐卡片作者图标 */
.novel-author .fa-pen-nib { margin-right: 4px; color: var(--text-muted); }

/* 推荐卡片浏览图标 */
.novel-meta .fa-eye { margin-right: 3px; }
