.board-hub-page {
    --hub-bg: #edf5ff;
    --hub-ink: #172033;
    --hub-sub: #60708a;
    --hub-line: rgba(51, 65, 85, 0.13);
    --hub-blue: #3478f6;
    --hub-violet: #7b61ff;
    --hub-green: #18b981;
    --hub-yellow: #f5b938;
    --hub-red: #f45b78;
    --hub-shadow: 0 18px 50px rgba(47, 78, 125, 0.16);
    min-height: 100vh;
    margin: 0;
    color: var(--hub-ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(100, 181, 255, 0.55), transparent 28rem),
        radial-gradient(circle at 92% 6%, rgba(123, 97, 255, 0.3), transparent 24rem),
        radial-gradient(circle at 50% 100%, rgba(94, 230, 181, 0.34), transparent 32rem),
        linear-gradient(180deg, #f4f9ff 0%, var(--hub-bg) 42%, #f5fbff 100%);
}

.board-hub-page button,
.board-hub-page input,
.board-hub-page select {
    font: inherit;
}

.hub-main {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 54px;
}

.hub-topbar {
    position: sticky;
    top: 12px;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 28px rgba(47, 78, 125, 0.12);
}

.hub-top-left,
.hub-top-actions,
.hero-actions,
.quest-actions,
.book-actions,
.drawer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hub-brand h1 {
    margin: 0;
    font-size: clamp(1.3rem, 2.5vw, 1.9rem);
    line-height: 1.1;
}

.hub-brand p,
.hub-section-title p {
    margin: 5px 0 0;
    color: var(--hub-sub);
    font-weight: 700;
    line-height: 1.45;
}

.hub-home,
.hub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 15px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.hub-home,
.hub-btn-white {
    color: var(--hub-ink);
    background: #fff;
    border-color: var(--hub-line);
    box-shadow: 0 8px 20px rgba(47, 78, 125, 0.08);
}

.hub-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--hub-blue), var(--hub-violet));
    box-shadow: 0 14px 28px rgba(52, 120, 246, 0.24);
}

.hub-btn-green {
    color: #fff;
    background: linear-gradient(135deg, var(--hub-green), #10a5d8);
}

.hub-btn-yellow {
    color: #392715;
    background: linear-gradient(135deg, #ffd76a, var(--hub-yellow));
}

.hub-btn-small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.85rem;
}

.hub-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
    gap: 16px;
    margin-top: 16px;
}

.mission-hero,
.today-panel,
.hub-section {
    border-radius: 34px;
    box-shadow: var(--hub-shadow);
}

.mission-hero {
    position: relative;
    overflow: hidden;
    min-height: 326px;
    padding: 26px;
    color: #fff;
    background: linear-gradient(135deg, rgba(52, 120, 246, 0.95), rgba(123, 97, 255, 0.92));
    isolation: isolate;
}

.mission-hero::before {
    content: "";
    position: absolute;
    width: 430px;
    height: 430px;
    right: -150px;
    top: -180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    z-index: -1;
}

.mission-hero::after {
    content: "MISSION";
    position: absolute;
    right: -20px;
    bottom: 8px;
    color: rgba(255, 255, 255, 0.08);
    font-size: 6.5rem;
    font-weight: 1000;
    z-index: -1;
}

.hero-badge,
.count-pill,
.label,
.micro {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-weight: 900;
    white-space: nowrap;
}

.hero-badge {
    gap: 8px;
    min-height: 32px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.mission-hero h2 {
    margin: 18px 0 10px;
    max-width: 680px;
    font-size: clamp(2rem, 4.5vw, 3.75rem);
    line-height: 1.03;
}

.mission-hero p {
    margin: 0;
    max-width: 670px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.02rem;
    line-height: 1.65;
    font-weight: 700;
}

.hero-actions {
    flex-wrap: wrap;
    margin-top: 22px;
}

.hero-actions .hub-btn {
    border-radius: 17px;
    min-height: 50px;
    padding: 0 18px;
}

.today-panel {
    padding: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.meter-card,
.guide-card,
.quest-card,
.comment-card,
.teacher-tip,
.friend-tip,
.time-row,
.book-card,
.drawer-panel {
    background: #fff;
    border: 1px solid rgba(51, 65, 85, 0.08);
    box-shadow: 0 10px 26px rgba(47, 78, 125, 0.08);
}

.meter-card,
.guide-card {
    padding: 18px;
    border-radius: 26px;
}

.meter-head,
.hub-section-head,
.quest-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.meter-head h3,
.guide-card h3,
.teacher-tip h3,
.friend-tip h3 {
    margin: 0;
}

.progress {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5eefc;
}

.progress > div {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--hub-green), var(--hub-blue));
    transition: width 0.25s ease;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-top: 12px;
}

