* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Arial, "Microsoft YaHei", sans-serif;
    color: #202124;
    background: #eef0fb;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 276px minmax(0, 1fr);
    gap: 20px;
    padding: 20px;
    align-items: start;
}

.app-sidebar {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-nav-card,
.app-info-card {
    background: #fff;
    border: 1px solid #dfe5ef;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.app-kicker {
    margin: 0 0 8px;
    color: #667085;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-sidebar h2,
.app-sidebar h3,
.app-page-head h1 {
    margin: 0;
}

.app-muted {
    margin: 8px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.6;
}

.app-nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.app-nav-link {
    display: block;
    min-height: 42px;
    padding: 11px 14px;
    border: 1px solid #d7deea;
    border-radius: 14px;
    background: #fff;
    color: #162033;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.app-nav-link.is-active {
    border-color: #bfd2ff;
    background: #eff5ff;
    color: #1d4ed8;
}

.app-nav-link.is-danger {
    color: #b42318;
    background: #fff4f3;
    border-color: #fecaca;
}

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.app-page-head {
    padding: 18px 22px;
    border: 1px solid #dfe5ef;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.app-page-head p {
    margin: 8px 0 0;
    color: #667085;
    font-size: 14px;
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .app-sidebar {
        position: static;
    }
}

.studio-body {
    height: 100vh;
    overflow: hidden;
}

.studio-body button,
.studio-body input,
.studio-body a,
.auth-body button,
.auth-body input {
    font: inherit;
}

.studio-body button,
.auth-body button {
    cursor: pointer;
}

.studio-body .topbar {
    height: 70px;
    padding: 0 20px 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.studio-body .brand {
    min-width: 320px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.studio-body .brand-logo {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #fff;
    background: #050505;
    font-size: 26px;
    font-weight: 900;
}

.studio-body .brand h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 500;
}

.studio-body .brand p {
    margin: 2px 0 0;
    color: #747987;
    font-size: 12px;
}

.studio-body .top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}

.studio-body .top-actions button,
.studio-body .avatar {
    width: auto;
    min-width: 0;
    min-height: 44px;
    border: 1px solid rgba(60, 64, 67, 0.09);
    border-radius: 24px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.55);
    color: #202124;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.studio-body .top-actions .primary-action {
    min-width: 184px;
    color: #fff;
    background: #050505;
}

.studio-body .avatar {
    width: 52px;
    height: 52px;
    padding: 0;
    border: 3px solid #f3c146;
    background: #009582;
    color: #fff;
    font-size: 20px;
}

.studio-body .workspace {
    height: calc(100vh - 92px);
    padding: 0 20px 0 4px;
    display: grid;
    grid-template-columns: minmax(300px, 25%) minmax(460px, 1fr) minmax(300px, 25%);
    gap: 20px;
}

.studio-body .panel {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(60, 64, 67, 0.12);
}

.studio-body .panel-head {
    min-height: 66px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #dfe3ee;
}

.studio-body .panel-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
}

.studio-body .head-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.studio-body .icon-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    padding: 0;
    background: transparent;
    color: #44474f;
    font-size: 20px;
}

.studio-body .wide-outline {
    width: auto;
    min-height: 44px;
    margin: 22px 22px 12px;
    border: 1px solid #d7dce8;
    border-radius: 22px;
    background: #fff;
    color: #202124;
    font-size: 18px;
    font-weight: 700;
}

.studio-body .search-card {
    margin: 10px 22px 12px;
    padding: 18px 12px 12px;
    border: 1px solid #d7dce8;
    border-radius: 22px;
    background: #fafafa;
}

.studio-body .search-card p {
    margin: 0 0 14px;
    color: #565960;
}

.studio-body .search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.studio-body .search-row span {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #d7dce8;
    border-radius: 20px;
    background: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.studio-body .search-row button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: #e2e2e2;
    color: #202124;
    font-size: 20px;
}

.studio-body .source-list,
.studio-body .chat-scroll,
.studio-body .note-list {
    overflow: auto;
}

.studio-body .source-list {
    padding: 4px 22px 24px;
}

.studio-body .source-group,
.studio-body .source-item {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #303239;
}

.studio-body .source-group {
    justify-content: space-between;
}

.studio-body .source-item strong {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
    font-weight: 500;
}

.studio-body .source-item em,
.studio-body .source-group span:last-child {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    background: #e0e4ed;
    color: #555;
    font-style: normal;
    font-weight: 900;
}

.studio-body .ppt,
.studio-body .pdf {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 4px;
    border: 3px solid;
    font-size: 10px;
    font-weight: 900;
}

.studio-body .ppt {
    color: #f7b500;
    border-color: #f7b500;
}

.studio-body .pdf {
    color: #e23b32;
    border-color: #e23b32;
}

.studio-body .chat-panel {
    position: relative;
}

.studio-body .chat-scroll {
    flex: 1;
    padding: 16px 36px 120px;
}

.studio-body .answer {
    max-width: 820px;
    margin: 0 auto;
    font-size: 19px;
    line-height: 1.65;
}

.studio-body .answer p,
.studio-body .answer ul,
.studio-body .answer ol {
    margin-top: 0;
}

.studio-body .answer li {
    margin: 10px 0;
}

.studio-body .tip-title {
    margin-top: 28px;
    font-weight: 900;
}

.studio-body .answer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.studio-body .answer-actions button {
    width: auto;
    min-height: 42px;
    border: 1px solid #d7dce8;
    border-radius: 20px;
    padding: 0 14px;
    background: #fff;
    color: #34373d;
}

