/* 抽屉样式 */
@import './fonts.css';

.drawer {
    position: fixed;
    right: 0;
    top: 0;
    width: min(540px, 30vw);
    height: 100vh;
    background: #d1d4d8;
    border-left: 1px solid rgba(255, 255, 255);
    box-shadow: #fff 0px 0px 30px;
    transform: translateX(100%);
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1700;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 35px;
    display: flex;
    flex-direction: column;
}

.drawer.active {
    transform: translateX(0) !important;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #fff;
}

.drawer-title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    font-family: 'Alibaba PuHuiTi', 'Alibaba PuHuiTi Subset', 'Noto Sans SC', sans-serif;
}

.drawer-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    color: #333333;
    font-size: 18px;
    line-height: 1.6;
}

.drawer-item {
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(0, 190, 167, 0.1);
    border: 1px solid rgba(0, 190, 167, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drawer-item:hover {
    background: rgba(0, 190, 167, 0.2);
    border-color: rgba(0, 190, 167, 0.4);
    box-shadow: 0 0 12px rgba(0, 190, 167, 0.3);
}

.drawer-item-title {
    color: #00bea7;
    font-weight: 600;
    margin-bottom: 4px;
}

.drawer.zoom-hidden {
    box-shadow: none;
}

/* 代码编辑区域 */
.code-section {
    margin-top: 12px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid rgb(0, 0, 0, 0.1);
}

.code-lang {
    color: #00bea7;
    font-weight: 600;
    font-size: 13px;
}

.CodeMirror-wrap {
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.CodeMirror {
    height: min(320px, 40vh);
    border-radius: 0 0 8px 8px;
    font-size: 13px;
    background: transparent !important;
    color: #d6deeb;
}

.CodeMirror-scroll {
    padding: 12px;
}

.CodeMirror-lines {
    padding-bottom: 20px !important;
}

.CodeMirror-gutters {
    background: transparent !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile: convert drawer to bottom sheet */
@media (max-width: 640px) {
    .drawer {
        width: 100%;
        height: 60vh;
        top: auto;
        bottom: 0;
        right: 0;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
        padding: 16px;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 -12px 30px rgba(0,0,0,0.25);
    }

    .drawer.active {
        transform: translateY(0) !important;
    }

    .drawer-header { padding-bottom: 10px; }

    .CodeMirror { height: min(260px, 36vh); }
}

.code-footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 0 0;
}

.code-execute-btn {
    width: 100%;
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    background: #00bea7;
    color: #ffffff;
    font-size: 19px;
    font-family: 'Alibaba PuHuiTi', 'Alibaba PuHuiTi Subset', 'Noto Sans SC', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 6px 18px rgba(0, 190, 167, 0.35);
}

.code-execute-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 190, 167, 0.45);
}

.code-execute-btn:active {
    transform: translateY(0);
    opacity: 0.92;
}

/* scrollbar */
.CodeMirror-scroll::-webkit-scrollbar { height: 10px; width: 8px; }
.CodeMirror-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 6px; }

.editor-container {
    box-shadow: 0 6px 20px rgba(2,6,23,0.6);
    border-radius: 8px;
    overflow: hidden;
}