.qstat {
    padding: 13px;
    border-radius: 20px;
    background: #f3f7ff;
}

.qstat span {
    display: block;
    color: var(--hub-sub);
    font-size: 0.78rem;
    font-weight: 900;
}

.qstat strong {
    display: block;
    margin-top: 5px;
    font-size: 1.75rem;
    line-height: 1;
}

.guide-card {
    margin-top: 12px;
    background: linear-gradient(135deg, rgba(255, 215, 106, 0.38), rgba(255, 255, 255, 0.82));
    border-color: rgba(245, 185, 56, 0.22);
}

.guide-card p,
.teacher-tip p,
.drawer-panel p {
    margin: 8px 0 0;
    color: var(--hub-sub);
    line-height: 1.6;
    font-weight: 740;
}

.hub-dock {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.hub-dock button {
    min-height: 76px;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 10px 26px rgba(47, 78, 125, 0.1);
    color: var(--hub-ink);
    font-weight: 900;
    cursor: pointer;
}

.hub-dock button b {
    display: block;
    margin-top: 3px;
    color: var(--hub-sub);
    font-size: 0.76rem;
}

.hub-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
    padding: 12px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 28px rgba(47, 78, 125, 0.1);
}

.hub-search {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 15px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--hub-line);
}

.hub-search input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--hub-ink);
    font-weight: 800;
    background: transparent;
}

.hub-toolbar select {
    min-height: 46px;
    border: 1px solid var(--hub-line);
    border-radius: 999px;
    color: var(--hub-ink);
    background: #fff;
    padding: 0 14px;
    font-weight: 900;
}

.hub-seg {
    display: flex;
    gap: 5px;
    padding: 5px;
    border-radius: 999px;
    background: #eaf2ff;
}

.hub-seg button {
    min-height: 36px;
    border: 0;
    border-radius: 999px;
    padding: 0 12px;
    background: transparent;
    color: var(--hub-sub);
    font-weight: 900;
    cursor: pointer;
}

.hub-seg button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--hub-blue), var(--hub-violet));
}

.hub-section {
    margin-top: 18px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.hub-section-head {
    align-items: flex-end;
    margin-bottom: 14px;
}

.hub-section-title h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    line-height: 1.18;
}

.count-pill {
    min-height: 34px;
    padding: 0 12px;
    color: var(--hub-blue);
    background: #edf4ff;
    border: 1px solid rgba(52, 120, 246, 0.12);
}

.quest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.quest-card {
    display: flex;
    flex-direction: column;
    min-height: 245px;
    padding: 18px;
    border-radius: 28px;
}

.quest-card[data-board-card-link] {
    cursor: pointer;
}

.quest-card[data-board-card-link]:hover .quest-title-link {
    color: var(--hub-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.quest-card.priority {
    background: radial-gradient(circle at top right, rgba(255, 215, 106, 0.4), transparent 11rem), #fff;
    border-color: rgba(245, 185, 56, 0.32);
}

.quest-card.done {
    background: radial-gradient(circle at top right, rgba(94, 230, 181, 0.3), transparent 11rem), #fff;
}

.quest-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 20px;
    color: #fff;
    font-size: 1.55rem;
    background: linear-gradient(135deg, var(--hub-blue), var(--hub-violet));
}

.label {
    min-height: 28px;
    padding: 0 10px;
    background: #eef4ff;
    color: var(--hub-blue);
    font-size: 0.78rem;
}

.label.hot {
    background: #fff3cf;
    color: #9a6400;
}

.label.done {
    background: #dffbef;
    color: #047857;
}

.label.lock {
    background: #edf2f7;
    color: #64748b;
}

.label.comment {
    background: #fff3cf;
    color: #925f00;
}

.quest-card h3,
.comment-card h3,
.book-card h3 {
    margin: 14px 0 8px;
    line-height: 1.3;
}

.quest-title-link {
    color: inherit;
    text-decoration: none;
}

.quest-title-link:focus-visible {
    outline: 3px solid rgba(52, 120, 246, 0.35);
    outline-offset: 3px;
    border-radius: 8px;
}

.quest-card p {
    margin: 0;
    color: var(--hub-sub);
    font-size: 0.91rem;
    line-height: 1.55;
    font-weight: 720;
}

.quest-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.micro {
    min-height: 26px;
    padding: 0 9px;
    color: #50627c;
    background: #f1f5fb;
    font-size: 0.76rem;
}

.quest-actions,
.book-actions {
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 16px;
}

.quest-actions .hub-btn,
.book-actions .hub-btn,
.drawer-actions .hub-btn {
    flex: 1 1 118px;
    border-radius: 15px;
}

.comment-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 12px;
}