.studio-body .prompt-box {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
    min-height: 100px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: 1px solid #d7dce8;
    border-radius: 24px;
    background: #fff;
}

.studio-body .prompt-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    font-size: 20px;
}

.studio-body .prompt-box span {
    color: #5f636d;
    white-space: nowrap;
}

.studio-body .prompt-box button {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: #ececec;
    color: #202124;
    font-size: 30px;
}

.studio-body .tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 22px;
    border-bottom: 1px solid #dfe3ee;
}

.studio-body .studio-tool {
    width: auto;
    min-height: 76px;
    border: 0;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
}

.studio-body .studio-tool span {
    font-weight: 800;
}

.studio-body .studio-tool b {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    font-size: 28px;
}

.studio-body .blue { background: #e8ebfa; color: #214c94; }
.studio-body .gold { background: #f0efe0; color: #8b6920; }
.studio-body .green { background: #dff2e2; color: #1f743a; }
.studio-body .purple { background: #f0e5ef; color: #94317e; }
.studio-body .sand { background: #f2f1e7; color: #856d25; }
.studio-body .rose { background: #f5e6e5; color: #b13d39; }
.studio-body .cyan { background: #dbf1f6; color: #167599; }
.studio-body .violet { background: #efe5ee; color: #8a217f; }
.studio-body .slate { background: #e9ecf8; color: #244a88; }

.studio-body .studio-panel {
    position: relative;
}

.studio-body .note-list {
    padding: 18px 22px 90px;
}

.studio-body .note-row {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.studio-body .note-row span {
    width: 34px;
    color: #333;
    font-size: 24px;
}

.studio-body .note-row div {
    min-width: 0;
    flex: 1;
}

.studio-body .note-row strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
    font-weight: 600;
}

.studio-body .note-row p {
    margin: 3px 0 0;
    color: #777b88;
}

.studio-body .note-row em {
    font-style: normal;
    font-size: 24px;
}

.studio-body .floating-note {
    position: absolute;
    right: 28px;
    bottom: 22px;
    min-height: 56px;
    border: 0;
    border-radius: 28px;
    padding: 0 28px;
    background: #050505;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
}

.studio-body .disclaimer {
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888b94;
    font-size: 15px;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background: #eef0fb;
}

.auth-body .auth-layout {
    width: min(100%, 960px);
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1.05fr);
    gap: 20px;
}

.auth-body .auth-intro,
.auth-body .auth-panel {
    min-height: 520px;
    padding: 34px;
    border-radius: 28px;
    background: #fff;
}

.auth-body .auth-intro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(135deg, #111827, #1b64da 55%, #00a88f);
}

.auth-body .app-logo {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #050505;
    font-size: 30px;
    font-weight: 900;
}

.auth-body .eyebrow {
    margin: auto 0 8px;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 800;
    text-transform: uppercase;
}

.auth-body .auth-intro h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.05;
}

.auth-body .auth-intro p:last-child {
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.8;
}

.auth-body .auth-tabs {
    display: flex;
    gap: 8px;
    padding: 5px;
    margin-bottom: 22px;
    border-radius: 18px;
    background: #e9eef4;
}

.auth-body .auth-tabs button {
    flex: 1;
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    color: #666b76;
    background: transparent;
    font-weight: 800;
}

.auth-body .auth-tabs .active {
    color: #111827;
    background: #fff;
}

.auth-body .auth-panel form {
    display: none;
    gap: 12px;
}

.auth-body .auth-panel form.active {
    display: grid;
}

.auth-body .auth-panel input {
    height: 50px;
    border: 1px solid #e2e6ef;
    border-radius: 16px;
    padding: 0 15px;
    outline: none;
}

.auth-body .auth-panel input:focus {
    border-color: #1b64da;
    box-shadow: 0 0 0 4px rgba(27, 100, 218, 0.12);
}

.auth-body .auth-panel form button {
    min-height: 50px;
    border: 0;
    border-radius: 18px;
    background: #050505;
    color: #fff;
    font-weight: 800;
}

.auth-body .message {
    min-height: 22px;
    color: #6b7280;
}

.auth-body .message.success {
    color: #12a150;
}

.auth-body .message.error {
    color: #d14343;
}

@media (max-width: 1180px) {
    .studio-body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .studio-body .workspace {
        height: auto;
        grid-template-columns: 1fr;
        padding: 0 16px 24px;
    }

    .studio-body .panel {
        height: auto;
        min-height: 420px;
    }

    .studio-body .chat-panel {
        min-height: 680px;
    }
}

@media (max-width: 760px) {
    .studio-body .topbar {
        height: auto;
        padding: 14px 16px;
        align-items: flex-start;
        flex-direction: column;
    }

    .studio-body .brand {
        min-width: 0;
    }

    .studio-body .top-actions {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .studio-body .workspace {
        padding: 0 10px 20px;
        gap: 12px;
    }

    .studio-body .tool-grid,
    .auth-body .auth-layout {
        grid-template-columns: 1fr;
    }

    .studio-body .chat-scroll {
        padding: 14px 18px 130px;
    }

    .studio-body .answer {
        font-size: 17px;
    }

    .studio-body .prompt-box {
        left: 12px;
        right: 12px;
    }

    .auth-body {
        padding: 12px;
    }

    .auth-body .auth-intro,
    .auth-body .auth-panel {
        min-height: auto;
        padding: 24px;
    }
}
