/* ===================================
   Novel Detail Page
   =================================== */

/* --- Similar Novels Grid --- */
.similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-3);
}

.similar-card {
    display: flex;
    gap: var(--space-3);
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    transition: border-color var(--transition);
}

.similar-card:hover {
    border-color: var(--accent-primary-subtle);
}

.similar-card-cover {
    flex-shrink: 0;
    width: 44px;
}

.similar-card-cover img {
    width: 44px;
    height: 62px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--surface-bg);
    box-shadow: var(--shadow-sm);
}

.similar-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.similar-card-title {
    font-size: var(--caption);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin: 0;
    line-height: var(--leading-tight);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.similar-card-title a {
    color: inherit;
    text-decoration: none;
}

.similar-card-title a:hover {
    color: var(--accent-primary);
}

.similar-card-author {
    font-size: var(--xs);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.similar-card-tags {
    display: flex;
    gap: var(--space-1);
    flex-wrap: wrap;
}

.similar-card-tags .badge {
    font-size: 0.6rem;
    padding: 0.05rem 0.35rem;
}

.similar-card-actions {
    display: flex;
    gap: var(--space-1);
    margin-top: var(--space-1);
}

.similar-card-actions .btn-xs {
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    height: auto;
    line-height: 1.4;
}

/* --- Hero Section --- */
.novel-hero {
    display: flex;
    gap: var(--space-8);
    padding: var(--space-8);
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-6);
    position: relative;
    overflow: hidden;
}

.novel-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(ellipse 600px 200px at 0% 50%, var(--accent-primary-subtle) 0%, transparent 70%),
        radial-gradient(ellipse 400px 150px at 100% 30%, var(--accent-violet-subtle) 0%, transparent 70%);
    pointer-events: none;
}

.novel-hero > * {
    position: relative;
}

.novel-hero-cover {
    flex-shrink: 0;
    width: 180px;
}

.novel-hero-cover img {
    width: 180px;
    height: 260px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    background: var(--surface-bg);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
    display: block;
}

/* --- Enhanced Detail Hero (Spotlight + Larger Cover) --- */
.novel-hero-detail-enhanced .novel-hero-cover-lg {
    width: 220px;
}

.novel-hero-detail-enhanced .novel-hero-cover-lg img {
    width: 220px;
    height: 318px;
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
}

.novel-hero-detail-enhanced .novel-hero-cover-lg img {
    animation: cover-glow-in 1.2s ease-out forwards;
}

/* --- Reading Status Chip --- */
.reading-status-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.15rem 0.6rem;
    font-size: var(--xs);
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    line-height: 1.4;
    white-space: nowrap;
}

.reading-status-reading {
    background: var(--accent-primary-subtle);
    color: var(--accent-primary);
    border: 1px solid rgba(79, 143, 224, 0.2);
}

.reading-status-plan_to_read {
    background: var(--accent-violet-subtle);
    color: var(--accent-violet);
    border: 1px solid rgba(124, 92, 191, 0.2);
}

.reading-status-completed {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(79, 184, 133, 0.2);
}

.reading-status-on_hold {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(244, 184, 96, 0.25);
}

.reading-status-dropped {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.reading-status-re_reading {
    background: linear-gradient(135deg, var(--accent-primary-subtle), var(--accent-violet-subtle));
    color: var(--accent-primary);
    border: 1px solid rgba(79, 143, 224, 0.2);
}

/* --- Hero Action Buttons --- */
.hero-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-5);
    flex-wrap: wrap;
}

.hero-btn-primary,
.hero-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    font-size: var(--body);
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition);
    line-height: 1.3;
    white-space: nowrap;
}

.hero-btn-primary {
    background: var(--accent-primary);
    color: #fff;
    border: 1px solid var(--accent-primary);
}

.hero-btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 0 20px var(--accent-primary-glow);
    transform: translateY(-1px);
    color: #fff;
}

