* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.navbar {
    background: #fff;
    color: #1a1a2e;
    padding: 0;
    border-bottom: 1px solid #e4e6eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    color: #65676b;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    transition: all 0.15s;
    font-weight: 500;
}

.nav-links a:hover {
    background: #f0f2f5;
    color: #1a1a2e;
}

main {
    flex: 1;
    padding: 2rem 0;
}

.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.15rem;
    color: #65676b;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #1b74e4;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #1664c9;
}

.btn-secondary {
    background: #e4e6eb;
    color: #1a1a2e;
}

.btn-secondary:hover {
    background: #d8dadf;
}

.btn-primary {
    background: #1b74e4;
    color: #fff;
}

.btn-primary:hover {
    background: #1664c9;
}

.btn-danger {
    background: #e74c3c;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #e4e6eb;
}

.feature-card h3 {
    margin-bottom: 0.8rem;
    color: #1a1a2e;
}

.feature-card p {
    color: #666;
    margin-bottom: 1rem;
}

.feature-card a {
    color: #0f3460;
    text-decoration: none;
    font-weight: 600;
}

.page-content {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    border: 1px solid #e4e6eb;
    margin-bottom: 1.5rem;
}

.page-content:last-child {
    margin-bottom: 0;
}

.page-content h1 {
    margin-bottom: 1rem;
    color: #1a1a2e;
}

.page-content h2 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: #1a1a2e;
}

.page-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.page-content li {
    margin-bottom: 0.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #444;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #1b74e4;
}

