*{
margin:0;
padding:0;
box-sizing:border-box;
}

body{
    font-family:Arial, sans-serif;
    min-height:100vh;
    display:flex;
    flex-direction:column;
    background:#f4f4f4;
}

header{
    height:60px;
    background:#222;
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 20px;
}

header h1{
    font-size:22px;
}

header button{
    padding:8px 14px;
    border:none;
    cursor:pointer;
    border-radius:6px;
}

main{
    flex:1;
    padding:24px;
    max-width:1120px;
    width:100%;
    margin:0 auto;
}

.layout-shell{
    height:100%;
    border:3px solid #555;
    padding:18px;
    display:flex;
    flex-direction:column;
    gap:20px;
}

.panel{
    padding:16px;
    border-radius:2px;
    border:2px solid #555;
    display:flex;
    flex-direction:column;
    min-height:0;
}

.left{
    background:#ffffff;
}

.right{
    background:#ffffff;
    overflow:auto;
}

.formula-toolbar{
    min-height:100px;
    justify-content:center;
}

.math-shortcuts{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.math-btn{
    min-width:72px;
    height:42px;
    border:2px solid #555;
    border-radius:8px;
    background:linear-gradient(180deg, #fff 0%, #f1f1f1 100%);
    cursor:pointer;
    font-size:20px;
    font-weight:700;
}

.math-btn:hover{
    background:linear-gradient(180deg, #ffffff 0%, #e7eefc 100%);
}

.content-panel{
    min-height:220px;
    flex:1;
}

.panel h2{
    font-size:34px;
    margin-bottom:12px;
    font-weight:400;
    text-align:center;
}

textarea{
    width:100%;
    height:100%;
    resize:none;
    border:1px solid #ccc;
    border-radius:8px;
    padding:15px;
    font-size:20px;
    font-family:monospace;
}

#preview{
font-size:28px;
min-height:100%;
display:flex;
align-items:center;
justify-content:center;
}

@media (max-width: 980px){
    main{
        max-width:none;
        padding:14px;
    }

    .layout-shell{
        padding:12px;
        gap:12px;
    }

    .panel h2{
        font-size:28px;
    }

    .math-btn{
        min-width:62px;
        font-size:18px;
    }
}