.hero-btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.hero-btn-secondary:hover {
    border-color: var(--accent-primary-subtle);
    background: var(--surface-bg-hover);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

/* --- Quick Facts Card --- */
.quick-facts {
    margin-bottom: var(--space-6);
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-5) var(--space-6);
}

.quick-facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--space-4);
}

.quick-fact {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.quick-fact-label {
    font-size: var(--xs);
    font-weight: var(--weight-semibold);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.quick-fact-value {
    font-size: var(--body);
    font-weight: var(--weight-medium);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.quick-fact-stars {
    color: var(--accent-gold);
    letter-spacing: 0.05em;
}

.quick-fact-fav {
    color: var(--accent-gold);
}

.novel-hero-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.novel-hero-title {
    font-family: var(--font-display);
    font-size: var(--display);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    letter-spacing: var(--tracking-display);
    line-height: var(--leading-display);
    margin-bottom: var(--space-1);
}

.novel-hero-author {
    font-size: var(--title);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.novel-hero-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

/* Hero Stats Row */
.novel-hero-stats {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    background: var(--surface-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    align-self: flex-start;
}

.novel-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-5);
    position: relative;
    min-width: 80px;
}

.novel-hero-stat + .novel-hero-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    bottom: 10%;
    width: 1px;
    background: var(--border);
}

.novel-hero-stat-value {
    font-family: var(--font-display);
    font-size: var(--heading);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.novel-hero-stat-label {
    font-size: var(--xs);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    white-space: nowrap;
}

.novel-hero-stat .ch-read-count {
    color: var(--accent-primary);
}

.novel-hero-stat .ch-unread-count {
    color: var(--warning);
}

/* --- Detail Grid --- */
.novel-detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-6);
    align-items: start;
}

.novel-detail-main {
    min-width: 0;
}

.novel-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.novel-detail-sidebar .card {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

.novel-detail-sidebar .card h2 {
    font-family: var(--font);
    font-size: var(--caption);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-dim);
    margin-bottom: var(--space-3);
}

.novel-link {
    color: var(--text-primary);
    font-weight: var(--weight-medium);
}
.novel-link:hover {
    color: var(--accent-primary);
}

/* --- Chapter Table --- */
.chapter-table-wrap {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.chapter-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.chapter-table-header h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--heading);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
}

.chapter-table-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.chapter-count-badge {
    font-size: var(--caption);
    color: var(--text-muted);
    font-weight: var(--weight-medium);
    white-space: nowrap;
}

/* -- Chapter progress bar -- */
.chapter-progress-bar {
    display: flex;
    height: 3px;
    background: var(--surface-bg);
    border-radius: 0;
    overflow: hidden;
}

.chapter-progress-fill {
    height: 100%;
    background: var(--gradient-brand);
    transition: width var(--transition-smooth);
}

/* -- Mark All Read button -- */
.btn-mark-all-read {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    font-size: var(--caption);
    font-weight: var(--weight-semibold);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    background: var(--accent-primary-subtle);
    color: var(--accent-primary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    height: 30px;
}

.btn-mark-all-read:hover {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-primary-subtle);
}

.btn-mark-all-read:active {
    transform: scale(0.97);
}

.btn-mark-all-read .btn-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-mark-all-read.htmx-request .btn-icon {
    display: none;
}

/* -- Sort select -- */
.chapter-sort-select {
    padding: var(--space-1) var(--space-2);
    font-size: var(--caption);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    height: 30px;
    outline: none;
    cursor: pointer;
}

.chapter-sort-select:focus {
    border-color: var(--accent-primary);
}

/* -- Table scroll -- */
.table-scroll {
    overflow-x: auto;
}

.chapter-table {
    width: 100%;
    border-collapse: collapse;
}

.chapter-table th {
    text-align: left;
    padding: var(--space-2) var(--space-3);
    font-size: var(--xs);
    font-weight: var(--weight-semibold);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.chapter-table td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: var(--body);
    vertical-align: middle;
}

.chapter-table tr:last-child td {
    border-bottom: none;
}

.chapter-table tbody tr {
    transition: background var(--transition);
}