#commentList,
#friendCommentList {
    display: grid;
    gap: 10px;
}

.comment-card {
    padding: 18px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255, 243, 207, 0.92), rgba(255, 255, 255, 0.96));
    border-color: rgba(245, 185, 56, 0.28);
}

.comment-card.friend-comment {
    background: linear-gradient(135deg, rgba(221, 255, 241, 0.94), rgba(255, 255, 255, 0.97));
    border-color: rgba(41, 184, 132, 0.24);
}

.from {
    margin-top: 8px;
    color: #8a5b00;
    font-weight: 900;
    font-size: 0.9rem;
}

.speech {
    margin-top: 14px;
    padding: 15px;
    border-radius: 20px;
    background: #fffaf0;
    border: 1px solid rgba(245, 185, 56, 0.18);
    color: #49351a;
    line-height: 1.65;
    font-weight: 780;
}

.friend-comment .from {
    color: #126947;
}

.friend-comment .speech {
    background: #f1fff8;
    border-color: rgba(41, 184, 132, 0.18);
}

.teacher-tip {
    padding: 16px;
    border-radius: 26px;
}

.timeline {
    display: grid;
    gap: 10px;
}

.time-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border-radius: 22px;
}

.time-date {
    color: var(--hub-sub);
    font-size: 0.83rem;
    font-weight: 900;
}

.time-title strong,
.time-title span {
    display: block;
}

.time-title span {
    margin-top: 3px;
    color: var(--hub-sub);
    font-size: 0.82rem;
    font-weight: 750;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.book-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 170px;
    padding: 13px;
    border-radius: 22px;
}

.book-cover {
    display: grid;
    place-items: center;
    height: 68px;
    border-radius: 18px;
    color: #fff;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #64b5ff, #7b61ff);
}

.hub-empty {
    padding: 24px;
    border-radius: 24px;
    text-align: center;
    color: var(--hub-sub);
    background: #fff;
    border: 1px dashed rgba(51, 65, 85, 0.18);
    font-weight: 800;
    line-height: 1.6;
}

.hub-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 60;
    width: min(460px, 100%);
    transform: translateX(105%);
    transition: transform 0.22s ease;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    border-left: 1px solid rgba(51, 65, 85, 0.12);
    box-shadow: -24px 0 50px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
}

.hub-drawer.open {
    transform: translateX(0);
}

.hub-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.1);
}

.hub-drawer-head h2 {
    margin: 0;
    font-size: 1.4rem;
}

.hub-drawer-head p {
    margin: 5px 0 0;
    color: var(--hub-sub);
    line-height: 1.5;
    font-weight: 760;
}

.hub-drawer-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #edf4ff;
    color: var(--hub-ink);
    font-weight: 900;
    font-size: 1.15rem;
    cursor: pointer;
}

.hub-drawer-body {
    padding: 18px 20px 22px;
    overflow: auto;
}

.drawer-panel {
    padding: 16px;
    border-radius: 24px;
    margin-bottom: 12px;
}

.drawer-panel h3 {
    margin: 0 0 8px;
}

.drawer-actions {
    margin-top: 14px;
}

.hub-mask {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.36);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.hub-mask.show {
    opacity: 1;
    pointer-events: auto;
}

.hub-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 100;
    transform: translateX(-50%) translateY(24px);
    width: min(560px, calc(100% - 28px));
    padding: 15px 16px;
    border-radius: 20px;
    color: #fff;
    background: rgba(18, 26, 42, 0.92);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
    text-align: center;
    font-weight: 900;
}

.hub-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hidden {
    display: none !important;
}

@media (max-width: 1080px) {
    .hub-hero,
    .comment-layout {
        grid-template-columns: 1fr;
    }

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

    .library-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .hub-main {
        width: min(100% - 20px, 1240px);
        padding-top: 10px;
    }

    .hub-topbar,
    .hub-top-left {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .hub-top-actions,
    .hub-top-actions .hub-btn,
    .hub-home {
        width: 100%;
    }

    .hub-toolbar {
        grid-template-columns: 1fr;
    }

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

    .quest-grid,
    .library-grid {
        grid-template-columns: 1fr;
    }

    .time-row {
        grid-template-columns: 1fr;
    }

    .mission-hero {
        min-height: auto;
        padding: 22px;
    }

    .mission-hero::after {
        font-size: 4.2rem;
    }
}

@media (max-width: 520px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }

    .hub-section,
    .today-panel {
        padding: 14px;
    }

    .hub-section-head,
    .drawer-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}
