:root {
    --bg: #f7f8fc;
    --surface: #ffffff;
    --surface-soft: #fbfcff;
    --border: #e7ebf3;
    --border-strong: #d9dfeb;
    --text-main: #1f2a44;
    --text-sub: #667085;
    --text-muted: #98a2b3;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --shadow-sm: 0 4px 14px rgba(31, 42, 68, 0.06);
    --shadow-md: 0 10px 30px rgba(31, 42, 68, 0.08);
    --radius-card: 20px;
    --radius-button: 14px;
    --radius-pill: 999px;
    --tag-promo-bg: #fff1f5;
    --tag-promo-text: #be185d;
    --tag-cast-bg: #fff7ed;
    --tag-cast-text: #c2410c;
    --tag-other-bg: #f3f4f6;
    --tag-other-text: #4b5563;
}

.board-page,
.board-form-page {
    max-width: 1080px;
    margin: 0 auto;
}

.board-page {
    color: var(--text-main);
}

.board-toolbar {
    display: grid;
    gap: 18px;
    margin-bottom: 24px;
}

.board-hero,
.board-form-card,
.board-filter {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
}

.board-hero {
    padding: 24px;
}

.board-filter {
    padding: 22px;
}

.board-form-card {
    padding: 32px;
}

.board-hero h1,
.board-form-card h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: var(--text-main);
}

.board-hero p,
.board-form-card p {
    margin: 0;
    color: var(--text-sub);
    line-height: 1.8;
}

.board-actions,
.board-form-actions,
.board-buttons,
.board-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.board-actions {
    margin-top: 16px;
}

.board-toolbar .btn-primary,
#boardUrlLink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: none;
    border-radius: var(--radius-button);
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
    transition: background 0.18s ease, transform 0.18s ease;
}

.board-toolbar .btn-primary:hover,
.board-toolbar .btn-primary:focus,
#boardUrlLink:hover,
#boardUrlLink:focus {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
}

.board-filter-fields {
    display: grid;
    gap: 12px;
}

.board-filter .form-label {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 14px;
}

.board-filter .form-select,
.board-form-card .form-control,
.board-form-card .form-select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--text-main);
    font-size: 15px;
    box-shadow: none;
}

.board-filter .form-select:focus,
.board-form-card .form-control:focus,
.board-form-card .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.board-form-card textarea.form-control {
    min-height: 220px;
    padding-top: 12px;
    resize: vertical;
}

.board-form-card label {
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 8px;
}

.filter-submit {
    min-height: 48px;
    border: none;
    border-radius: 12px;
    background: #1f2937;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--text-sub);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.board-delete-trigger,
.board-delete-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    color: #b91c1c;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.board-delete-trigger:hover,
.board-delete-trigger:focus,
.board-delete-confirm:hover,
.board-delete-confirm:focus {
    background: #fee2e2;
    color: #991b1b;
}

.board-list {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr;
}

.board-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 22px 22px 20px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.board-edit-link {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.board-edit-link:hover,
.board-edit-link:focus {
    color: var(--text-main);
    border-color: var(--border-strong);
    background: #f9fbff;
}

.board-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.board-card-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.board-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.board-category-badge--promo {
    background: var(--tag-promo-bg);
    color: var(--tag-promo-text);
}

.board-category-badge--cast {
    background: var(--tag-cast-bg);
    color: var(--tag-cast-text);
}

.board-category-badge--other {
    background: var(--tag-other-bg);
    color: var(--tag-other-text);
}

.board-title {
    margin: 16px 0 0;
    font-size: 1.375rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.board-meta {
    width: 100%;
}

.board-author-link {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    text-decoration: none;
}

.board-author-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    object-fit: cover;
    background: #eef2f7;
    border: 1px solid var(--border);
}

.board-author-icon--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2f7;
    color: var(--text-sub);
    font-weight: 700;
}

.board-author-text {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: nowrap;
}

.board-author-name {
    font-size: 14px;
    font-weight: 700;
    color: #315efb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-author-link:hover .board-author-name,
.board-author-link:focus .board-author-name {
    color: #1d4ed8;
    text-decoration: underline;
}

.board-meta-date {
    font-size: 13px;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-body {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.8;
    color: #344054;
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.board-buttons {
    align-items: center;
    margin-top: 18px;
}

.board-link,
.board-detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: none;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.button-secondary {
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-main);
    font-size: 14px;
}

.button-secondary:hover,
.button-secondary:focus {
    border-color: var(--border-strong);
    background: #f9fbff;
    color: var(--text-main);
}

.link-arrow {
    gap: 6px;
    padding: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 14px;
}

.link-arrow::after {
    content: "→";
    transition: transform 0.18s ease;
}

.link-arrow:hover::after,
.link-arrow:focus::after {
    transform: translateX(2px);
}

.board-empty {
    padding: 32px;
    border-radius: 24px;
    background: var(--surface);
    text-align: center;
    color: var(--text-sub);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.board-pagination-wrap {
    margin-top: 24px;
}

.board-pagination .page-item {
    margin: 0 2px;
}

.board-pagination .page-link {
    border: none;
    border-radius: 999px;
    min-width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.board-pagination .page-item.active .page-link {
    background: var(--primary);
    color: #fff;
}

.board-pagination .page-item.disabled .page-link {
    opacity: 0.55;
    background: var(--surface);
}

.board-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(4px);
    z-index: 9999;
}

.board-modal.is-open {
    display: flex;
}

.board-modal-card {
    width: min(700px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 22px 22px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.board-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.board-modal-author-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.board-modal-author {
    font-size: 14px;
    font-weight: 700;
    color: #315efb;
}

.board-modal-date {
    font-size: 13px;
    color: var(--text-sub);
}

.board-modal-title {
    margin-bottom: 14px;
    color: var(--text-main);
    font-weight: 800;
}

.board-modal-body {
    white-space: pre-wrap;
    line-height: 1.9;
    color: var(--text-main);
}

.board-modal-actions {
    justify-content: flex-end;
    margin-top: 1.35rem;
}

.board-modal-url {
    word-break: break-all;
    color: var(--text-sub);
    margin-bottom: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

img {
    max-width: 100%;
    display: block;
}

@media (max-width: 767px) {
    .board-hero,
    .board-filter,
    .board-form-card,
    .board-card,
    .board-modal-card {
        padding: 18px;
        border-radius: 20px;
    }

    .board-actions .btn,
    .board-form-actions .btn,
    .board-form-actions a,
    .board-buttons > *,
    .board-filter-fields .btn {
        width: 100%;
    }

    .board-author-text {
        flex-wrap: wrap;
        gap: 4px 10px;
    }
}

@media (min-width: 768px) {
    .board-toolbar {
        grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
        align-items: stretch;
    }

    .board-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