.chapter-table tbody tr:hover td {
    background: var(--surface-bg-hover);
}

.chapter-row.chapter-read td {
    color: var(--text-muted);
}

.chapter-row.chapter-read .ch-num-col {
    text-decoration: line-through;
    opacity: 0.5;
}

.chapter-row.chapter-read .ch-title-col {
    opacity: 0.6;
}

/* Column widths */
.ch-check-col {
    width: 36px;
}

.ch-num-col {
    width: 60px;
    font-family: var(--font-mono);
    font-size: var(--body);
    color: var(--text-muted);
}

.ch-title-col {
    min-width: 0;
}

.ch-date-col {
    width: 120px;
    font-size: var(--caption);
    color: var(--text-dim);
}

.ch-status-col {
    width: 36px;
    text-align: center;
}

.chapter-checkbox {
    accent-color: var(--accent-primary);
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.ch-read-mark {
    color: var(--success);
    font-weight: var(--weight-bold);
    font-size: var(--body);
}

/* --- Sidebar Detail List --- */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row:first-child {
    padding-top: 0;
}

.detail-label {
    font-size: var(--xs);
    font-weight: var(--weight-semibold);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    flex-shrink: 0;
}

.detail-value {
    font-size: var(--caption);
    color: var(--text-secondary);
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-value.mono {
    font-family: var(--font-mono);
    font-size: var(--xs);
    color: var(--text-muted);
    max-width: 50%;
}

.detail-link {
    font-size: var(--caption);
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: var(--weight-medium);
}

.detail-link:hover {
    text-decoration: underline;
}

/* --- Cover card --- */
.cover-preview {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow);
}

.cover-upload-form {
    margin-bottom: var(--space-3);
}

.cover-upload-row {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
}

.cover-file-label {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.cover-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.cover-file-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--caption);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    height: 28px;
    transition: all var(--transition);
}

.cover-file-label:hover .cover-file-btn {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-subtle);
}

.cover-file-name {
    font-size: var(--xs);
    color: var(--text-dim);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cover-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* --- Ghost button variant --- */
/* --- Upload button --- */
.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--caption);
    font-weight: var(--weight-semibold);
    color: #fff;
    background: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    height: 28px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-upload:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 0 10px var(--accent-primary-subtle);
}

.btn-upload:active {
    transform: scale(0.97);
}

/* --- Collection Add button --- */
.btn-collection-add {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--caption);
    font-weight: var(--weight-semibold);
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid var(--success);
    border-radius: var(--radius-md);
    height: 28px;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-collection-add:hover {
    background: var(--success);
    color: #fff;
    box-shadow: 0 0 8px var(--success-bg);
}

.btn-collection-add:active {
    transform: scale(0.97);
}

/* --- Ghost button variant --- */
.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--surface-bg-hover);
    color: var(--text-primary);
}

.btn-danger-ghost:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-bg);
}

/* --- Sidebar Catch Up --- */
.catchup-estimate {
    font-size: var(--caption);
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.catchup-velocity {
    font-size: var(--xs);
    color: var(--accent-primary);
    margin-bottom: var(--space-3);
}

/* --- Reading Streak & Activity --- */
.reading-streak-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-light);
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--xs);
    font-weight: var(--weight-semibold);
    color: var(--warning);
    letter-spacing: var(--tracking-wide);
}

.streak-badge svg {
    flex-shrink: 0;
}

.days-since-badge {
    font-size: var(--xs);
    color: var(--text-muted);
    font-weight: var(--weight-medium);
}

.days-since-stale {
    color: var(--warning);
}

.reading-velocity-value {
    color: var(--accent-primary);
    font-weight: var(--weight-medium);
}

.reading-velocity-eta {
    color: var(--text-muted);
}

/* --- Public / Discover detail page --- */

/* Cover glow — signature "spotlight" effect on discover */
.novel-hero-discover .novel-hero-cover img {
    animation: cover-glow-in 1.2s ease-out forwards;
}