.category-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1b74e4;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.contact-form {
    max-width: 600px;
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.2rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-error ul {
    margin: 0;
    padding-left: 1.2rem;
}

.auth-form {
    max-width: 450px;
    margin: 0 auto;
}

.auth-link {
    margin-top: 1rem;
    text-align: center;
}

.auth-link a {
    color: #0f3460;
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-card {
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

.blog-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.blog-card h2 {
    margin-top: 0;
    margin-bottom: 0.4rem;
}

.blog-card h2 a {
    color: #1a1a2e;
    text-decoration: none;
}

.blog-card h2 a:hover {
    color: #0f3460;
}

.meta {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.read-more {
    color: #0f3460;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: #888;
}

.single-post .post-content {
    margin: 1.5rem 0;
    line-height: 1.8;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 0;
    }
    .nav-links a {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }

    .navbar .container {
        height: auto;
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .page-content {
        padding: 1.25rem;
    }
}

.dashboard-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e4e6eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.dashboard-card h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

.post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    border-bottom: 1px solid #eee;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item .meta {
    display: block;
    font-size: 0.8rem;
}

.user-stats {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.stat-card {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: center;
    flex: 1;
    min-width: 100px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.stat-icon {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-label {
    display: block;
    font-size: 0.78rem;
    color: #888;
    text-transform: uppercase;
    margin-top: 0.15rem;
}

.referral-box {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.links-page .page-header {
    margin-bottom: 1.5rem;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.link-card {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    transition: box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.link-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.link-card.inactive {
    opacity: 0.55;
}

.link-thumb {
    width: 160px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.link-thumb img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.link-thumb-placeholder {
    width: 160px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #e4e6eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    gap: 4px;
}

.link-thumb-placeholder:hover {
    background: #d0d2d6;
}

.link-thumb-placeholder .thumb-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.link-thumb-placeholder .thumb-label {
    font-size: 0.75rem;
    color: #65676b;
    font-weight: 500;
}

.link-thumb-placeholder.loading {
    pointer-events: none;
    opacity: 0.6;
}

.link-thumb-placeholder.loading .thumb-icon {
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

@media (max-width: 600px) {
    .link-thumb,
    .link-thumb-placeholder {
        width: 100%;
        height: 120px;
    }
    .link-main {
        flex-wrap: wrap;
    }
}

.link-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

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

.link-title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.link-title-row h3 {
    font-size: 1.1rem;
    color: #1a1a2e;
    margin: 0;
}

.link-url {
    display: block;
    color: #0f3460;
    font-size: 0.85rem;
    text-decoration: none;
    word-break: break-all;
    margin-top: 0.3rem;
}

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

.stats-bubble {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: #1a1a2e;
    color: #fff;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.stat {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    transition: background 0.3s;
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
}

.stat.flash {
    background: rgba(255,255,255,0.3);
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay.open {
    display: flex;
}

.loading-box {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 3rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 400px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e4e6eb;
    border-top-color: #1b74e4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

.loading-box p {
    color: #444;
    font-size: 1rem;
    margin: 0;
}

.loading-box .loading-sub {
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.link-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.status-badge {
    font-size: 0.72rem;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.approved {
    background: #d4edda;
    color: #155724;
}

.status-badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

.icon-btn {
    background: none;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    line-height: 1;
}

.icon-btn:hover {
    background: #e4e6eb;
}

.edit-btn:hover {
    background: #e8f4fd;
    border-color: #0f3460;
}

.delete-btn:hover {
    background: #fde8e8;
    border-color: #e74c3c;
    color: #e74c3c;
}

.status-btn:hover {
    background: #fff3cd;
    border-color: #856404;
    color: #856404;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1.2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    td {
        padding: 0.5rem 0.6rem !important;
        border: none !important;
        position: relative;
        padding-left: 40% !important;
    }
    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.6rem;
        font-weight: 600;
        color: #444;
    }
    tr {
        border-bottom: 1px solid #ddd;
        margin-bottom: 0.5rem;
    }
}

/* Dashboard sidebar layout */
.dash-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.dash-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    color: #444;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.15s;
}

.sidebar-nav a:hover {
    background: #e8ecf1;
    color: #1a1a2e;
}

.sidebar-nav .active a {
    background: #1a1a2e;
    color: #fff;
    font-weight: 600;
}

.sidebar-nav .active a:hover {
    background: #16213e;
}

.sidebar-icon {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
}

.dash-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .dash-layout {
        flex-direction: column;
    }
    .dash-sidebar {
        width: 100%;
        position: static;
    }
    .sidebar-nav ul {
        display: flex;
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    .sidebar-nav a {
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }
}

.footer {
    background: #fff;
    color: #65676b;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid #e4e6eb;
}

.footer p {
    font-size: 0.9rem;
}

/* User Links Table */
.user-links-table-wrap {
    overflow-x: auto;
}

.user-links-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.user-links-table th {
    background: #f5f7fa;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    color: #444;
}

.user-links-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.user-links-table .user-row:hover {
    background: #f0f2f5;
}

/* 3x3 Grid */
.links-grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .links-grid-3x3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .links-grid-3x3 {
        grid-template-columns: 1fr;
    }
}

.grid-item {
    position: relative;
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
    aspect-ratio: 16 / 10;
}

.grid-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.grid-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e4e6eb;
    font-size: 2rem;
    color: #888;
}

.grid-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0.7rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover Popup */
.link-popup {
    display: none;
    position: fixed;
    z-index: 3000;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    max-width: 360px;
    width: auto;
    pointer-events: auto;
}

.popup-arrow {
    display: none;
}

.popup-content {
    padding: 0.8rem;
}

.popup-thumb img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    background: #e4e6eb;
}

.popup-body {
    padding-top: 0.6rem;
}

.popup-body strong {
    display: block;
    font-size: 0.9rem;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.popup-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    font-size: 0.8rem;
    color: #555;
}

.popup-stats span {
    white-space: nowrap;
}

/* Detail Layout */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

.detail-chart {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
}

.chart-period-btns {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.detail-info {
    font-size: 0.9rem;
}

.detail-info h3 {
    font-size: 1rem;
    color: #1a1a2e;
    margin-bottom: 0.6rem;
}

.detail-info p {
    margin-bottom: 0.3rem;
    color: #444;
}

.click-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.click-history-table th {
    background: #f5f7fa;
    padding: 0.4rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
    color: #444;
}

.click-history-table td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

.click-history-table tr:hover {
    background: #fafafa;
}

/* Home Page 4x4 Grid */
.home-grid-4x4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 900px) {
    .home-grid-4x4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .home-grid-4x4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .home-grid-4x4 {
        grid-template-columns: 1fr;
    }
}

.home-grid-item {
    position: relative;
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
    aspect-ratio: 16 / 10;
}

.home-grid-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.home-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-grid-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e4e6eb;
    font-size: 2rem;
    color: #888;
}

.home-grid-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Home Page Hover Popup */
.home-popup {
    display: none;
    position: fixed;
    z-index: 3000;
    background: #1a1a2e;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.3);
    pointer-events: auto;
    max-width: 300px;
}

.home-popup-body {
    padding: 0.7rem 1rem;
}

.home-popup-body strong {
    display: block;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 0.4rem;
}

.home-popup-stats {
    display: flex;
    gap: 0.6rem 1rem;
    font-size: 0.82rem;
    color: #ccc;
    flex-wrap: wrap;
}

.home-popup-stats span {
    white-space: nowrap;
}

/* ── Forum Q&A Styles ── */
.forum-section {
    margin-top: 2rem;
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.topic-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    gap: 1rem;
}

.topic-card:last-child {
    border-bottom: none;
}

.topic-card:hover {
    background: #f8f9fa;
    margin: 0 -0.75rem;
    padding: 1rem 0.75rem;
    border-radius: 8px;
}

.topic-main {
    flex: 1;
    min-width: 0;
}

.topic-main h3 {
    font-size: 1.05rem;
    color: #1a1a2e;
    margin: 0 0 0.3rem;
}

.topic-excerpt {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.topic-reply-count {
    text-align: center;
    flex-shrink: 0;
    min-width: 60px;
    padding: 0.5rem;
    background: #f5f7fa;
    border-radius: 8px;
}

.reply-num {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.reply-label {
    display: block;
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
}

.question-detail h1 {
    margin-bottom: 0.4rem;
}

.back-link {
    display: inline-block;
    color: #0f3460;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

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

.question-body {
    margin: 1.5rem 0 0.5rem;
    line-height: 1.8;
    font-size: 1rem;
    color: #333;
}

.replies-section h2 {
    margin-top: 0;
}

.replies-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.reply-card {
    padding: 1rem 1.2rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #eee;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.reply-author {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 0.95rem;
}

.reply-body {
    line-height: 1.7;
    color: #444;
}

.reply-form {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.reply-form label {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a2e;
}

/* ── Slider / Carousel ── */
.slider-wrap {
    margin: 20px auto 2rem;
    max-width: 900px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

.slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #1a1a2e;
    border-radius: 16px;
}

.slider-track {
    display: flex;
    flex-wrap: nowrap;
    transition: transform 0.5s ease-in-out;
}

.slider-slide {
    position: relative;
    flex: 0 0 100%;
    min-width: 0;
    aspect-ratio: 16 / 7;
    cursor: default;
}

.slider-slide:first-child {
    border-radius: 16px 0 0 16px;
}

.slider-slide:last-child {
    border-radius: 0 16px 16px 0;
}

.slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
}

.slider-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    pointer-events: none;
}

.slider-overlay h2 {
    font-size: 1.2rem;
    margin: 0 0 0.2rem;
    color: #fff;
}

.slider-overlay p {
    font-size: 0.85rem;
    color: #ddd;
    margin: 0;
    max-width: 500px;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.35);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.slider:hover .slider-btn {
    opacity: 1;
}

.slider-btn:hover {
    background: rgba(0,0,0,0.7);
}

.slider-prev { left: 10px; }
.slider-next { right: 10px; }

.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.slider-dot.active {
    background: #fff;
    transform: scale(1.25);
}

.slider-dot:hover {
    background: rgba(255,255,255,0.8);
}

@media (max-width: 768px) {
    .slider-wrap { max-width: 100%; border-radius: 0; margin-bottom: 1.5rem; }
    .slider { border-radius: 0; }
    .slider-slide { aspect-ratio: 16 / 9; }
    .slider-overlay { padding: 1rem 1.2rem; }
    .slider-overlay h2 { font-size: 1rem; }
    .slider-overlay p { font-size: 0.8rem; }
    .slider-btn { width: 30px; height: 30px; font-size: 0.9rem; opacity: 1; }
}
