/* 全局重置 */
html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* 重力模拟区域 */
.gravity-section {
    text-align: center;
    padding: 1em;
}

/* 控件区域 */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8em;
    margin-bottom: 1em;
}

.control-group {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ccc;
    padding: 0.4em 0.8em;
    border-radius: 10px;
    font-size: 0.9em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.control-group label {
    margin-right: 0.5em;
    color: #333;
    font-weight: 500;
}

.control-group input[type="number"],
.control-group input[type="color"] {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.3em 0.6em;
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.3s;
}

.control-group input[type="number"]:focus,
.control-group input[type="color"]:focus {
    border-color: #4a90e2;
}

/* 按钮 */
.controls button {
    padding: 0.5em 1.2em;
    font-size: 0.9em;
    background: #4a90e2;
    color: white;
    border: 1px solid #4a90e2;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}
.controls button:hover {
    background: white;
    color: #4a90e2;
}

/* 画布容器 */
.canvas-wrap {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: center;
}

/* Canvas 样式 */
#gravityCanvas {
    width: 100%;
    height: min(58vh, 560px);
    background: #f5f7fa;
    border: 2px solid #4a90e2;
    border-radius: 12px;
    display: block;
    margin: 0;
    touch-action: none;
    user-select: none;
    box-sizing: border-box; /* 防止边框撑大 */
}