@keyframes cover-glow-in {
    0% {
        filter: drop-shadow(0 0 0px rgba(79, 143, 224, 0));
        transform: scale(0.98);
    }
    60% {
        filter: drop-shadow(0 0 24px rgba(79, 143, 224, 0.35));
    }
    100% {
        filter: drop-shadow(0 8px 32px rgba(79, 143, 224, 0.2));
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .novel-hero-discover .novel-hero-cover img {
        animation: none;
        filter: drop-shadow(0 8px 32px rgba(79, 143, 224, 0.2));
    }
}

/* Card headings in main content — accent bar + caps */
.novel-detail-main .card > h2 {
    font-size: 0.85rem;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding-left: var(--space-3);
    border-left: 3px solid var(--accent-primary);
    margin-bottom: var(--space-4);
}

.detail-cover-thumb {
    width: 48px;
    height: 68px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--surface-bg);
    box-shadow: var(--shadow-sm);
}

/* ===================================
   Reviews Section
   =================================== */

/* --- Review Header / Summary Bar --- */
.review-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.review-section-header h2 {
    margin: 0;
}

.review-summary {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.review-summary-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--caption);
    color: var(--text-muted);
}

.review-summary-item .review-avg-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--body);
    font-weight: var(--weight-bold);
    color: var(--accent-gold);
    background: var(--accent-gold-subtle);
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-full);
    line-height: 1.3;
}

.review-avg-star {
    font-size: 0.9em;
}

.review-summary-count {
    font-size: var(--caption);
    color: var(--text-dim);
}

/* --- Review Submit Form --- */
.review-submit-form {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}

.review-submit-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    font-size: var(--title);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
}

.review-submit-header small {
    font-size: var(--caption);
    font-weight: var(--weight-normal);
    color: var(--text-dim);
}

.review-submit-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.review-submit-row label {
    font-size: var(--caption);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    min-width: 48px;
}

.review-submit-row select {
    min-width: 160px;
}

.review-textarea {
    width: 100%;
    padding: var(--space-3);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--body);
    font-family: var(--font);
    resize: vertical;
    outline: none;
    transition: border-color var(--transition);
    margin-bottom: var(--space-3);
    min-height: 80px;
}

.review-textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-subtle);
}

.review-submit-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.review-empty-cta {
    font-size: var(--body);
    color: var(--text-dim);
    padding: var(--space-5);
    text-align: center;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
}

.review-empty-cta a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: var(--weight-semibold);
}

.review-empty-cta a:hover {
    text-decoration: underline;
}

/* --- Review List --- */
.review-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* --- Review Items (Cards) --- */
.review-item {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.review-item:hover {
    border-color: var(--accent-primary-subtle);
    box-shadow: 0 0 0 1px var(--accent-primary-subtle);
}

.review-item-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
}

