* {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Segoe UI", sans-serif;
    overflow: hidden;
    background: #f5f5f5;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.toolbar {
    height: 42px;
    background: #2c3e50;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 6px;
    flex-shrink: 0;
}

.logo {
    font-weight: bold;
    margin-right: 10px;
    color: #3498db;
}

.divider {
    width: 1px;
    height: 18px;
    background: #555;
    margin: 0 5px;
}

select {
    background: #34495e;
    color: white;
    border: 1px solid #555;
    padding: 3px;
    font-size: 12px;
    border-radius: 2px;
    outline: none;
}

button {
    padding: 4px 12px;
    cursor: pointer;
    border: none;
    border-radius: 2px;
    background: #ecf0f1;
    font-size: 12px;
}

button:hover {
    background: #bdc3c7;
}

button.primary {
    background: #2ecc71;
    color: white;
}

.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

.sidebar {
    width: 280px;
    min-width: 200px;
    background: #fff;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.prop-group {
    margin-bottom: 2px;
}

.prop-header {
    background: #ebebeb;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: bold;
    color: #555;
    border-bottom: 1px solid #ccc;
    border-top: 1px solid #ccc;
}

.prop-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    min-height: 30px;
}

.prop-row label {
    width: 90px;
    padding-left: 12px;
    font-size: 12px;
    color: #333;
    border-right: 1px solid #eee;
    flex-shrink: 0;
    font-weight: bold;
}

.prop-row input {
    flex: 1;
    border: none;
    padding: 4px 8px;
    font-size: 12px;
    outline: none;
    background: transparent;
}

.splitter {
    width: 6px;
    background: #ddd;
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.2s;
    position: relative;
    z-index: 10;
}

.splitter:hover,
.splitter.active {
    background: #3498db;
}

/* === 数学公式高级排版样式 === */
.expression-container {
    margin: 15px;
    padding: 20px 10px;
    background: #fdfdfd;
    border: 1px solid #eee;
    text-align: center;
    border-radius: 4px;
    overflow-x: auto;
}

.exp-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 15px;
    text-align: left;
}

.math-formula {
    font-family: "Times New Roman", Times, serif;
    font-size: 20px;
    font-style: italic;
    color: #2c3e50;
    font-weight: bold;
    text-align: center;
    line-height: 1.5;
    white-space: nowrap;
}

.math-formula .normal {
    font-style: normal;
    font-weight: normal;
}

/* 严格控制上下标尺寸与位置 */
.math-formula sup {
    font-size: 0.65em;
    vertical-align: super;
    line-height: 0;
}

.math-formula sub {
    font-size: 0.65em;
    vertical-align: sub;
    line-height: 0;
    margin-right: 4px;
}

/* 分数排版 */
.frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    margin: 0 4px;
    font-size: 0.9em;
}

.frac>span:first-child {
    border-bottom: 1.5px solid #2c3e50;
    padding: 0 4px;
    line-height: 1.2;
}

.frac>span:last-child {
    padding: 0 4px;
    line-height: 1.2;
}

/* 参数方程大括号排版 */
.system {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    vertical-align: middle;
}

.system-brace {
    font-size: 2.8em;
    font-weight: 100;
    font-style: normal;
    margin-right: 6px;
    line-height: 1;
    transform: scaleY(1.1);
}

.system-eqs {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 8px;
    font-size: 0.95em;
}

/* ======================== */

.drawing-area {
    flex: 1;
    background: #fff;
    position: relative;
    overflow: hidden;
}

#mathCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.statusbar {
    height: 24px;
    background: #eee;
    border-top: 1px solid #ccc;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    line-height: 24px;
    color: #666;
    flex-shrink: 0;
}

.guide {
    padding: 15px;
    font-size: 12px;
    color: #555;
    border-top: 1px solid #eee;
    margin-top: auto;
}

.guide h4 {
    margin: 0 0 5px 0;
    font-size: 13px;
    color: #333;
}