/* ========================================
   作者专区 - 书籍卡片样式
   企业级模块化CSS架构
   ======================================== */

/* ========================================
   1. 基础网格布局系统
   ======================================== */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    align-items: stretch;
}

.novels-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ========================================
   2. 通用书籍卡片基础样式
   ======================================== */
.book-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ========================================
   3. 小说卡片统一样式系统
   ======================================== */
.novel-card {
    display: flex;
    flex-direction: row;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 190px;
    height: auto;
}

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

/* 网格布局中的小说卡片 */
.books-grid .novel-card {
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* 列表布局中的小说卡片 */
.novels-list .novel-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border-color: #ddd;
    transform: translateY(-2px);
}

/* ========================================
   4. 创建新书专用样式
   ======================================== */
.novel-card.create-new-book,
.create-new-book {
    border: 2px dashed #5D9968;
    background-color: #f5f9f6;
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.novel-card.create-new-book:hover,
.create-new-book:hover {
    border-color: #4C8055;
    background-color: #e9f2ec;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(93, 153, 104, 0.15);
}

/* ========================================
   5. 封面样式系统
   ======================================== */
/* 基础封面样式 */
.book-cover {
    width: 100%;
    height: 140px;
    position: relative;
    overflow: hidden;
    background-color: #f8f8f8;
}

.novel-cover {
    width: 100px;
    height: 120px;
    flex-shrink: 0;
    background-color: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 网格布局中的封面 */
.books-grid .novel-cover {
    width: 100%;
    height: 140px;
    margin-right: 0;
    margin-bottom: 0;
    border-radius: 6px 6px 0 0;
}

/* 列表布局中的封面 */
.novels-list .novel-cover {
    width: 130px !important;
    min-width: 130px !important;
    max-width: 130px !important;
    height: 190px !important;
    min-height: 190px !important;
    max-height: 190px !important;
    margin-right: 0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
    flex-shrink: 0;
}

/* 书籍项目中的封面 */
.book-item .book-cover {
    width: 100px;
    height: 140px;
    margin-right: 20px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.book-item .book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.book-item:hover .book-cover img {
    transform: scale(1.05);
}

/* ========================================
   6. 封面占位符系统
   ======================================== */
.book-placeholder,
.cover-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    background: #f5f5f5;
    color: #999;
    overflow: hidden;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0;
}

.cover-placeholder img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    border-radius: inherit;
    vertical-align: top;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}



.cover-placeholder .placeholder-text,
.placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

/* 创建书籍占位符 */
.create-placeholder {
    background: linear-gradient(135deg, #e9f2ec, #f5f9f6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #5D9968;
    height: 140px;
    border-radius: 4px 4px 0 0;
}

.create-placeholder i {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.create-text {
    font-size: 16px;
    font-weight: 500;
}

/* ========================================
   7. 内容区域样式系统
   ======================================== */
.novel-content {
    flex: 1;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 网格布局中的内容 */
.books-grid .novel-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 列表布局中的内容 */
.novels-list .novel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 25px;
    justify-content: flex-start;
    min-height: 190px;
}

.novels-list .novel-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 工作台书籍卡片内容区域 */
.dashboard-books-list .novel-card.dashboard-book .novel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px 20px;
    justify-content: flex-start;
    min-height: 190px;
    overflow: hidden;
}

.dashboard-books-list .novel-card.dashboard-book .novel-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 作品简介文本截断 */
.dashboard-books-list .novel-card.dashboard-book .book-summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4 !important;
    margin: 6px 0 !important;
    color: #666 !important;
    font-size: 12px !important;
}

/* 工作台按钮专用样式 */
.dashboard-books-list .novel-card.dashboard-book .novel-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    color: #666;
    background-color: #f8f8f8;
    transition: all 0.3s ease;
    font-size: 12px;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e8e8;
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
    min-height: 32px;
    flex: none;
}

.dashboard-books-list .novel-card.dashboard-book .novel-action:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-books-list .novel-card.dashboard-book .novel-action.create-chapter {
    background-color: #5D9968;
    color: white;
    border: 1px solid #5D9968;
}