.review-author {
    font-size: var(--caption);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.review-author:hover {
    color: var(--accent-primary);
}

.review-level-badge {
    font-size: 0.6rem;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    line-height: 1.4;
    white-space: nowrap;
}

.review-level-badge.level-reader {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.review-level-badge.level-reviewer {
    background: var(--accent-primary-subtle);
    color: var(--accent-primary);
    border: 1px solid rgba(79, 143, 224, 0.2);
}

.review-level-badge.level-critic {
    background: var(--accent-violet-subtle);
    color: var(--accent-violet);
    border: 1px solid rgba(124, 92, 191, 0.2);
}

.review-level-badge.level-expert {
    background: var(--accent-gold-subtle);
    color: var(--accent-gold);
    border: 1px solid rgba(200, 155, 60, 0.25);
}

.review-level-badge.level-master {
    background: linear-gradient(135deg, var(--accent-gold-subtle), rgba(200, 155, 60, 0.15));
    color: var(--accent-gold);
    border: 1px solid rgba(200, 155, 60, 0.35);
    box-shadow: 0 0 8px rgba(200, 155, 60, 0.15);
}

.review-stars {
    font-size: var(--body);
    letter-spacing: 0.08em;
    color: var(--accent-gold);
    margin-left: auto;
}

.review-date {
    font-size: var(--xs);
    color: var(--text-dim);
    white-space: nowrap;
}

.review-content {
    margin: 0;
    font-size: var(--body);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* --- Review Meta / Vote Actions --- */
.review-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.review-votes {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.6rem;
    font-size: var(--xs);
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.4;
    font-family: var(--font);
}

.vote-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: var(--surface-bg-hover);
}

.vote-btn.vote-btn-active {
    color: var(--accent-primary);
    border-color: var(--accent-primary-subtle);
    background: var(--accent-primary-subtle);
}

.vote-btn.vote-btn-active:hover {
    background: var(--accent-primary-subtle);
    border-color: var(--accent-primary);
}

.vote-btn-helpful.vote-btn-active {
    color: var(--success);
    border-color: rgba(79, 184, 133, 0.25);
    background: rgba(79, 184, 133, 0.08);
}

.vote-btn-not-helpful.vote-btn-active {
    color: var(--danger);
    border-color: rgba(255, 107, 107, 0.25);
    background: rgba(255, 107, 107, 0.08);
}

.review-permalink {
    font-size: var(--xs);
    color: var(--text-dim);
    text-decoration: none;
    margin-left: auto;
    opacity: 0;
    transition: opacity var(--transition);
}

.review-item:hover .review-permalink {
    opacity: 1;
}

.review-permalink:hover {
    color: var(--accent-primary);
}

/* Prediction stat grid */
.prediction-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.prediction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-3);
}

