/**
 * story.css - 故事详情页完整样式
 * 对应 app/view/story/show.php 中所有自定义类名
 */

/* ========== HERO ========== */
.story-hero {
    background: linear-gradient(135deg, var(--coral) 0%, var(--teal) 100%);
    color: #fff;
    padding: 48px 0 64px;
    margin-top: -80px;
    padding-top: 120px;
    position: relative;
    overflow: hidden;
}
.story-hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}
.story-hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}
.story-hero-breadcrumb {
    font-size: 0.82rem;
    opacity: 0.8;
    margin-bottom: 12px;
}
.story-hero-breadcrumb a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
}
.story-hero-breadcrumb a:hover {
    opacity: 1;
}
.story-hero-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
}
.story-hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 12px;
}
.story-hero-date {
    opacity: 0.8;
}
.story-hero-author {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.story-hero-author a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}
.story-hero-divider {
    opacity: 0.5;
}
.story-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========== LAYOUT ========== */
.story-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}
@media (max-width: 900px) {
    .story-layout {
        grid-template-columns: 1fr;
    }
}

/* ========== CONTENT ========== */
.story-content {
    min-width: 0;
}
.story-summary {
    background: var(--gray-50);
    border-left: 4px solid var(--coral);
    padding: 20px 24px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 28px;
}
.story-summary h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--coral);
}
.story-summary p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}
.story-text {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
}
.story-text p {
    margin-bottom: 1.2em;
}
.story-text h1, .story-text h2, .story-text h3 {
    margin-top: 1.6em;
    margin-bottom: 0.6em;
}
.story-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-top: 1px solid var(--gray-200);
    margin-top: 32px;
    font-size: 0.88rem;
}
.tag-item {
    display: inline-block;
    padding: 3px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.82rem;
    transition: all 0.2s;
}
.tag-item:hover {
    background: var(--coral);
    color: #fff;
    border-color: var(--coral);
}

/* ========== CHAPTERS ========== */
.story-chapters {
    margin-top: 32px;
}
.story-chapters h3 {
    font-size: 1.05rem;
    margin-bottom: 16px;
}
.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chapter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}
.chapter-item:hover {
    border-color: var(--coral);
    background: var(--gray-50);
    transform: translateX(4px);
}
.chapter-num {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--coral);
    flex-shrink: 0;
}
.chapter-title {
    flex: 1;
    font-size: 0.92rem;
}
.chapter-date {
    font-size: 0.78rem;
    color: var(--text-light);
    flex-shrink: 0;
}

/* ========== COMMENTS ========== */
.story-comments {
    margin-top: 40px;
}
.story-comments h3 {
    font-size: 1.05rem;
}
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    transition: background 0.15s;
}
.comment-item:hover {
    background: var(--gray-50);
}
.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--coral);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.comment-body {
    flex: 1;
    min-width: 0;
}
.comment-author {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 4px;
}
.comment-text {
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 4px;
}
.comment-date {
    font-size: 0.78rem;
    color: var(--text-light);
}
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ========== SIDEBAR ========== */
.story-sidebar {
    position: sticky;
    top: 90px;
}
.sidebar-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}
.sidebar-card h4 {
    font-size: 0.95rem;
    margin-bottom: 16px;
}
.author-info {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--coral);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.author-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.author-meta {
    display: flex;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-light);
}

/* ========== RELATED ========== */
.related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.related-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s;
}
.related-item:hover {
    background: var(--gray-50);
}
.related-cover {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    color: #fff;
}
.related-info {
    flex: 1;
    min-width: 0;
}
.related-title {
    font-size: 0.88rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.related-meta {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* ========== BUTTON SM ========== */
.btn-sm {
    padding: 10px 20px;
    font-size: 0.85rem;
    border-radius: 10px;
}

/* ========== TIP MODAL ========== */
.tip-amount {
    padding: 8px 0;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.tip-amount:hover,
.tip-amount.active {
    border-color: var(--coral);
    background: #fef2f2;
}
.tip-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2ecc71;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    transition: opacity 0.3s;
}
.tip-toast.error {
    background: #e74c3c;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .story-hero {
        padding: 80px 0 48px;
    }
    .story-hero-title {
        font-size: 1.4rem;
    }
    .story-hero-actions {
        flex-direction: column;
    }
    .story-hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .story-layout {
        grid-template-columns: 1fr;
    }
    .story-sidebar {
        position: static;
    }
}
