/* =========================================================
   Tutorial Studio · Digital Creation Library
   数字创作内容库
   ========================================================= */

:root {
    --page-bg: #f7f8fa;
    --surface: #ffffff;

    --text-primary: #202735;
    --text-secondary: #657083;
    --text-muted: #929baa;

    --border: #e7eaf0;
    --border-strong: #dce1e9;

    --accent: #4769d8;
    --accent-dark: #3554ba;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 21px;

    --shadow-card:
        0 3px 12px rgba(29, 41, 65, 0.035),
        0 1px 3px rgba(29, 41, 65, 0.025);

    --shadow-hover:
        0 14px 32px rgba(29, 41, 65, 0.09),
        0 3px 8px rgba(29, 41, 65, 0.04);

    --page-width: 1440px;
}


/* =========================
   基础
   ========================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;

    background: var(--page-bg);
    color: var(--text-primary);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "PingFang SC",
        "Microsoft YaHei",
        sans-serif;

    font-size: 14px;
    line-height: 1.6;

    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(71, 105, 216, 0.3);
    outline-offset: 3px;
}

a {
    color: inherit;
    text-decoration: none;
}

[hidden] {
    display: none !important;
}


/* =========================
   顶部导航
   ========================= */

.navbar {
    height: 76px;
    padding: 0 42px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;

    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #eaedf2;

    position: sticky;
    top: 0;
    z-index: 50;

    backdrop-filter: blur(16px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    flex-shrink: 0;
}

.brand-mark {
    width: 39px;
    height: 39px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    color: white;
    background: linear-gradient(145deg, #6685ec, #3e59bf);

    font-size: 23px;
    font-weight: 750;

    box-shadow:
        0 4px 10px rgba(71, 105, 216, 0.2);
}

.brand-title {
    color: #202735;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -0.3px;
    line-height: 1.4;
}

.brand-subtitle {
    margin-top: 2px;

    color: #8992a2;

    font-size: 9px;
    font-weight: 650;
    letter-spacing: 1.15px;
}

.nav-links {
    height: 100%;

    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    height: 100%;

    display: inline-flex;
    align-items: center;

    position: relative;

    color: #667083;
    font-size: 13px;
    font-weight: 550;

    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

.nav-links a.active::after {
    content: "";

    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;

    height: 3px;

    background: var(--accent);
    border-radius: 3px 3px 0 0;
}

.create-button {
    min-height: 40px;
    padding: 0 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    color: #ffffff;
    background: #4363cc;

    border-radius: 10px;

    font-size: 13px;
    font-weight: 650;

    box-shadow: 0 3px 8px rgba(67, 99, 204, 0.15);

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;

    flex-shrink: 0;
}

.create-button:hover {
    background: #3454bb;

    transform: translateY(-1px);

    box-shadow: 0 5px 12px rgba(67, 99, 204, 0.22);
}

.create-icon {
    font-size: 18px;
    line-height: 1;
}


/* =========================
   页面整体
   ========================= */

.page-container {
    width: min(var(--page-width), calc(100% - 84px));
    margin: 0 auto;
}


/* =========================
   标题与搜索
   ========================= */

.page-intro {
    padding: 49px 0 31px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(350px, 0.88fr);
    align-items: center;
    gap: 48px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;

    color: #64738e;

    font-size: 10px;
    font-weight: 750;
    letter-spacing: 2px;
}

.eyebrow-line {
    width: 22px;
    height: 2px;

    background: var(--accent);
    border-radius: 2px;
}

.intro-copy h1 {
    margin: 13px 0 10px;

    color: #202735;

    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.35;
    font-weight: 780;
    letter-spacing: -1.5px;
}

.title-period {
    color: var(--accent);
}

.intro-description {
    max-width: 620px;
    margin: 0;

    color: #717b8d;

    font-size: 14px;
    line-height: 1.9;
}

.search-area {
    width: 100%;
    max-width: 550px;
    justify-self: end;
}

.search-box {
    height: 54px;
    padding: 0 14px 0 17px;

    display: flex;
    align-items: center;
    gap: 12px;

    background: #ffffff;
    border: 1px solid #e1e5ed;
    border-radius: 13px;

    box-shadow:
        0 4px 14px rgba(29, 41, 65, 0.035);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.search-box:focus-within {
    border-color: #8ba2ee;

    box-shadow:
        0 0 0 4px rgba(71, 105, 216, 0.08);
}

.search-icon {
    width: 21px;
    height: 21px;

    flex-shrink: 0;

    color: #78849a;
}

.search-box input {
    width: 100%;
    min-width: 0;
    height: 100%;

    padding: 0;

    color: var(--text-primary);
    background: transparent;

    border: none;
    outline: none;

    font-size: 13px;
}

.search-box input::placeholder {
    color: #9aa3b1;
}

.search-box input:focus-visible {
    outline: none;
}

.search-shortcut {
    padding: 4px 8px;

    color: #78849a;
    background: #f3f5f8;

    border: 1px solid #eaedf2;
    border-radius: 6px;

    font-size: 11px;

    white-space: nowrap;
}

.search-hints {
    margin-top: 13px;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.hint-label {
    margin-right: 2px;

    color: #8992a2;
    font-size: 12px;
}

.search-hints button {
    padding: 4px 10px;

    color: #59667c;
    background: #ffffff;

    border: 1px solid #e7eaf0;
    border-radius: 7px;

    font-size: 11px;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.search-hints button:hover {
    color: var(--accent);
    background: #eef2ff;
    border-color: #d5defc;
}


/* =========================
   分类区域标题
   ========================= */

.category-section {
    padding-top: 13px;
}

.section-heading {
    margin-bottom: 23px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.section-kicker {
    color: #7c879a;

    font-size: 10px;
    font-weight: 750;
    letter-spacing: 1.8px;
}

.section-heading h2 {
    margin: 5px 0 5px;

    color: #252d3b;

    font-size: 25px;
    font-weight: 760;
    letter-spacing: -0.7px;
}

.section-heading p {
    margin: 0;

    color: #818b9c;

    font-size: 12px;
}

.category-summary {
    display: flex;
    align-items: baseline;
    gap: 7px;

    padding-bottom: 4px;

    white-space: nowrap;
}

.summary-number {
    color: #3d5fc9;

    font-size: 27px;
    font-weight: 760;
    letter-spacing: -1px;
}

.summary-label {
    color: #7c8798;
    font-size: 12px;
}


/* =========================
   一级分类卡片
   ========================= */

.category-grid {
    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 17px;
}

.category-card {
    --card-color: #e8eefa;

    min-width: 0;
    min-height: 225px;

    padding: 21px 20px 17px;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    position: relative;
    overflow: hidden;

    text-align: left;

    background: #ffffff;

    border: 1px solid #e8ebf1;
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-card);

    cursor: pointer;

    transition:
        transform 0.23s ease,
        border-color 0.23s ease,
        box-shadow 0.23s ease;
}

.category-card::before {
    content: "";

    width: 115px;
    height: 115px;

    position: absolute;
    top: -55px;
    right: -43px;

    border-radius: 50%;

    background: var(--card-color);
    opacity: 0.42;

    pointer-events: none;

    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px);

    border-color: #d8dfef;

    box-shadow: var(--shadow-hover);
}

.category-card:hover::before {
    transform: scale(1.25);
    opacity: 0.65;
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;

    position: relative;
    z-index: 1;
}

.category-icon {
    width: 53px;
    height: 53px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    background: var(--card-color);

    border: 1px solid rgba(70, 80, 100, 0.035);
    border-radius: 16px;

    font-size: 27px;
    line-height: 1;

    transition: transform 0.23s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.06) rotate(-3deg);
}

.card-arrow {
    width: 29px;
    height: 29px;

    display: grid;
    place-items: center;

    color: #a2aaba;
    background: #f7f8fb;

    border-radius: 50%;

    font-size: 16px;

    transition:
        color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.category-card:hover .card-arrow {
    color: #ffffff;
    background: var(--accent);

    transform: translateX(2px);
}

.category-card h3 {
    margin: 17px 0 6px;

    color: #283142;

    font-size: 17px;
    font-weight: 730;
    letter-spacing: -0.35px;

    position: relative;
    z-index: 1;
}

.category-description {
    min-height: 40px;
    margin: 0;

    color: #7d8798;

    font-size: 12px;
    line-height: 1.75;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;

    position: relative;
    z-index: 1;
}

.card-divider {
    height: 1px;
    margin: 15px 0 12px;

    background: #edf0f4;
}

.child-preview {
    min-height: 22px;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;

    position: relative;
    z-index: 1;
}

.child-chip {
    max-width: 100%;

    padding: 3px 7px;

    color: #69758a;
    background: #f5f7fa;

    border-radius: 5px;

    font-size: 10px;
    line-height: 1.5;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.child-more {
    color: #9aa3b1;
    font-size: 10px;
}

.no-children {
    color: #a0a8b5;
    font-size: 11px;
}


/* =========================
   加载状态
   ========================= */

.loading-state {
    grid-column: 1 / -1;

    min-height: 230px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    color: #7f8999;

    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    font-size: 13px;
}

.loading-spinner {
    width: 18px;
    height: 18px;

    border: 2px solid #e1e6f2;
    border-top-color: var(--accent);

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================
   无搜索结果
   ========================= */

.empty-state {
    padding: 60px 20px;

    text-align: center;

    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.empty-icon {
    width: 58px;
    height: 58px;

    margin: 0 auto 15px;

    display: grid;
    place-items: center;

    color: #6e83ca;
    background: #eef2ff;

    border-radius: 18px;

    font-size: 31px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.empty-state p {
    margin: 0 0 20px;

    color: #7c8798;
    font-size: 13px;
}

.reset-button {
    padding: 9px 15px;

    color: #ffffff;
    background: var(--accent);

    border: none;
    border-radius: 9px;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.reset-button:hover {
    background: var(--accent-dark);
}


/* =========================
   灵感说明区
   ========================= */

.discovery-section {
    margin-top: 30px;
    margin-bottom: 35px;
    padding: 24px 27px;

    display: flex;
    align-items: center;
    gap: 18px;

    background:
        linear-gradient(
            110deg,
            #edf1ff 0%,
            #f4f2ff 56%,
            #f8f5ff 100%
        );

    border: 1px solid #e5e8f8;
    border-radius: 18px;
}

.discovery-icon {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    color: #526cd0;
    background: #ffffff;

    border: 1px solid #e5e8f8;
    border-radius: 14px;

    font-size: 25px;
}

.discovery-copy {
    min-width: 0;
    flex: 1;
}

.discovery-copy h3 {
    margin: 0 0 5px;

    color: #34416c;

    font-size: 15px;
    font-weight: 720;
}

.discovery-copy p {
    max-width: 750px;
    margin: 0;

    color: #727e9d;

    font-size: 12px;
    line-height: 1.9;
}

.discovery-badge {
    color: #7583bb;

    font-size: 9px;
    font-weight: 750;
    letter-spacing: 1.3px;

    white-space: nowrap;
}


/* =========================
   分类详情与层级导航
   ========================= */

.category-detail {
    margin-top: 30px;
    margin-bottom: 45px;
    padding: 25px;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: 20px;

    box-shadow: var(--shadow-card);
}

.detail-topbar {
    padding-bottom: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    border-bottom: 1px solid #edf0f4;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;

    color: #8b95a5;

    font-size: 12px;
}

.breadcrumb button {
    padding: 0;

    color: #6f7b90;
    background: transparent;

    border: none;

    cursor: pointer;
}

.breadcrumb button:hover {
    color: var(--accent);
}

.breadcrumb .breadcrumb-current {
    color: #33405a;
    font-weight: 650;
}

.breadcrumb-separator {
    color: #c0c6d0;
}

.close-detail-button {
    padding: 8px 12px;

    flex-shrink: 0;

    color: #61708a;
    background: #f6f7fa;

    border: 1px solid #e9edf3;
    border-radius: 8px;

    font-size: 11px;

    cursor: pointer;
}

.close-detail-button:hover {
    color: var(--accent);
    background: #eef2ff;
}

.detail-heading {
    padding: 26px 0;

    display: flex;
    align-items: center;
    gap: 18px;
}

.detail-icon {
    width: 69px;
    height: 69px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    background: #edf1ff;
    border-radius: 20px;

    font-size: 35px;
}

.detail-heading h2 {
    margin: 5px 0;

    color: #273144;

    font-size: 25px;
    font-weight: 750;
}

.detail-heading p {
    margin: 0;

    color: #7c8799;

    font-size: 12px;
    line-height: 1.8;
}

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

.subcategory-card {
    min-width: 0;
    padding: 17px;

    display: flex;
    align-items: center;
    gap: 13px;

    text-align: left;

    background: #ffffff;
    border: 1px solid #e7eaf0;
    border-radius: 13px;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.subcategory-card:hover {
    background: #f8f9ff;
    border-color: #cbd5fa;

    transform: translateY(-2px);
}

.subcategory-symbol {
    width: 37px;
    height: 37px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    color: #6075c5;
    background: #eef2ff;

    border-radius: 10px;

    font-size: 16px;
}

.subcategory-copy {
    min-width: 0;
    flex: 1;
}

.subcategory-copy strong {
    display: block;

    color: #354056;

    font-size: 13px;
    font-weight: 680;
}

.subcategory-copy span {
    display: block;
    margin-top: 3px;

    color: #9aa2b0;

    font-size: 10px;
}

.subcategory-arrow {
    color: #a4adbb;
    font-size: 17px;
}

.category-content-note {
    margin-top: 20px;
    padding: 17px;

    display: flex;
    align-items: flex-start;
    gap: 12px;

    background: #f7f8fc;
    border: 1px solid #edf0f6;
    border-radius: 12px;
}

.content-note-icon {
    color: #5d73cf;
    font-size: 19px;
}

.category-content-note strong {
    color: #43506a;
    font-size: 12px;
}

.category-content-note p {
    margin: 5px 0 0;

    color: #838da0;

    font-size: 11px;
    line-height: 1.8;
}


/* =========================
   底部
   ========================= */

.page-footer {
    min-height: 80px;
    padding: 20px 42px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    background: #ffffff;
    border-top: 1px solid #eaedf2;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 9px;

    color: #596579;

    font-size: 12px;
    font-weight: 700;
}

.footer-mark {
    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    color: #ffffff;
    background: #526bc8;

    border-radius: 7px;

    font-size: 14px;
}

.page-footer > p {
    margin: 0;

    color: #9aa2af;

    font-size: 11px;
}


/* =========================
   中等屏幕
   ========================= */

@media (max-width: 1150px) {

    .navbar {
        padding-right: 28px;
        padding-left: 28px;
    }

    .page-container {
        width: calc(100% - 56px);
    }

    .page-intro {
        grid-template-columns: 1fr;
        gap: 24px;

        padding-top: 38px;
    }

    .search-area {
        max-width: 100%;
        justify-self: stretch;
    }

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

    .category-card {
        min-height: 220px;
    }

    .page-footer {
        padding-right: 28px;
        padding-left: 28px;
    }

}


/* =========================
   平板与手机
   ========================= */

@media (max-width: 760px) {

    .navbar {
        height: 64px;
        padding: 0 18px;
        gap: 12px;
    }

    .brand {
        gap: 9px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;

        border-radius: 10px;

        font-size: 20px;
    }

    .brand-title {
        font-size: 14px;
    }

    .brand-subtitle {
        font-size: 8px;
        letter-spacing: 0.6px;
    }

    .nav-links {
        display: none;
    }

    .create-button {
        min-height: 36px;
        padding: 0 11px;

        font-size: 11px;
    }

    .page-container {
        width: calc(100% - 36px);
    }

    .page-intro {
        padding-top: 31px;
        padding-bottom: 25px;
        gap: 21px;
    }

    .intro-copy h1 {
        margin-top: 11px;

        font-size: 28px;
        letter-spacing: -1px;
    }

    .intro-description {
        font-size: 12px;
        line-height: 1.9;
    }

    .search-box {
        height: 49px;
        padding-right: 10px;
        padding-left: 13px;
        gap: 9px;
    }

    .search-box input {
        font-size: 12px;
    }

    .search-shortcut {
        display: none;
    }

    .search-hints {
        gap: 7px;
    }

    .hint-label {
        font-size: 11px;
    }

    .search-hints button {
        padding: 4px 8px;
        font-size: 10px;
    }

    .section-heading {
        margin-bottom: 17px;
    }

    .section-heading h2 {
        font-size: 22px;
    }

    .section-heading p {
        max-width: 290px;

        font-size: 11px;
        line-height: 1.8;
    }

    .summary-number {
        font-size: 23px;
    }

    .summary-label {
        font-size: 10px;
    }

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

    .category-card {
        min-height: 214px;
        padding: 15px 14px 13px;

        border-radius: 16px;
    }

    .category-icon {
        width: 44px;
        height: 44px;

        border-radius: 13px;

        font-size: 23px;
    }

    .card-arrow {
        width: 25px;
        height: 25px;

        font-size: 14px;
    }

    .category-card h3 {
        margin-top: 14px;

        font-size: 15px;
    }

    .category-description {
        min-height: 37px;
        font-size: 11px;
    }

    .card-divider {
        margin: 11px 0 9px;
    }

    .child-preview {
        gap: 5px;
    }

    .child-chip {
        padding: 3px 6px;
        font-size: 9px;
    }

    .discovery-section {
        margin-top: 22px;
        padding: 17px;

        align-items: flex-start;
        gap: 12px;

        border-radius: 15px;
    }

    .discovery-icon {
        width: 37px;
        height: 37px;

        border-radius: 11px;

        font-size: 20px;
    }

    .discovery-copy h3 {
        font-size: 13px;
    }

    .discovery-copy p {
        font-size: 11px;
        line-height: 1.8;
    }

    .discovery-badge {
        display: none;
    }

    .category-detail {
        padding: 17px;
        border-radius: 16px;
    }

    .detail-topbar {
        align-items: flex-start;
    }

    .breadcrumb {
        font-size: 11px;
        line-height: 1.8;
    }

    .close-detail-button {
        padding: 7px 9px;
        font-size: 10px;
    }

    .detail-heading {
        padding: 22px 0;
        gap: 13px;
    }

    .detail-icon {
        width: 54px;
        height: 54px;

        border-radius: 15px;

        font-size: 28px;
    }

    .detail-heading h2 {
        font-size: 20px;
    }

    .detail-heading p {
        font-size: 11px;
    }

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

    .subcategory-card {
        padding: 12px 10px;
        gap: 8px;
    }

    .subcategory-symbol {
        width: 31px;
        height: 31px;

        border-radius: 8px;

        font-size: 14px;
    }

    .subcategory-copy strong {
        font-size: 11px;
    }

    .subcategory-copy span {
        font-size: 9px;
    }

    .subcategory-arrow {
        font-size: 13px;
    }

    .page-footer {
        min-height: 75px;
        padding: 18px;

        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .page-footer > p {
        font-size: 10px;
    }

}


/* =========================
   小屏幕
   ========================= */

@media (max-width: 360px) {

    .page-container {
        width: calc(100% - 24px);
    }

    .navbar {
        padding-right: 12px;
        padding-left: 12px;
    }

    .brand-subtitle {
        display: none;
    }

    .intro-copy h1 {
        font-size: 25px;
    }

    .category-grid {
        gap: 9px;
    }

    .category-card {
        padding: 12px 10px;
        min-height: 208px;
    }

    .category-card h3 {
        font-size: 14px;
    }

    .category-description {
        font-size: 10px;
    }

    .child-chip {
        font-size: 9px;
    }

    .subcategory-grid {
        grid-template-columns: 1fr;
    }

}