.prediction-item {
    background: var(--bg-surface);
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.prediction-label {
    font-size: var(--xs);
    font-weight: var(--weight-semibold);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.prediction-value {
    font-family: var(--font-display);
    font-size: var(--heading);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.prediction-value small {
    font-size: 0.6em;
    font-weight: var(--weight-medium);
    color: var(--text-muted);
}

.prediction-date {
    font-size: var(--body);
}

.prediction-note {
    font-size: var(--xs);
    color: var(--text-muted);
}

/* --- Reliability Meter --- */
.reliability-meter {
    margin-bottom: var(--space-3);
}

.reliability-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-1);
}

.reliability-label {
    font-size: var(--xs);
    font-weight: var(--weight-semibold);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.reliability-score {
    font-size: var(--xs);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
}

.reliability-bar-track {
    height: 4px;
    background: var(--surface-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.reliability-bar-fill {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: var(--radius-full);
    transition: width var(--transition-smooth);
}

/* --- Latest Chapter Preview (inside Release card) --- */
.latest-chapter-preview {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-light);
}

.latest-chapter-ref {
    font-size: var(--body);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
}

.latest-chapter-link {
    margin-left: auto;
}

/* Library card */
.library-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-top: var(--space-3);
}

/* CTA card */
.cta-card {
    text-align: center;
}

.btn-cta-discover {
    font-size: var(--body);
    padding: var(--space-3) var(--space-5);
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: var(--weight-semibold);
    transition: all var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-cta-discover:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 0 20px var(--accent-primary-glow);
    transform: translateY(-1px);
}

/* ===================================
   Featured Reviews
   =================================== */

.featured-review-item {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    transition: border-color var(--transition);
}

.featured-review-item:hover {
    border-color: var(--accent-gold-subtle);
}

.featured-review-top {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.featured-review-stars {
    font-size: var(--body);
    color: var(--accent-gold);
    letter-spacing: 0.05em;
}

.featured-review-badge {
    font-size: 0.6rem;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    background: var(--accent-gold-subtle);
    color: var(--accent-gold);
    border: 1px solid rgba(200, 155, 60, 0.2);
    line-height: 1.4;
}

.featured-review-content {
    margin: 0 0 var(--space-2);
    font-size: var(--caption);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

.featured-review-footer {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    font-size: var(--xs);
}

.featured-review-author {
    color: var(--text-primary);
    font-weight: var(--weight-medium);
}

.featured-review-helpful {
    color: var(--text-dim);
}

.featured-review-link {
    color: var(--accent-primary);
    text-decoration: none;
    margin-left: auto;
    font-weight: var(--weight-medium);
}

.featured-review-link:hover {
    text-decoration: underline;
}

/* ===================================
   Reviewer Leaderboard
   =================================== */

.leaderboard-header {
    margin-bottom: var(--space-6);
}

.leaderboard-header h2 {
    margin: 0 0 var(--space-1);
}

.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
}

.leaderboard-card {
    position: relative;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
}

.leaderboard-card:hover {
    border-color: var(--accent-primary-subtle);
    transform: translateY(-2px);
}

.leaderboard-rank {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--title);
    font-weight: var(--weight-bold);
    color: var(--text-dim);
    line-height: 1;
}

.leaderboard-podium-1 {
    border-color: rgba(200, 155, 60, 0.2);
    background: linear-gradient(135deg, var(--bg-glass), rgba(200, 155, 60, 0.04));
}

.leaderboard-podium-1 .leaderboard-rank {
    color: var(--accent-gold);
}

.leaderboard-podium-2 {
    border-color: rgba(200, 200, 220, 0.15);
    background: linear-gradient(135deg, var(--bg-glass), rgba(200, 200, 220, 0.03));
}

.leaderboard-podium-2 .leaderboard-rank {
    color: #C0C0C0;
}

.leaderboard-podium-3 {
    border-color: rgba(205, 127, 50, 0.15);
    background: linear-gradient(135deg, var(--bg-glass), rgba(205, 127, 50, 0.03));
}

.leaderboard-podium-3 .leaderboard-rank {
    color: #CD7F32;
}

.leaderboard-card-body {
    padding: var(--space-5);
}

.leaderboard-user {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.leaderboard-username {
    font-size: var(--body);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    text-decoration: none;
}

.leaderboard-username:hover {
    color: var(--accent-primary);
}

.leaderboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.leaderboard-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.leaderboard-stat-value {
    font-family: var(--font-display);
    font-size: var(--body);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.leaderboard-stat-label {
    font-size: var(--xs);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Mobile actions --- */
.mobile-actions {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-3) var(--space-4);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border-top: 1px solid var(--glass-border);
}

.mobile-actions .btn {
    width: 100%;
    justify-content: center;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .novel-hero {
        flex-direction: column;
        padding: var(--space-5);
        gap: var(--space-5);
    }
    .novel-hero-cover {
        width: 130px;
    }
    .novel-hero-cover img {
        width: 130px;
        height: 188px;
    }
    .novel-hero-detail-enhanced .novel-hero-cover-lg {
        width: 140px;
    }
    .novel-hero-detail-enhanced .novel-hero-cover-lg img {
        width: 140px;
        height: 202px;
    }
    .novel-hero-title {
        font-size: var(--heading);
    }
    .novel-hero-stats {
        width: 100%;
        justify-content: space-around;
        padding: var(--space-2);
    }
    .novel-hero-stat {
        padding: var(--space-1) var(--space-3);
        min-width: auto;
    }
    .novel-hero-stat-value {
        font-size: var(--body);
    }
    .hero-actions {
        flex-direction: column;
    }
    .hero-btn-primary,
    .hero-btn-secondary {
        width: 100%;
        justify-content: center;
    }
    .quick-facts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    .novel-detail-grid {
        grid-template-columns: 1fr;
    }
    .chapter-table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .chapter-table-controls {
        width: 100%;
        justify-content: space-between;
    }
    .mobile-actions {
        display: block;
    }
    .novel-detail-sidebar .btn-block {
        margin-bottom: calc(var(--mobile-nav-height) + var(--space-4));
    }
    .review-section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .review-summary {
        width: 100%;
    }
    .review-item-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .review-stars {
        margin-left: 0;
    }
    .review-meta {
        flex-wrap: wrap;
    }
    .leaderboard-grid {
        grid-template-columns: 1fr;
    }
    .review-submit-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