.dashboard-books-list .novel-card.dashboard-book .novel-action.create-chapter:hover {
    background-color: #4C8055;
    color: white;
    border-color: #4C8055;
}

/* 新的布局结构样式 */
.novel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.novel-info-top {
    flex: 1;
}

.novel-create-time {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
    margin-left: 15px;
}

.novel-bottom {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.novel-stats {
    color: #888;
    font-size: 13px;
    line-height: 1.4;
    flex-shrink: 0;
}

/* 底部操作按钮行样式 */
.novel-actions-bottom {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.novel-action-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    color: #666;
    background-color: #f8f8f8;
    transition: all 0.3s ease;
    font-size: 12px;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e8e8;
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
    flex: none;
    cursor: pointer;
    font-family: inherit;
}

/* 确保按钮和链接样式一致 */
button.novel-action-inline {
    border: 1px solid #e8e8e8;
    text-decoration: none;
}

.novel-action-inline:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.novel-action-inline.create-chapter {
    background-color: #5D9968;
    color: white;
    border: 1px solid #5D9968;
}

.novel-action-inline.create-chapter:hover {
    background-color: #4C8055;
    color: white;
    border-color: #4C8055;
}

/* 禁用状态的新建章节按钮 */
.novel-action-inline.create-chapter.disabled,
.novel-action-inline.create-chapter:disabled {
    background-color: #ccc !important;
    color: #666 !important;
    border-color: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.novel-action-inline.create-chapter.disabled:hover,
.novel-action-inline.create-chapter:disabled:hover {
    background-color: #ccc !important;
    color: #666 !important;
    border-color: #ccc !important;
}

/* 工作台特殊书籍卡片样式 */
.dashboard-books-list .novel-card.dashboard-book {
    display: flex;
    flex-direction: row;
    min-height: 190px;
    margin-bottom: 15px;
}

.dashboard-books-list .novel-card.dashboard-book .novel-cover {
    width: 130px !important;
    height: 190px !important;
    min-width: 130px !important;
    min-height: 190px !important;
    max-width: 130px !important;
    max-height: 190px !important;
    flex-shrink: 0;
    overflow: hidden;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.dashboard-books-list .novel-card.dashboard-book .cover-placeholder {
    width: 100% !important;
    height: 100% !important;
    background: #f5f5f5;
    position: relative !important;
    overflow: hidden;
    border-radius: 8px;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0;
}

.dashboard-books-list .novel-card.dashboard-book .cover-placeholder img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    border-radius: 8px;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    vertical-align: top;
}

.book-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.novel-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ========================================
   8. 标题和文本样式系统
   ======================================== */
/* 书籍标题 */
.book-title,
.novel-title {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.3;
}

.book-card .book-title {
    color: #999;
    font-size: 16px;
}

.book-card .book-info h4 {
    font-size: 18px;
    margin: 0 0 8px 0;
    font-weight: 500;
    color: #333;
}

/* 网格布局中的标题 */
.books-grid .novel-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 列表布局中的标题 */
.novels-list .novel-title {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

/* 更新状态文本 */
.update-info,
.update-status {
    font-size: 14px;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.books-grid .update-status {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.novels-list .update-status {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* ========================================
   9. 统计信息样式系统
   ======================================== */
.book-stats,
.novel-stats {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.book-stats span,
.novel-stats span {
    display: flex;
    align-items: center;
}

.book-stats span i,
.novel-stats span i {
    margin-right: 5px;
}

/* 网格布局中的统计 */
.books-grid .novel-stats {
    font-size: 11px;
    color: #999;
    margin-top: auto;
}

/* 列表布局中的统计 */
.novels-list .novel-stats {
    color: #888;
    font-size: 13px;
    margin-bottom: 0;
    line-height: 1.4;
}

/* ========================================
   10. 操作按钮系统
   ======================================== */
.book-actions,
.novel-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.book-card .book-actions {
    padding: 0 15px 15px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* 网格布局中的操作按钮 */
.books-grid .novel-actions {
    padding: 0 15px 15px 15px;
    border-left: none;
    margin-left: 0;
    flex-direction: row;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.books-grid .novel-action {
    font-size: 12px;
    padding: 4px 8px;
    flex: 1;
    min-width: auto;
    text-align: center;
    white-space: nowrap;
}

/* 隐藏列表布局中的右侧操作按钮 */
.novels-list .novel-actions {
    display: none;
}

/* 隐藏原来的右侧操作按钮区域 */
.dashboard-books-list .novel-card.dashboard-book .novel-actions {
    display: none;
}

.novels-list .novel-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    color: #666;
    background-color: #f8f8f8;
    transition: all 0.3s ease;
    font-size: 12px;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e8e8;
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
    min-height: 32px;
    flex: none;
}

.novels-list .novel-action:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.novels-list .novel-action.create-chapter {
    background-color: #5D9968;
    color: white;
    border: 1px solid #5D9968;
}

.novels-list .novel-action.create-chapter:hover {
    background-color: #4C8055;
    color: white;
    border-color: #4C8055;
}

.create-chapter-btn {
    margin-right: 10px;
}

/* ========================================
   11. 书籍列表项样式
   ======================================== */
.book-item {
    display: flex;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.book-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.book-details {
    flex: 1;
}

.book-category {
    font-size: 14px;
    color: #666;
    margin: 0 0 10px 0;
}

.book-update,
.book-status {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

/* ========================================
   12. 状态样式系统
   ======================================== */
.status-pending {
    color: #FF9800;
}

.status-published {
    color: #4CAF50;
}

.status-rejected {
    color: #F44336;
}

.status-success {
    color: #4CAF50;
}

/* ========================================
   13. 创建新书样式系统
   ======================================== */
.create-book-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.create-info {
    text-align: center;
    padding: 20px 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.create-info h4 {
    color: #5D9968;
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.create-desc {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

/* ========================================
   14. 空状态样式
   ======================================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: #f9f9f9;
    border-radius: 6px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 18px;
    margin: 0 0 10px 0;
}

.empty-state p {
    margin-bottom: 20px;
}

.empty-books-hint {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.empty-books-hint i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
    display: block;
}

/* ========================================
   15. 收益系统样式
   ======================================== */
.income-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.income-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    position: relative;
}

.income-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.income-value {
    font-size: 24px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.income-trend {
    font-size: 12px;
    color: #999;
}

.settlement-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
}

.settlement-status.pending {
    background-color: #FFF5E9;
    color: #FF9800;
}

.settlement-status.settled {
    background-color: #E9F7EF;
    color: #4CAF50;
}

.income-detail,
.settlement-records {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.income-sources {
    margin-top: 20px;
}

/* ========================================
   16. 表格样式系统
   ======================================== */
.income-table {
    width: 100%;
    border-collapse: collapse;
}

.income-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 500;
    color: #333;
}

.income-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.empty-row td {
    padding: 20px 0;
}

.table-footer {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.view-more {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    background-color: #f5f5f5;
    border: 1px solid #eeeeee;
    gap: 6px;
}

.view-more:hover {
    color: #5D9968;
    background-color: #f0f0f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-more i {
    margin-left: 5px;
}

/* ========================================
   17. 响应式设计系统
   ======================================== */
@media (max-width: 768px) {
    /* 收益卡片移动端适配 */
    .income-summary {
        grid-template-columns: 1fr;
    }
    
    /* 书籍网格移动端适配 */
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    /* 书籍项目移动端适配 */
    .book-item {
        flex-direction: column;
    }
    
    .book-item .book-cover {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    /* 小说卡片移动端适配 */
    .novel-card {
        flex-direction: column;
    }
    
    .novel-cover {
        width: 80px;
        height: 112px;
        margin-bottom: 15px;
    }
    
    /* 操作按钮移动端适配 */
    .novel-actions {
        flex-direction: column;
        border-left: none;
        border-top: 1px solid #eee;
        padding-left: 0;
        margin-left: 0;
        padding-top: 15px;
        margin-top: 15px;
        align-items: stretch;
    }
}